Username Maximum Length (Bugs)

by davwat, Tuesday, January 13, 2009, 14:47 (5554 days ago)
edited by davwat, Tuesday, January 13, 2009, 15:02

Current version (2.0)

I have the username_maxlength set at 15. People however are able to register with a Username much longer than 15 characters.

In looking through the file 'register.inc.php' it appears that when people are registering the program is checking 'name_word_maxlength' instead of 'username_maxlength'.

---
P. S.

I am still wishing and hoping that you will add the feature of being able to search for users in the Admin section by a users email address as well as by their Username. Moving through the pages of 3,000 users to locate an email addresses in order to find a Username which a person has forgotten is a long task.

Thanks
Dave Watkins

locked
6524 views
Avatar

Username Maximum Length

by Alex ⌂, Wednesday, January 14, 2009, 17:12 (5553 days ago) @ davwat

Hi Dave,

I have the username_maxlength set at 15. People however are able to register with a Username much longer than 15 characters.

Thanks for the note! Here's a 2.0.1 pre-release with the bugfix:
my_little_forum_2.0.1_pre.zip

Changed files: includes/register.inc.php, templates/default/subtemplates/register.tpl.inc

I am still wishing and hoping that you will add the feature of being able to search for users in the Admin section by a users email address as well as by their Username.

Good idea! And should be simple to implement:

Try to replace

$user_count_result = @mysql_query("SELECT COUNT(*) FROM ".$db_settings['userdata_table']." WHERE lower(user_name) LIKE '".mysql_real_escape_string(my_strtolower($search_user, $lang['charset']))."%'", $connid);

by

$user_count_result = @mysql_query("SELECT COUNT(*) FROM ".$db_settings['userdata_table']." WHERE concat(lower(user_name),lower(user_email)) LIKE '%".mysql_real_escape_string(my_strtolower($search_user, $lang['charset']))."%'", $connid);


and

$result = @mysql_query("SELECT user_id, user_name, user_type, user_email, logins, UNIX_TIMESTAMP(last_login + INTERVAL ".$time_difference." MINUTE) AS last_login_time, UNIX_TIMESTAMP(registered + INTERVAL ".$time_difference." MINUTE) AS registered_time, user_lock, activate_code FROM ".$db_settings['userdata_table']." WHERE lower(user_name) LIKE '".mysql_real_escape_string(my_strtolower($search_user, $lang['charset']))."%' ORDER BY ".$order." ".$descasc." LIMIT ".$ul.", ".$settings['users_per_page'], $connid);

by

$result = @mysql_query("SELECT user_id, user_name, user_type, user_email, logins, UNIX_TIMESTAMP(last_login + INTERVAL ".$time_difference." MINUTE) AS last_login_time, UNIX_TIMESTAMP(registered + INTERVAL ".$time_difference." MINUTE) AS registered_time, user_lock, activate_code FROM ".$db_settings['userdata_table']." WHERE concat(lower(user_name),lower(user_email)) LIKE '%".mysql_real_escape_string(my_strtolower($search_user, $lang['charset']))."%' ORDER BY ".$order." ".$descasc." LIMIT ".$ul.", ".$settings['users_per_page'], $connid);


in includes/admin.inc.php

Alex

locked
6050 views

Username Maximum Length

by davwat, Thursday, January 15, 2009, 09:44 (5552 days ago) @ Alex

Alex

Thanks for your prompt response to the two issues.

Have a Good Day!
Dave

locked
6018 views

RSS Feed of thread