Best practice forum (Archived)

This forum discussion has been removed

 
This forum post has been removed
Thursday, 2 May 2013, 5:49 PM
The content of this forum post has been removed and can no longer be accessed.
me
Re: Totara sync password problem
by George Angus - Thursday, 2 May 2013, 9:18 PM
Group Totara

Hi Lane,

Can you send us a copy of the CSV? 

regards,

 

George.

me
Re: Totara sync password problem
by George Angus - Tuesday, 7 May 2013, 9:29 PM
Group Totara

Hi Lane,

I got in again OK today with the password uploaded by bulk upload. My feeling is the problem must lie with the custom software - as its the only element which is different.

regards,

George.

This forum post has been removed
Wednesday, 8 May 2013, 3:58 AM
The content of this forum post has been removed and can no longer be accessed.
This forum post has been removed
Wednesday, 8 May 2013, 7:12 AM
The content of this forum post has been removed and can no longer be accessed.
This forum post has been removed
Wednesday, 8 May 2013, 4:07 PM
The content of this forum post has been removed and can no longer be accessed.
me
Re: Totara sync password problem
by George Angus - Wednesday, 8 May 2013, 4:47 PM
Group Totara

Hi guys,

This is the relevant code:

You can comment out the code causing that in /admin/cron.php around line 440

just add /* */ around the code like this.

+    /*
441         //
442         // generate new password emails for users
443         //
444         mtrace('checking for create_password');
445         if (count_records('user_preferences', 'name', 'create_password', 'value', '1')) {
446             mtrace('creating passwords for new users');
447             $newuserssql = "SELECT u.id as id, u.email, u.firstname, u.lastname, u.username, u.deleted, p.id as prefid
448                               FROM {$CFG->prefix}user u
449                               JOIN {$CFG->prefix}user_preferences p ON u.id=p.userid
450                              WHERE p.name='create_password' AND p.value='1' AND u.email !='' ";
451             if ($newusers = get_records_sql($newuserssql)) {
452                 foreach ($newusers as $newuserid => $newuser) {
453                     $newuser->emailstop = 0; // send email regardless
454                     // email user
455                     if (setnew_password_and_mail($newuser)) {
456                         // remove user pref
457                         delete_records('user_preferences', 'id', $newuser->prefid);
458                     } else {
459                         trigger_error("Could not create and mail new user password!");
460                     }
461                 }
462             }
463         }
+    */