From 061815355ae2f1cc62a9a2d9b6ae2dd015ca7820 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 20 May 2015 13:45:54 +0800 Subject: [PATCH] * adjust for check password. --- module/my/view/changepassword.html.php | 6 +++--- module/my/view/editprofile.html.php | 6 +++--- module/user/js/common.js | 4 ++-- module/user/lang/en.php | 6 +++--- module/user/lang/zh-cn.php | 6 +++--- module/user/model.php | 3 ++- module/user/view/create.html.php | 2 +- module/user/view/edit.html.php | 2 +- www/js/my.full.js | 2 +- 9 files changed, 19 insertions(+), 18 deletions(-) diff --git a/module/my/view/changepassword.html.php b/module/my/view/changepassword.html.php index 0156429da2..0c6e8cfbe8 100755 --- a/module/my/view/changepassword.html.php +++ b/module/my/view/changepassword.html.php @@ -29,7 +29,7 @@ user->password;?> - + @@ -48,9 +48,9 @@ user->passwordStrengthList)?> diff --git a/module/my/view/editprofile.html.php b/module/my/view/editprofile.html.php index c00eb40c3d..7de4cb2d6b 100644 --- a/module/my/view/editprofile.html.php +++ b/module/my/view/editprofile.html.php @@ -55,7 +55,7 @@ user->password;?> - + @@ -112,9 +112,9 @@ user->passwordStrengthList)?> diff --git a/module/user/js/common.js b/module/user/js/common.js index 48c93a7ae3..5ac1231442 100644 --- a/module/user/js/common.js +++ b/module/user/js/common.js @@ -40,7 +40,7 @@ function changeEmail(num) account[num] = $('.account_' + num).val(); } -function checkPwd(password) +function checkPassword(password) { - $('#passwordStrength').html(passwordStrengthList[computePasswordStrength(password)]); + $('#passwordStrength').html(password == '' ? '' : passwordStrengthList[computePasswordStrength(password)]); } diff --git a/module/user/lang/en.php b/module/user/lang/en.php index 1ac5744c60..6eb8413d86 100644 --- a/module/user/lang/en.php +++ b/module/user/lang/en.php @@ -122,9 +122,9 @@ $lang->user->roleList['others'] = 'Others'; $lang->user->genderList['m'] = 'Male'; $lang->user->genderList['f'] = 'Female'; -$lang->user->passwordStrengthList[0] = 'Weak'; -$lang->user->passwordStrengthList[1] = 'Good'; -$lang->user->passwordStrengthList[2] = 'Strong'; +$lang->user->passwordStrengthList[0] = "Weak"; +$lang->user->passwordStrengthList[1] = "Good"; +$lang->user->passwordStrengthList[2] = "Strong"; $lang->user->statusList['active'] = 'Activate'; $lang->user->statusList['delete'] = 'Deleted'; diff --git a/module/user/lang/zh-cn.php b/module/user/lang/zh-cn.php index f313529bdb..3fe02ce2ca 100644 --- a/module/user/lang/zh-cn.php +++ b/module/user/lang/zh-cn.php @@ -122,9 +122,9 @@ $lang->user->roleList['others'] = '其他'; $lang->user->genderList['m'] = '男'; $lang->user->genderList['f'] = '女'; -$lang->user->passwordStrengthList[0] = '弱'; -$lang->user->passwordStrengthList[1] = '中'; -$lang->user->passwordStrengthList[2] = '强'; +$lang->user->passwordStrengthList[0] = "弱"; +$lang->user->passwordStrengthList[1] = "中"; +$lang->user->passwordStrengthList[2] = "强"; $lang->user->statusList['active'] = '正常'; $lang->user->statusList['delete'] = '删除'; diff --git a/module/user/model.php b/module/user/model.php index cfa5481596..cf06cd1323 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -509,6 +509,7 @@ class userModel extends model $hash = sha1($record->account . $record->password . $record->last); $user = $password == $hash ? $record : ''; } + if(!$user and md5($password) == $record->password) $user = $record; } if($user) @@ -970,7 +971,7 @@ class userModel extends model } $strength += strlen($uniqueChars) * 2; - $strength = $strength > 99 ? 99 : $strength; + $strength = $strength > 89 ? 89 : $strength; $strength = floor($strength / 10); $strength = floor($strength / 3); diff --git a/module/user/view/create.html.php b/module/user/view/create.html.php index 12934b3d87..3fa06e4e43 100644 --- a/module/user/view/create.html.php +++ b/module/user/view/create.html.php @@ -39,7 +39,7 @@ user->password;?> - + diff --git a/module/user/view/edit.html.php b/module/user/view/edit.html.php index 6a40c80113..8be69f698f 100644 --- a/module/user/view/edit.html.php +++ b/module/user/view/edit.html.php @@ -56,7 +56,7 @@ user->password;?> - + diff --git a/www/js/my.full.js b/www/js/my.full.js index 473d8c1c6f..5da26a20eb 100644 --- a/www/js/my.full.js +++ b/www/js/my.full.js @@ -1310,7 +1310,7 @@ function computePasswordStrength(password) strength += uniqueChars.length * 2; - strength = strength > 99 ? 99 : strength; + strength = strength > 89 ? 89 : strength; strength = Math.floor(strength / 10); strength = Math.floor(strength / 3);