ivannovak / jpmaster77-s-Login-System-

jpmaster77's Login System v2.0.4d
http://www.evolt.org/node/60384
Other
42 stars 28 forks source link

Registration fails, but login works #12

Closed jmlb closed 13 years ago

jmlb commented 13 years ago

Hi, I am trying out the latest version of the Login System and I can't make it work. I get the error message: Registration Failed We're sorry, but an error has occurred and your registration for the username xxxx, could not be completed. Please try again at a later time. I checked the error.log and there is no error associated with running this code. I also use Login System version 2004 to register a user. That works. I was able to create a user and login with that version of Login System. Then, I change the valid field in users to 1 and then I was able to login with Login System version 2011. So, basically, I have a problem to register new users. I have made the appropriate changes into constant.php, i.e set DB_SERVER, DB_USER, DB_PASS, and DB_NAME and it seems the problem does not come from there since I was able to login with version 2011. I'd appreciate any suggestions you might have.

KBischof commented 13 years ago

I've witnessed this error, it first appeared after the Feb 28, 2011 commit. I believe the issue is in the include/database.php file, line 171 should be changed to:

 $q = sprintf("INSERT INTO ".TBL_USERS." VALUES ('%s', '%s', '%s', '%s', '%s', $time, '0', '%s', '0', '0')",

In SQL when not defining columns in an insert, you have to list the column values as they appear in the database. The SQL code was missing values for 'hash' and 'hash_generated.'

I hope this helps you and others!

KB