forum.coppermine-gallery.net

Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: Casper on January 31, 2005, 03:38:12 pm

Title: Database error when creating new users or modifying passwords in usermgr.php
Post by: Casper on January 31, 2005, 03:38:12 pm
Fresh install, standalone 1.4.1 checkout less than 1 hour ago.

You can create new users, but only if you leave the password field blank. If you do leave it blank, the new user cannot log in.

You cannot edit passwords in usermgr.php.

As a new install, this has the password encrypted.

db error is;

Quote
While executing query "UPDATE cpg140_users SET user_name = 'Pat', user_email = 'patzscott@rogers.com', user_active = 'YES', user_group = '1', user_profile1 = '', user_profile2 = '', user_profile3 = '', user_profile4 = '', user_profile5 = '', user_profile6 = '', user_group_list = '2'81069b209152545c2c3a86aa40f60699 WHERE user_id = '3'" on 0

mySQL error: You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '81069b209152545c2c3a86aa40f60699 WHERE user_id = '3'' at line 1

I believe it to be related to this code, which I don't know how to change;

Code: [Select]
if (strlen($user_password)) $sql_update .= ", user_password = '".($CONFIG['enable_encrypted_passwords'])?md5($user_password):$user_password."'";
    $sql_update .= " WHERE user_id = '$user_id'";
Title: Re: Database error when creating new users or modifying passwords in usermgr.php
Post by: Nibbler on January 31, 2005, 04:11:57 pm
It needs an extra set of brackets around it, so it looks like this:

Code: [Select]
.(($CONFIG['enable_encrypted_passwords'])?md5($user_password):$user_password).
Title: Re: Database error when creating new users or modifying passwords in usermgr.php
Post by: Casper on January 31, 2005, 04:33:49 pm
Yep, works fine now thanks Nibbler.

Will commit shortly.
Title: Re: Database error when creating new users or modifying passwords in usermgr.php
Post by: Joachim Müller on February 18, 2005, 08:57:16 am
confirming fix, marking as "fixed".

Joachim