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