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 @@ user->newPassword;?> - user->placeholder->passwordStrength, $config->safe->mode, '') . "'");?> + user->placeholder->passwordStrength, $config->safe->mode, '') . "'");?> diff --git a/module/my/view/editprofile.html.php b/module/my/view/editprofile.html.php index 45d197587a..962686cbbc 100644 --- a/module/my/view/editprofile.html.php +++ b/module/my/view/editprofile.html.php @@ -17,7 +17,7 @@

my->editProfile;?>

-
+ @@ -46,7 +46,7 @@ diff --git a/module/user/js/create.js b/module/user/js/create.js index 32c6596e9a..111660bdba 100644 --- a/module/user/js/create.js +++ b/module/user/js/create.js @@ -90,14 +90,19 @@ $(function() var password2Encrypted = false $('#password1').change(function(){password1Encrypted = false}); $('#password2').change(function(){password2Encrypted = false}); + + var passwordStrength = 0; $('#submit').click(function() { if(!password1Encrypted || !password2Encrypted) { - var password1 = $('#password1').val(); - var password2 = $('#password2').val(); - var passwordStrength = computePasswordStrength(password1); - if(!password1Encrypted) $("#passwordLength").val(password1.length); + var password1 = $('#password1').val(); + var password2 = $('#password2').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/user/js/edit.js b/module/user/js/edit.js index 6b673efc4e..3b3501e708 100644 --- a/module/user/js/edit.js +++ b/module/user/js/edit.js @@ -4,14 +4,19 @@ $(function() var password2Encrypted = false $('#password1').change(function(){password1Encrypted = false}); $('#password2').change(function(){password2Encrypted = false}); + + var passwordStrength = 0; $('#submit').click(function() { if(!password1Encrypted || !password2Encrypted) { var password1 = $('#password1').val().trim(); var password2 = $('#password2').val().trim(); - var passwordStrength = computePasswordStrength(password1); - if(!password1Encrypted) $("#passwordLength").val(password1.length); + 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/user/js/reset.js b/module/user/js/reset.js index ccf8593186..7102b85dfc 100644 --- a/module/user/js/reset.js +++ b/module/user/js/reset.js @@ -4,13 +4,15 @@ $(document).ready(function() var password2Encrypted = false $('#password1').change(function(){password1Encrypted = false}); $('#password2').change(function(){password2Encrypted = false}); + + var passwordStrength = 0; $('form #submit').click(function() { if(!password1Encrypted || !password2Encrypted) { var password1 = $('#password1').val().trim(); var password2 = $('#password2').val().trim(); - var passwordStrength = computePasswordStrength(password1); + if(!password1Encrypted) passwordStrength = computePasswordStrength(password1); if($("form input[name=passwordStrength]").length == 0) $('#submit').after(""); $("form input[name=passwordStrength]").val(passwordStrength); diff --git a/module/user/js/resetpassword.js b/module/user/js/resetpassword.js index 9f328f6445..1171ac177a 100644 --- a/module/user/js/resetpassword.js +++ b/module/user/js/resetpassword.js @@ -14,14 +14,19 @@ $(function() var password2Encrypted = false $('#password1').change(function(){password1Encrypted = false}); $('#password2').change(function(){password2Encrypted = false}); + + var passwordStrength = 0; $('#submit').click(function() { if(!password1Encrypted || !password2Encrypted) { var password1 = $('#password1').val().trim(); var password2 = $('#password2').val().trim(); - var passwordStrength = computePasswordStrength(password1); - if(!password1Encrypted) $("#passwordLength").val(password1.length); + 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/user/view/create.html.php b/module/user/view/create.html.php index 44f22cf2c7..3dfb8c9930 100644 --- a/module/user/view/create.html.php +++ b/module/user/view/create.html.php @@ -54,7 +54,7 @@ $showVisionList = count($visionList) > 1; diff --git a/module/user/view/edit.html.php b/module/user/view/edit.html.php index 8306b1f4c1..091daed83d 100644 --- a/module/user/view/edit.html.php +++ b/module/user/view/edit.html.php @@ -71,7 +71,7 @@ diff --git a/module/user/view/resetpassword.html.php b/module/user/view/resetpassword.html.php index 7279f8dfb6..8b5e454fc4 100644 --- a/module/user/view/resetpassword.html.php +++ b/module/user/view/resetpassword.html.php @@ -29,7 +29,7 @@ include '../../common/view/header.lite.html.php';
- user->placeholder->loginPassword, $config->safe->mode, '') . "' onmouseup='checkPassword(this.value)' onkeyup='checkPassword(this.value)'");?> + user->placeholder->loginPassword, $config->safe->mode, '') . "' onkeyup='checkPassword(this.value)'");?>
my->form->lblBasic;?>
- safe->mode) ? $lang->user->placeholder->passwordStrength[$config->safe->mode] : '') . "'");?> + safe->mode) ? $lang->user->placeholder->passwordStrength[$config->safe->mode] : '') . "'");?> - + - user->placeholder->passwordStrength, $config->safe->mode, '') . "'");?> + user->placeholder->passwordStrength, $config->safe->mode, '') . "'");?>