diff --git a/module/my/control.php b/module/my/control.php index fa751be570..3c9240313d 100755 --- a/module/my/control.php +++ b/module/my/control.php @@ -1212,9 +1212,8 @@ EOF; $_POST['account'] = $this->app->user->account; $_POST['groups'] = $this->dao->select('`group`')->from(TABLE_USERGROUP)->where('account')->eq($this->post->account)->fetchPairs('group', 'group'); $this->user->update($this->app->user->id); - if(dao::isError()) helper::end(js::error(dao::getError())); - echo js::locate($this->createLink('my', 'profile'), 'parent'); - return; + if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('my', 'profile'), 'closeModal' => true)); } $this->app->loadConfig('user'); diff --git a/module/my/js/changepassword.js b/module/my/js/changepassword.js index d3d6b0014a..25f455269e 100644 --- a/module/my/js/changepassword.js +++ b/module/my/js/changepassword.js @@ -8,13 +8,17 @@ $(document).ready(function() $('#password1').change(function(){password1Encrypted = false}); $('#password2').change(function(){password2Encrypted = false}); + var passwordStrength = 0; $('#submit').click(function() { - var password = $('input#originalPassword').val().trim(); - var password1 = $('input#password1').val().trim(); - var passwordStrength = computePasswordStrength(password1); - var rand = $('input#verifyRand').val(); - if(!password1Encrypted) $("#passwordLength").val(password1.length); + var password = $('input#originalPassword').val().trim(); + var password1 = $('input#password1').val().trim(); + var rand = $('input#verifyRand').val(); + if(!password1Encrypted) + { + passwordStrength = computePasswordStrength(password1); + $("#passwordLength").val(password1.length); + } if($("form input[name=passwordStrength]").length == 0) $('#submit').after(""); $("form input[name=passwordStrength]").val(passwordStrength); diff --git a/module/my/js/editprofile.js b/module/my/js/editprofile.js index aa60cedfa6..3d91b9161c 100644 --- a/module/my/js/editprofile.js +++ b/module/my/js/editprofile.js @@ -8,12 +8,16 @@ $(document).ready(function() $('#password1').change(function(){password1Encrypted = false}); $('#password2').change(function(){password2Encrypted = false}); + var passwordStrength = 0; $('#submit').click(function() { - var password = $('input#verifyPassword').val(); - var password1 = $('input#password1').val(); - var passwordStrength = computePasswordStrength(password1); - if(!password1Encrypted) $("#passwordLength").val(password1.length); + var password = $('input#verifyPassword').val(); + var password1 = $('input#password1').val(); + if(!password1Encrypted) + { + passwordStrength = computePasswordStrength(password1); + $("#passwordLength").val(password1.length); + } if($("form input[name=passwordStrength]").length == 0) $('#submit').after(""); $("form input[name=passwordStrength]").val(passwordStrength); diff --git a/module/my/view/changepassword.html.php b/module/my/view/changepassword.html.php index 4fc172707a..3d14b5ae17 100755 --- a/module/my/view/changepassword.html.php +++ b/module/my/view/changepassword.html.php @@ -35,7 +35,7 @@