Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Allow @ and other characters as username

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-30-2009, 08:28 AM
 
Harmedia Harmedia is offline
 

Newbie
  
Join Date: Nov 2009
Posts: 6
 

Default 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
__________________
X-cart Version 4.3
Reply With Quote
  #2  
Old 11-30-2009, 10:49 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,062
 

Default 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.
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #3  
Old 11-30-2009, 01:30 PM
 
Harmedia Harmedia is offline
 

Newbie
  
Join Date: Nov 2009
Posts: 6
 

Default 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
__________________
X-cart Version 4.3
Reply With Quote
  #4  
Old 11-30-2009, 03:42 PM
  wjbrewer's Avatar 
wjbrewer wjbrewer is offline
Banned
 

X-Adept
  
Join Date: Feb 2005
Location: Pittsburgh, PA
Posts: 504
 

Default 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 _.
Reply With Quote
  #5  
Old 11-30-2009, 04:24 PM
  hoosierglass's Avatar 
hoosierglass hoosierglass is offline
 

X-Adept
  
Join Date: Aug 2006
Location: Zionsville, IN
Posts: 974
 

Default 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?
__________________
X-Cart Gold 4.7.7
Custom Work from www.luminointernet.com
www.indy-pen-dance.com
Reply With Quote
  #6  
Old 12-01-2009, 01:58 AM
 
Harmedia Harmedia is offline
 

Newbie
  
Join Date: Nov 2009
Posts: 6
 

Default 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
__________________
X-cart Version 4.3
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:06 AM.

   

 
X-Cart forums © 2001-2020