Welcome to Vtiger Community. To gain access for account, please contact [ info @ vtiger.com ]

Commit b13dbbc59b2a5532593249c7d9f32419b564a8af

Authored by Prasad
2 parents dc1a3464 ada7ef95

Merge branch 'master' of http://code.vtiger.com/vtiger/vtigercrm

soap/customerportal.php
... ... @@ -1016,7 +1016,7 @@ function authenticate_user($username,$password,$version,$login = 'true')
1016 1016 $customerid = null;
1017 1017 for ($i = 0; $i < $num_rows; ++$i) {
1018 1018 $customerid = $adb->query_result($result, $i,'id');
1019   - if (Vtiger_Function::compareEncryptedPassword($password, $adb->query_result($result, $i, 'id'), $adb->query_result($result, $i, 'cryptmode'))) {
  1019 + if (Vtiger_Functions::compareEncryptedPassword($password, $adb->query_result($result, $i, 'user_password'), $adb->query_result($result, $i, 'cryptmode'))) {
1020 1020 break;
1021 1021 } else {
1022 1022 $customerid = null;
... ... @@ -1026,11 +1026,11 @@ function authenticate_user($username,$password,$version,$login = &#39;true&#39;)
1026 1026 if (!$customerid) return $err[1];//No user again.
1027 1027  
1028 1028 $list[0]['id'] = $customerid;
1029   - $list[0]['user_name'] = $adb->query_result($result,0,'user_name');
1030   - $list[0]['user_password'] = $adb->query_result($result,0,'user_password');
1031   - $list[0]['last_login_time'] = $adb->query_result($result,0,'last_login_time');
1032   - $list[0]['support_start_date'] = $adb->query_result($result,0,'support_start_date');
1033   - $list[0]['support_end_date'] = $adb->query_result($result,0,'support_end_date');
  1029 + $list[0]['user_name'] = $adb->query_result($result,$i,'user_name');
  1030 + $list[0]['user_password'] = $password;
  1031 + $list[0]['last_login_time'] = $adb->query_result($result,$i,'last_login_time');
  1032 + $list[0]['support_start_date'] = $adb->query_result($result,$i,'support_start_date');
  1033 + $list[0]['support_end_date'] = $adb->query_result($result,$i,'support_end_date');
1034 1034  
1035 1035 //During login process we will pass the value true. Other times (change password) we will pass false
1036 1036 if($login != 'false')
... ...
vtlib/Vtiger/Functions.php
... ... @@ -1023,8 +1023,8 @@ class Vtiger_Functions {
1023 1023 $reEncryptedPassword = null;
1024 1024 switch ($mode) {
1025 1025 case 'CRYPT': $reEncryptedPassword = crypt($plainText, $encryptedPassword); break;
1026   - case 'MD5' : $reEncryptedPassword = md5($plainText);
1027   - default : $reEncryptedPassword = $plainText;
  1026 + case 'MD5' : $reEncryptedPassword = md5($plainText); break;
  1027 + default : $reEncryptedPassword = $plainText; break;
1028 1028 }
1029 1029 return ($reEncryptedPassword == $encryptedPassword);
1030 1030 }
... ...