mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 17:13:21 +00:00 
			
		
		
		
	#268: Only assign password if given.
This commit is contained in:
		| @@ -239,6 +239,11 @@ | |||||||
|                                     if (password != reentered_password) |                                     if (password != reentered_password) | ||||||
|                                         throw new Error("Passwords do not match."); |                                         throw new Error("Passwords do not match."); | ||||||
|  |  | ||||||
|  |                                     // Do not update password if it's just the | ||||||
|  |                                     // not-changed token | ||||||
|  |                                     if (password == "f12a1930-7195-11e2-bcfd-0800200c9a66") | ||||||
|  |                                         password = null; | ||||||
|  |  | ||||||
|                                     // Set user permissions |                                     // Set user permissions | ||||||
|                                     user_perms.read_connection = {}; |                                     user_perms.read_connection = {}; | ||||||
|                                     var connections = fields[2]; |                                     var connections = fields[2]; | ||||||
|   | |||||||
| @@ -293,7 +293,7 @@ GuacamoleService.Users = { | |||||||
|      * Updates the user having the given username. |      * Updates the user having the given username. | ||||||
|      *  |      *  | ||||||
|      * @param {String} username The username of the user to create. |      * @param {String} username The username of the user to create. | ||||||
|      * @param {String} password The password to assign to the user. |      * @param {String} password The password to assign to the user (optional). | ||||||
|      * @param {GuacamoleService.PermissionSet} permissions The permissions to |      * @param {GuacamoleService.PermissionSet} permissions The permissions to | ||||||
|      *                                                     assign. |      *                                                     assign. | ||||||
|      * @param {String} parameters Any parameters which should be passed to the |      * @param {String} parameters Any parameters which should be passed to the | ||||||
| @@ -303,11 +303,12 @@ GuacamoleService.Users = { | |||||||
|     "update" : function(username, password, permissions, parameters) { |     "update" : function(username, password, permissions, parameters) { | ||||||
|  |  | ||||||
|         // Construct request URL |         // Construct request URL | ||||||
|         var users_url = "users/update?name=" + encodeURIComponent(username); |         var users_url = "users/update"; | ||||||
|         if (parameters) users_url += "&" + parameters; |         if (parameters) users_url += "?" + parameters; | ||||||
|  |  | ||||||
|         // Init POST data |         // Init POST data | ||||||
|         var data = "password=" + encodeURIComponent(password); |         var data = "name=" + encodeURIComponent(username); | ||||||
|  |         if (password) data += "&password=" + encodeURIComponent(password); | ||||||
|  |  | ||||||
|         // Creation permissions |         // Creation permissions | ||||||
|         if (permissions.create_user)       data += "&user=create"; |         if (permissions.create_user)       data += "&user=create"; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user