From 57df77c11b3d316bf6d49ecfe52d00bf2585af01 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Wed, 14 Dec 2011 04:02:19 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BF=AE=E6=94=B9=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E6=97=B6=E7=9A=84=E9=95=BF=E5=BA=A6=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/AccountController.php | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/application/default/controllers/AccountController.php b/application/default/controllers/AccountController.php index c7122a1d..aba52446 100755 --- a/application/default/controllers/AccountController.php +++ b/application/default/controllers/AccountController.php @@ -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();