aboutsummaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-09-18 07:53:11 -0700
committerBart Visscher <bartv@thisnet.nl>2013-09-18 07:53:11 -0700
commit817b8d151b2a3ad6f3e9758397a6f8d8033e39c3 (patch)
treedec3bfa51740ef9eb658a1e17e9b5ddd5ba2ccbe /settings/js
parent1eb42626f5fd9f2a39f22efc735820fb83b2778b (diff)
parent18a2c48ceb2206fbc871dc0c28e5fb233b4fc0fc (diff)
downloadnextcloud-server-817b8d151b2a3ad6f3e9758397a6f8d8033e39c3.tar.gz
nextcloud-server-817b8d151b2a3ad6f3e9758397a6f8d8033e39c3.zip
Merge pull request #4745 from owncloud/split_personal-user_passwordchange
Split personal and user-mgmt password change logic
Diffstat (limited to 'settings/js')
-rw-r--r--settings/js/personal.js11
-rw-r--r--settings/js/users.js2
2 files changed, 8 insertions, 5 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js
index fab32b83b64..eaaca32f5d8 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -124,14 +124,17 @@ $(document).ready(function(){
$('#passwordchanged').hide();
$('#passworderror').hide();
// Ajax foo
- $.post( 'ajax/changepassword.php', post, function(data){
+ $.post(OC.Router.generate('settings_personal_changepassword'), post, function(data){
if( data.status === "success" ){
$('#pass1').val('');
$('#pass2').val('');
$('#passwordchanged').show();
- }
- else{
- $('#passworderror').html( data.data.message );
+ } else{
+ if (typeof(data.data) !== "undefined") {
+ $('#passworderror').html(data.data.message);
+ } else {
+ $('#passworderror').html(t('Unable to change password'));
+ }
$('#passworderror').show();
}
});
diff --git a/settings/js/users.js b/settings/js/users.js
index 01a845367e2..48c4529527b 100644
--- a/settings/js/users.js
+++ b/settings/js/users.js
@@ -361,7 +361,7 @@ $(document).ready(function () {
if ($(this).val().length > 0) {
var recoveryPasswordVal = $('input:password[id="recoveryPassword"]').val();
$.post(
- OC.filePath('settings', 'ajax', 'changepassword.php'),
+ OC.Router.generate('settings_users_changepassword'),
{username: uid, password: $(this).val(), recoveryPassword: recoveryPasswordVal},
function (result) {
if (result.status != 'success') {