X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Allow @ and other characters as username (https://forum.x-cart.com/showthread.php?t=51053)

Harmedia 11-30-2009 08:28 AM

Allow @ and other characters as username
 
Dear Community,

I would like that users can use the "@" and the "." in their username.

What should I edit to do this?

Kind regards,

Bastiaan

pauldodman 11-30-2009 10:49 AM

Re: Allow @ and other characters as username
 
Please note that this link is not an answer to your question, but we need you to update your signature with your X-Cart version (as per forum rules) so that we can answer your questions correctly. Thanks!

There are a few threads on this already - I would have pointed you to one, but I don't know what version you need it for!
Have a search for email username and you should find what you are looking for.

Harmedia 11-30-2009 01:30 PM

Re: Allow @ and other characters as username
 
Thank for the update. I just did an update on my signature.

The problem is more that when I try to type a "@" in the username field it says its not allowed.

Is there a line in the code that I can change so it allows it?

Most posts mention the fact that you have to alter 10+ pages, but that's more for store that just want an email address as log in, they don't also use a username.

I will solve that problem by renaming "Email address" with "Re-enter email address"

So I search the line which prohibits the use of "@" and "." in the username field.

Kind regards,

Bastiaan

wjbrewer 11-30-2009 03:42 PM

Re: Allow @ and other characters as username
 
Open the include/register.php file and change this:

PHP Code:

if ((strcmp($uname_tmp$uname) != 0) || (!preg_match("/^[a-z0-9_-]+$/s"$uname) && $uname != "")) 


to this:

PHP Code:

if ((strcmp($uname_tmp$uname) != 0) || (!preg_match('/^[a-z0-9_@.-]+$/i'$uname) && $uname != "")) 


The default X-Cart 4.1 code allows only lowercase a-z, 0-9, -, and _. Oddly this code also has a flag to treat . as a line break, but there isn't a . in the code regex??

The new code will allow lower or uppercase a-z, 0-9, -, @, ., and _.

hoosierglass 11-30-2009 04:24 PM

Re: Allow @ and other characters as username
 
Any chance that something like this can be used to correct the & issue in the Company Name field?

Harmedia 12-01-2009 01:58 AM

Re: Allow @ and other characters as username
 
Brewer,

Quote:

if ((strcmp($uname_tmp, $uname) != 0) || (!preg_match("/^".func_login_validation_regexp()."$/is", $uname) && $uname != ""))

This is what I see in my PHP file. Does your solution still works then or do I need some other way? (looks like it refers to another file?)

Kind regards,

Bastiaan


All times are GMT -8. The time now is 04:02 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.