Quote from: rthrash at Apr 21, 2008, 11:37 PM
Should you also allow anyone to register with a username that equals their email address?
[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,7}
Provided you are using my updated e-mail RegExp, then it would need to accept the following:
a-zA-Z, 0-9, period, underscore, percent, plus, minus, @ sign
//<?php // Used for highlighting only - Do Not Copy
// Check username for bullshit.
if( strspn($_POST['username'],'"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._%+-@') != strlen($_POST['username']) ) // pixelchutes
However, you’ll find you may quickly run into this error message:
Your username is too long. It must be less than 20 characters.
(Which is odd, since the table structurally can hold up to 100 characters)
To correct this, find the following:
//<?php // Used for highlighting only - Do Not Copy
// Check username length
if (strlen($username) >= 20)
And update to this:
//<?php // Used for highlighting only - Do Not Copy
// Check username length
if (strlen($username) > 100)
Registered Successfully!* Now you can register your email as your username! (Thx Ryan)
Quote from: "assets/snippets/webloginpe/lang/en.php" $wlpe_lang[1] = ’Your username is too long. It must be less than 20 characters.’;
NOTES:*
- You may want to update your language files for
$wlpe_lang[1] as it states maximum length of 20 characters here
- By allowing e-mail address to function as the registered member’s username, you may run into unforeseen (and untested) dilemmas, such as: public exposure of "usernames" which many users would not like, as well "Profile" view from the users list appears to break:
For example, if you registered using a username of:
[email protected]
The default "View User Profile" link would cause the plus to be converted to a space, resulting in an empty result set for the query, not to mention an empty profile page:
SELECT * FROM `modx_site`.`modx_web_users` WHERE `username` = 'mike [email protected]'
One way this could be corrected is by handling web user references via internalKey in place of username, but would also require additional work to the PHP Class.
view_profile.html?service=viewprofile&[email protected]
to something like:
view_profile.html?service=viewprofile&userid=15
Provided everything DID work ok, however, some users may still wish to hide their email address from public view...
Then what? You could use the user’s Fullname, but that might conflict with those users who want their name protected.
Would you then need to begin handling custom --yet unique--"Display Names"