741
geekwright
Re: force changing password after importing user ?

A quick and dirty solution would be to change this line:
$user->setVar('pass'md5($liste[3]));

to:
$user->setVar('pass''');


The 'pass' column will not correspond to any possible password, so the only way to log in will be going through the forgot password logic to reset it.



742
alain01
Re: xmcontent 1.5 Final Released
  • 2021/7/24 22:09

  • alain01

  • Just can't stay away

  • Posts: 530

  • Since: 2003/6/20


Ok,
no logo on the article page, just in the index page.
May be Greg will implement this feature in the next version.

Bad solution is a "hack" :

file viewcontent.php
Add line 58
$xoopsTpl->assign('content_logo'$content->getVar('content_logo'));

file /themes/you_theme_bt4/modules/xmcontent/xmcontent_viewcontent.tpl

<img class="rounded img-fluid" src="/uploads/xmcontent/images/" alt="<{$content_title}>">

you can add img where you want in the article, near title or on left side for example



743
alain01
Re: xmcontent 1.5 Final Released
  • 2021/7/24 20:21

  • alain01

  • Just can't stay away

  • Posts: 530

  • Since: 2003/6/20


Hi mjoel,
humm,
Ok, let me try it...



744
mjoel
Re: xmcontent 1.5 Final Released
  • 2021/7/24 3:04

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


Hello,

thank you for this great module

how do i make the logo of the article appear in the article page ? right now it will only appear in the index page.

i tried to edit some php file and templates of xmcontent but the logo is not appearing int the article



745
mjoel
force changing password after importing user ?
  • 2021/7/24 2:56

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


Hi i saw this script on github.. Quick and dirty XOOPS user import from csv file by geekwright
https://gist.github.com/geekwright/3cc71647bdfd035e609c3a045fc6db41

how do i force the user to change their password for first time login in XOOPS ?

/**
 * modified from script by christian@frxoops.org
 * Import users from a csv file into xoops 2.5.8
 *
 * Put this file and your users.cvs file in the root of your site
 * go to http://yoursite/import_users.php in your browser
 * click the button to rn the import
 *
 * Don't forget to DELETE it after you run it!
 */

/* Example users.csv file:
Bill;Barra;bill.barra@yahoo.com;changeme
Mark;Knopfler;mark@knopfler.com;changeme
Jim;Morrison;jim.morrison@gmail.com;changeme
Roger;Daltrey;roger@daltrey.com;changeme
*/

// assuming this is in the web root
include 'mainfile.php';

// make sure we run as a POST transaction, so database operations do not need "force"
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
    echo 
'';
    exit();
}

$fichier 'users.csv'// data file as : first name(pseudo);last name;email;password
// remove line break on last record

/** @var XoopsMemberHandler $memberHandler */
$memberHandler xoops_getHandler('member');
if (
false === $memberHandler) die("Unable to create member handler");

$time time();

// Open file for read
if (file_exists($fichier))
    
$fp fopen("$fichier""r");
else{ 
// unknown file
    
echo "File not found !Import stopped.n";
    exit();
}
echo 
'
Begin file import '.$fichier."n"; 
// import line by line
while (!feof($fp)) {
    
$ligne fgets($fp4096);
    if (
'' === trim($ligne)) {
        continue; 
// blank line
    
}
    
$liste explode(";"$ligne); // create array
    
foreach ($liste as $index => $value) {
        
$liste[$index] = trim($value);
    }

    
/** @var XoopsUser $user */
    
$user $memberHandler->createUser();
    
$user->setVar('uname'$liste[0]);
    
$user->setVar('name'$liste[1]);
    
$user->setVar('email'$liste[2]);
    
$user->setVar('pass'md5($liste[3]));
    
$user->setVar('user_regdate'$time);
    
$user->setVar('user_level'1); // activated
    
$user->setVar('user_viewemail'1);
    
$user->setVar('user_avatar''avatars/blank.gif');

    
$uid $memberHandler->insertUser($user);

    if (
false === $uid) {
        echo 
sprintf("Failed to insert user %s n"$liste[0]);
        echo 
"Importation stoppée.n
"
;
        
fclose($fp);
        exit();
    }
    
$memberHandler->addUserToGroup(XOOPS_GROUP_USERS$uid);
    echo 
sprintf("Record %d - %s addedn"$uid$user->uname());
}
echo 
"Import finished successfully.n";

fclose($fp);



746
mjoel
Re: wgDiaries 1.03 RC1 ready for testing
  • 2021/7/24 2:50

  • mjoel

  • Quite a regular

  • Posts: 325

  • Since: 2006/12/9


my user and me love this module very much...thank you for your spectacular work Goffy..

yes i think you can proceed to make it final



747
oswaldo
Re: I have an error in the profile module when I close session and user registration
  • 2021/7/20 1:43

  • oswaldo

  • Quite a regular

  • Posts: 215

  • Since: 2008/8/22


Thanks for the info, I will do everything you tell me and I will update the core



748
geekwright
Re: I have an error in the profile module when I close session and user registration

No, it isn't really OK.

To use XoopsCore25 2.5.11-Beta2 you need to take the complete latest master branch from https://github.com/XOOPS/XoopsCore25

You have a newer version of htdocs/modules/profile while the rest of htdocs is older. You should find xoops_setcookie() used nearly everywhere, as setcookie() is avoided in core except in very limited cases and in the implementation of xoops_setcookie() in htdocs/include/xoopssetcookie.php included by htdocs/include/common.php

This is a very important change for compatibility with newer PHP versions and evolving web standards.

See: https://github.com/XOOPS/XoopsCore25/pull/1026 for details on this new function and the reasons for it



749
oswaldo
Re: I have an error in the profile module when I close session and user registration
  • 2021/7/18 15:33

  • oswaldo

  • Quite a regular

  • Posts: 215

  • Since: 2008/8/22


A question to the masters

I have been looking for the xoops_setcookie function in the entire htdocs folder, using Replace Studio and I only found it in the user.php file in the profiles module and in main.php in system module preferences, in the files checklogin.php, common.php, functions.php, session.php, smarty.class.php, cookie.php, user.php and others from the core, only setcookie appears, I deleted xoops_ from the word xoops_setcookies from lines 88 and 89 of the user.php file of the profiles module, leaving only setcookies and the error disappeared.

Is it okay to leave it like that or not?

I'm using
XOOPS 2.5.11-Beta2
PHP 8.0.3
mySQL 5.5.5-10.4.18-MariaDB
Profiles 1.91



750
oswaldo
Re: I have an error in the profile module when I close session and user registration
  • 2021/7/17 15:14

  • oswaldo

  • Quite a regular

  • Posts: 215

  • Since: 2008/8/22


Thanks i will do IT
I'm using te bootstrap 3 theme




TopTop
« 1 ... 72 73 74 (75) 76 77 78 ... 29425 »



Login

Who's Online

607 user(s) are online (314 user(s) are browsing Support Forums)


Members: 0


Guests: 607


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits