增加修改密码时的长度判断
This commit is contained in:
parent
d2f61f3db7
commit
57df77c11b
|
@ -75,6 +75,7 @@ class AccountController extends Zend_Controller_Action
|
|||
$this->view->user = $rows;
|
||||
}
|
||||
}
|
||||
|
||||
function saveoptAction()
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
|
@ -166,15 +167,27 @@ class AccountController extends Zend_Controller_Action
|
|||
|
||||
$match = "/[\"|'|\\\]/i";
|
||||
|
||||
if(preg_match($match,$password) || preg_match($match,$password_new) || preg_match($match,$password_confirm) || $rows['password']!== md5($password))
|
||||
if(preg_match($match,$password) || preg_match($match,$password_new) || preg_match($match,$password_confirm) || $rows['password']!== md5($password) || strlen($password_new)>20)
|
||||
{
|
||||
echo "The password you entered is incorrect.Please re-enter your password";
|
||||
exit();
|
||||
}
|
||||
|
||||
if(strlen($password_new)>6)
|
||||
{
|
||||
echo "Your new password is too short";
|
||||
exit();
|
||||
}
|
||||
|
||||
if(strlen($password_new)>20)
|
||||
{
|
||||
echo "Your new password is too long";
|
||||
exit();
|
||||
}
|
||||
|
||||
if(md5($password_new) !== md5($password_confirm))
|
||||
{
|
||||
echo "";
|
||||
echo "Entered passwords differ from the another";
|
||||
exit();
|
||||
}
|
||||
|
||||
|
@ -195,14 +208,14 @@ class AccountController extends Zend_Controller_Action
|
|||
exit();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
exit();
|
||||
}
|
||||
}
|
||||
} //saveopt ajax修改用户信息
|
||||
|
||||
function loginAction()
|
||||
{
|
||||
$form = new LoginForm();
|
||||
|
|
Loading…
Reference in New Issue