Email Password getting splattered

When a user goes to their profile page to edit settings and clicks save with or without making any changes, their email password is reset.

This means that every time a user makes a change to any of their profile settings, they must also re-enter their email password.

The problem has an oblique reference in this post also.

Cheers

Bruce

Hi Bruce,

Thanks for highlighting this. I believe this is a known issue, as is the issue where the password in Admin -> Email Settings is reset each time the user saves.

Thanks,

Will.

Here is a patch fix for this problem. The file to change is /modules/Users/Save.php near line 415.

Before


            if($userOverrideOE != null)
            {
                //User is alloweed to clear username and pass so no need to check for blanks.
                $userOverrideOE->mail_smtpuser = $_REQUEST['mail_smtpuser'];
                $userOverrideOE->mail_smtppass = $_REQUEST['mail_smtppass'];
                $userOverrideOE->save();
            }

After


            if($userOverrideOE != null)
            {
                //User is allowed to clear username and pass so no need to check for blanks.
                //  Fair enough, but the current user interface does not support "change password" like the outbound email settings page so...
                $userOverrideOE->mail_smtpuser = $_REQUEST['mail_smtpuser'];
                //$userOverrideOE->mail_smtppass = $_REQUEST['mail_smtppass'];
                // trim password value
                $pw = preg_replace('/(^\s+)|(\s+$)/', '', $_REQUEST['mail_smtppass']);
                $userOverrideOE->mail_smtppass = $pw ? $pw : null;
                $userOverrideOE->save();
            }

Cheers

Bruce

1 Like