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

4.2 User Name Question

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-24-2008, 06:27 PM
 
Duramax 6.6L Duramax 6.6L is offline
 

X-Adept
  
Join Date: Dec 2006
Posts: 865
 

Default 4.2 User Name Question

Please move this message if I posted to wrong forum.

I am trying to change the registration form to allow capital letters. I changed the following line in include/register.php but it does not work.

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

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

when registering an admin or customer, it still displays the error message that only lower case letters and numbers may be used.
__________________
Xcart 5.1.6 Building New Store
Xcart4.6.4 Gold Plus
Xcart 4.6.4 Platinum
Smart Template,
Mail Chimp Upgrade
Checkout One (One Page Checkout)
Checkout One X-Payments Connector
Checkout One Deluxe Tools
Call For Price
On Sale Module
Buy Together Module
MAP Price MOD
Reply With Quote
  #2  
Old 11-25-2008, 04:49 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: 4.2 User Name Question

Did you clear the cache?

Strange how in prior versions x-cart used "!preg_match", but in 4.1.11 they used "eregi", and now with 4.2 it looks like they are going back to "!preg_match".

Why would they do that?
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #3  
Old 11-25-2008, 08:02 AM
 
Duramax 6.6L Duramax 6.6L is offline
 

X-Adept
  
Join Date: Dec 2006
Posts: 865
 

Default Re: 4.2 User Name Question

Yes I cleared the the templates_c folder and I cleared my browser cache. I even tried a different browser.
__________________
Xcart 5.1.6 Building New Store
Xcart4.6.4 Gold Plus
Xcart 4.6.4 Platinum
Smart Template,
Mail Chimp Upgrade
Checkout One (One Page Checkout)
Checkout One X-Payments Connector
Checkout One Deluxe Tools
Call For Price
On Sale Module
Buy Together Module
MAP Price MOD
Reply With Quote
  #4  
Old 11-25-2008, 02:36 PM
 
Duramax 6.6L Duramax 6.6L is offline
 

X-Adept
  
Join Date: Dec 2006
Posts: 865
 

Default Re: 4.2 User Name Question

I got it to save the profile, but when it saves it to the database even though there are capital letters, it saves it in the database as lower case letters.

There is something over riding the settings on the register.php file.
__________________
Xcart 5.1.6 Building New Store
Xcart4.6.4 Gold Plus
Xcart 4.6.4 Platinum
Smart Template,
Mail Chimp Upgrade
Checkout One (One Page Checkout)
Checkout One X-Payments Connector
Checkout One Deluxe Tools
Call For Price
On Sale Module
Buy Together Module
MAP Price MOD
Reply With Quote
  #5  
Old 11-26-2008, 05:20 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: 4.2 User Name Question

Strange...
In 4.1.8 (note: no "!preg_match" or "eregi")
Code:
# # Check for errors # $uname_tmp=stripslashes($uname); if (strcmp($uname_tmp, $uname) !=0) $error="Username ".$uname_tmp." is invalid! Please correct"; else $error=''; $smarty->assign("error",$error);
In 4.1.10 (added "eregi" and "newbie/anonymous" checks)
Code:
# # Check for errors # $uname_tmp=stripslashes($uname); if ((strcmp($uname_tmp, $uname) !=0) || (eregi("[^a-z0-9_-]",$uname) && $newbie == "Y" && $anonymous != "Y")) $error="username"; else $error=''; $smarty->assign("error",$error);
In Security Patch 2008-07-02_4.1.10 (no change from 4.1.10 - still "eregi"and "newbie/anonymous" checks)
Code:
# # Check for errors # $uname_tmp=stripslashes($uname); if ((strcmp($uname_tmp, $uname) !=0) || (eregi("[^a-z0-9_-]",$uname) && $newbie == "Y" && $anonymous != "Y")) $error="username"; else $error=''; $smarty->assign("error",$error);
In 4.1.11 (changed "eregi" to "!preg_match"and no "newbie/anonymous" checks)
Code:
# # Check for errors # $error = ''; # Login will be checked only for new profiles if ($mode != "update") { $uname_tmp = stripslashes($uname); if ((strcmp($uname_tmp, $uname) != 0) || (!preg_match("/^[a-z0-9_-]+$/s", $uname) && $uname != "")) $error = "username"; } $smarty->assign("error", $error);
In 4.2.0b (no change from 4.1.11)
Code:
# # Check for errors # $error = ''; # Login will be checked only for new profiles if ($mode != "update") { $uname_tmp = stripslashes($uname); if ((strcmp($uname_tmp, $uname) != 0) || (!preg_match("/^[a-z0-9_-]+$/s", $uname) && $uname != "")) $error = "username"; } $smarty->assign("error", $error);

This brings some questions...
1. Why the switch from "eregi" to "!preg_match"?
2 Why were the "newbie" and "anonymous" checks added, then removed?
3. Why was "if ($mode != "update")" added if, as you say, "There is something over riding the settings" when it is updated?
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #6  
Old 11-26-2008, 08:11 AM
 
Duramax 6.6L Duramax 6.6L is offline
 

X-Adept
  
Join Date: Dec 2006
Posts: 865
 

Default Re: 4.2 User Name Question

I have been looking for this for days,

The user name will save as capital letters, but when it shows who is logged in it shows all lower case letters.

I have searched through the mysql data base and have not found any other places where the customer user name is saved. So it must be some code somewhere that is causing the names to display in lower case only.
__________________
Xcart 5.1.6 Building New Store
Xcart4.6.4 Gold Plus
Xcart 4.6.4 Platinum
Smart Template,
Mail Chimp Upgrade
Checkout One (One Page Checkout)
Checkout One X-Payments Connector
Checkout One Deluxe Tools
Call For Price
On Sale Module
Buy Together Module
MAP Price MOD
Reply With Quote
  #7  
Old 11-26-2008, 10:07 AM
 
exsecror exsecror is offline
 

X-Wizard
  
Join Date: Apr 2007
Posts: 1,284
 

Default Re: 4.2 User Name Question

Have you checked the templates to see if it's using something like {$username|lower} ?
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 05:26 AM.

   

 
X-Cart forums © 2001-2020