[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtigercrm-developers
Subject:    [Vtigercrm-developers] email is case sensitive when when using forgotpassword
From:       "Hamono, Chris (DPC)" <Chris.Hamono () sa ! gov ! au>
Date:       2014-07-28 6:13:37
Message-ID: 6CC78B54517348498CB1E58845C8F3D13616FB528F () EMSCM005 ! sagemsmrd01 ! sa ! gov ! au
[Download RAW message or body]


When someone has forgotten their password the email address is case sensitive.

The following code in forgotPassword.php

	$username = vtlib_purify($_REQUEST['user_name']);
	$result = $adb->pquery('select email1 from vtiger_users where user_name= ? ', \
array($username));  if($adb->num_rows($result) > 0) {
		$email = $adb->query_result($result, 0, 'email1');
	}

	if(vtlib_purify($_REQUEST['emailId']) == $email) {



Should be changed to

	$username = vtlib_purify($_REQUEST['user_name']);
	$result = $adb->pquery('select email1 from vtiger_users where user_name= ? ', \
array($username));  if($adb->num_rows($result) > 0) {
		$email = $adb->query_result($result, 0, 'email1');
	}

	if(strcasecmp ($_REQUEST['emailId'],$email)  ===  0) {

It is important to note that comparisons done using == or === are always case \
sensitive. It's also important to note that comparisons should always be done with \
the type sensitive comparison operators  === or !==

$int = 0;
$name = "";

If ($int == $name) { <== true

If ($int === $name) { <== false


Chris

_______________________________________________
http://www.vtiger.com/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic