mariovaldez.net

MV.net forums
It is currently 14 Jul 2016, 00:35

All times are UTC - 7 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Case Sensitivity
PostPosted: 28 May 2009, 04:21 
Sorry, probably been covered already, but by default username and password are case insensitive. Apart from the obvious diminished level of security, the problem I had was that I subsequently used the username as criteria in an SQL 'WHERE' statement to retrieve user specific content for my web page depending on who had logged in. Worked fine provided the user logged in with exactly matching credentials, but if they got the case wrong, they'd still get in to the site, but no content..!

The following modification worked for me, which basically makes the username and password case sensitive by not forcing them to uppercase before comparing. In the file slogin_lib.inc.php find the following 2 lines and change to:


if (strtoupper (trim ($slogin_content[0])) == strtoupper (trim ($username))) {

Changes to

if (trim ($slogin_content[0]) == trim ($username)) {

And

if (strtoupper (trim ($slogin_content[1])) == strtoupper (trim ($password))) {

Changes to

if (trim ($slogin_content[1]) == trim ($password)) {


Report this post
Top
  
Reply with quote  
 Post subject: Re: Case Sensitivity
PostPosted: 21 Aug 2009, 10:42 
Nice one, - thanks for that.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group