From 7b924bde83291ef91ef524b1126087f02e4f270c Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Fri, 22 Sep 2017 08:00:13 +0200 Subject: [PATCH] fix(userSettings): allow to change admin password when using LDAP auth (#1227) --- app/components/userSettings/userSettings.html | 4 ++-- app/components/userSettings/userSettingsController.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/components/userSettings/userSettings.html b/app/components/userSettings/userSettings.html index c7f5405f7..e9dc4b386 100644 --- a/app/components/userSettings/userSettings.html +++ b/app/components/userSettings/userSettings.html @@ -59,8 +59,8 @@
- - + + You cannot change your password when using LDAP authentication. diff --git a/app/components/userSettings/userSettingsController.js b/app/components/userSettings/userSettingsController.js index 2146d58e0..f746bce81 100644 --- a/app/components/userSettings/userSettingsController.js +++ b/app/components/userSettings/userSettingsController.js @@ -9,11 +9,10 @@ function ($scope, $state, $sanitize, Authentication, UserService, Notifications, $scope.updatePassword = function() { $scope.invalidPassword = false; - var userID = Authentication.getUserDetails().ID; var currentPassword = $sanitize($scope.formValues.currentPassword); var newPassword = $sanitize($scope.formValues.newPassword); - UserService.updateUserPassword(userID, currentPassword, newPassword) + UserService.updateUserPassword($scope.userID, currentPassword, newPassword) .then(function success() { Notifications.success('Success', 'Password successfully updated'); $state.reload(); @@ -28,6 +27,7 @@ function ($scope, $state, $sanitize, Authentication, UserService, Notifications, }; function initView() { + $scope.userID = Authentication.getUserDetails().ID; SettingsService.publicSettings() .then(function success(data) { $scope.AuthenticationMethod = data.AuthenticationMethod;