PHP Classes

admin_user change password for user

Recommend this page to a friend!

      Access user Class  >  All threads  >  admin_user change password for user  >  (Un) Subscribe thread alerts  
Subject:admin_user change password for user
Summary:Suggested coding change
Messages:2
Author:Alan Chard
Date:2005-11-18 05:11:25
Update:2005-11-18 09:13:49
 

  1. admin_user change password for user   Reply   Report abuse  
Picture of Alan Chard Alan Chard - 2005-11-18 05:11:25
I kept getting "Database error, please try again" error message when trying to update the password.

Study of the code suggests that function update_user_by_admin in class Admin_user wants minor alteration where the sql query is being assembled it currently reads:

$sql = "UPDATE %s SET access_level = %d, email = '%s', active = '%s'";
$sql .= ($def_pass != "") ? sprintf(", SET pw = '%s'", md5($def_pass)) : "";
$sql .= " WHERE id = %d";
$sql_compl = sprintf($sql, $this->table_name, $new_level, $new_email, $active, $user_id);

I think the second line should have the SET plus the following space removed, so that line reads:

$sql .= ($def_pass != "") ? sprintf(", pw = '%s'", md5($def_pass)) : "";

It works for me with that change.

I'm nearly finished implementing it. Thank you for your work Olaf.

Alan Chard

  2. Re: admin_user change password for user   Reply   Report abuse  
Picture of Olaf Lederer Olaf Lederer - 2005-11-18 09:13:49 - In reply to message 1 from Alan Chard
Thank you,

I noticed this bug before and it looks like that I forgot to update the files...

;-)

gr. Olaf