mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUAC-586: Only provide password change interface for the data source that authenticated the current user.
This commit is contained in:
@@ -66,6 +66,14 @@ angular.module('settings').directive('guacSettingsPreferences', [function guacSe
|
||||
*/
|
||||
var username = authenticationService.getCurrentUsername();
|
||||
|
||||
/**
|
||||
* The identifier of the data source which authenticated the
|
||||
* current user.
|
||||
*
|
||||
* @type String
|
||||
*/
|
||||
var dataSource = authenticationService.getDataSource();
|
||||
|
||||
/**
|
||||
* All currently-set preferences, or their defaults if not yet set.
|
||||
*
|
||||
@@ -140,7 +148,7 @@ angular.module('settings').directive('guacSettingsPreferences', [function guacSe
|
||||
}
|
||||
|
||||
// Save the user with the new password
|
||||
userService.updateUserPassword(username, $scope.oldPassword, $scope.newPassword)
|
||||
userService.updateUserPassword(dataSource, username, $scope.oldPassword, $scope.newPassword)
|
||||
.success(function passwordUpdated() {
|
||||
|
||||
// Clear the password fields
|
||||
@@ -174,7 +182,7 @@ angular.module('settings').directive('guacSettingsPreferences', [function guacSe
|
||||
});
|
||||
|
||||
// Retrieve current permissions
|
||||
permissionService.getPermissions(username)
|
||||
permissionService.getPermissions(dataSource, username)
|
||||
.success(function permissionsRetrieved(permissions) {
|
||||
|
||||
// Add action for changing password if permission is granted
|
||||
|
Reference in New Issue
Block a user