Minor Admin CP suggestion [message #15517] |
Wed, 17 December 2003 18:21 |
Gribnif
Messages: 82 Registered: December 2003
Karma: 0
|
Member |
|
|
When testing out the forum yesterday, I kept trying to add a new user, only to have it fail with the error message "[username] already exists," even though the name didn't.
I finally figured out that what did already exist was the *email* address. Because I was testing, I was trying to use the same address for the second account.
I think the error message should reflect this.
|
|
|
Re: Minor Admin CP suggestion [message #15528 is a reply to message #15517] |
Wed, 17 December 2003 21:30 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Which version of the forum are you using and what database backend, the check to give a proper error is already there.
FUDforum Core Developer
|
|
|
|
|
|
Re: Minor Admin CP suggestion [message #15544 is a reply to message #15543] |
Thu, 18 December 2003 14:04 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
I've tried the code yesterday with MySQL 3.23.58 and 4.0.16 and in both instances proper error was raised when an attempt to create a user with a duplicate e-mail was made.
The only time this may not work is if BOTH the login & the e-mail are duplicate.
FUDforum Core Developer
|
|
|
Re: Minor Admin CP suggestion [message #15546 is a reply to message #15517] |
Thu, 18 December 2003 15:03 |
Gribnif
Messages: 82 Registered: December 2003
Karma: 0
|
Member |
|
|
This is the result I just got when I tried it again:
Add User
Error Has Occured
Register a new forum user.
Login: Login (lkjglj) is already in use.
Where lkjglj is just a random set of characters I banged on the keyboard, and only the email address was the same as another account.
I just pulled the code out of admadduser.php and substituted what seemed like good values:
INSERT INTO fud_users
(login, alias, passwd, name, email, time_zone, join_date, theme, users_opt, last_read) VALUES (
'lkdjfgl', 'kjhertk', 'junk',
'ldfglnkre', '[duplicate email address]', 'timezone',
'stamp', 'default', 0, 'stamp');
This produced the MySQL error:
ERROR 1062: Duplicate entry '[duplicate email address]' for key 2
Note that it says key 2. According to the code in admadduser, this gives the (wrong) error message I'm seeing. If I instead change the SQL code so that the "login" field is the duplicate, MySQL says this is key 3.
A "SHOW CREATE TABLE fud_users" lists the keys in this order:
PRIMARY KEY (`id`),
UNIQUE KEY `fud_users_i_e` (`email`),
UNIQUE KEY `fud_users_i_l` (`login`),
UNIQUE KEY `fud_users_i_a` (`alias`),
KEY `fud_users_i_rk` (`reset_key`),
KEY `fud_users_i_lv` (`last_visit`),
KEY `fud_users_i_ck` (`conf_key`),
KEY `fud_users_i_ri` (`referer_id`),
KEY `fud_users_i_uo` (`users_opt`)
) TYPE=MyISAM |
|
|
|
|