Username bug

It appears that someone signing up with an all number username can complete the task but posts in the forum show up with a username of 'Undefined'.

2 questions. How can I stop people from using numbers and how can I change someones username?

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 17 Dec 2012

This is the check field for the user name in profile fields builder.

return ( preg_match( '/^[a-zA-Z0-9_-]+$/', $arg0 ) and !file_exists( $dir['root'] . $arg0 ) );

Remove the 0-9 to prevent numbers from being used. Like so.

return ( preg_match( '/^[a-zA-Z_-]+$/', $arg0 ) and !file_exists( $dir['root'] . $arg0 ) );

However, that will not allow any numbers. If your only wanting to stop usernames that are all numbers, then that will be tricky and i will need time to figure it out if it's even possible.

To change the user name. Just edit it in the database in the Profiles table and then clear the dolphin cache. Or at least the user cache.

https://www.deanbassett.com
Quote · 17 Dec 2012

The user name would need to be parsed before being saved in the database, and a check to see if it is missing any letter characters.  Or, parsed to see if it begins with a numeral.  Usually numerals are nice to add to the end of an user name if the user name is already taken.  Since a check is made for an existing user, add to that check to see if the user name starts with a numeral or if the user name does not contain any letter characters.

Geeks, making the world a better place
Quote · 17 Dec 2012

I can remove the numbers that's easy enough but it seems we are dancing around the real issue here. How come the forum cannot display the username if it's all numbers?

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 18 Dec 2012

 

How come the forum cannot display the username if it's all numbers?

In your first post, that was not one of your 2 questions.

I do not have a answer on this one. I do not like orca, and do not do work with it.



https://www.deanbassett.com
Quote · 18 Dec 2012

Agree on Orca; however, from what I have read, trying to integrate a third party forum causes all sorts of issues.

Geeks, making the world a better place
Quote · 18 Dec 2012

Ok, the answer is simple. I just need to check to make sure the name has a character other than a number in it. If I can do that, the problem is solved.

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 29 Dec 2012

 

Ok, the answer is simple. I just need to check to make sure the name has a character other than a number in it. If I can do that, the problem is solved.

 


replace

return ( preg_match( '/^[a-zA-Z0-9_-]+$/', $arg0 ) and !file_exists( $dir['root'] . $arg0 ) );

with

return ( preg_match( '/^[a-zA-Z -][a-zA-Z0-9_-]+$/', $arg0 ) and !file_exists( $dir['root'] . $arg0 ) );

you might also edit the _FieldError_NickName_Check to something like

Your Username must start with a letter and contain only latin symbols, numbers or underscore ( _ ) or minus ( - ) signs


usrbug.JPG · 45.5K · 789 views
Quote · 29 Dec 2012

Very cool but I am also using the space mod. Currently, it's

return ( preg_match('/^[a-zA-Z0-9_-]{3,15}(| [a-zA-Z0-9_-]{3,15})$/i', $arg0) and !file_exists( $dir['root'] . $arg0 ) );

Is it easy to modify this one? If it's not, I can go back to the default with your changes but would prefer to keep the ability to add spaces.

Is this what you added? [a-zA-Z -] Does that force the name to start with a letter?

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 30 Dec 2012

You can take his code.

return ( preg_match( '/^[a-zA-Z -][a-zA-Z0-9_-]+$/', $arg0 ) and !file_exists( $dir['root'] . $arg0 ) );

And just add a space in the second section.

Either this

return ( preg_match( '/^[a-zA-Z -][ a-zA-Z0-9_-]+$/', $arg0 ) and !file_exists( $dir['root'] . $arg0 ) );

Or this should work.

return ( preg_match( '/^[a-zA-Z -][a-zA-Z0-9 _-]+$/', $arg0 ) and !file_exists( $dir['root'] . $arg0 ) );

https://www.deanbassett.com
Quote · 30 Dec 2012

 

Very cool but I am also using the space mod. Currently, it's

return ( preg_match('/^[a-zA-Z0-9_-]{3,15}(| [a-zA-Z0-9_-]{3,15})$/i', $arg0) and !file_exists( $dir['root'] . $arg0 ) );

Is it easy to modify this one? If it's not, I can go back to the default with your changes but would prefer to keep the ability to add spaces.

Is this what you added? [a-zA-Z -] Does that force the name to start with a letter?

 Yes, simple way to force the username to start with a letter

provided more options, you can also try this one

return ( preg_match( '/^[a-zA-Z -][a-zA-Z0-9_-]{3,15}(| [a-zA-Z0-9_-]{3,15})$/i', $arg0) and !file_exists( $dir['root'] . $arg0 ) );

it's one you had, now it just requires the  username to start with a letter.

Quote · 30 Dec 2012

Thanks! Works perfectly.....

http://towtalk.net ... Hosted by Zarconia.net!
Quote · 30 Dec 2012

http://www.boonex.com/trac/dolphin/ticket/2991

Rules → http://www.boonex.com/terms
Quote · 7 Jan 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.