You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by vn...@apache.org on 2018/05/04 08:27:06 UTC

[12/21] guacamole-client git commit: GUACAMOLE-220: Remove unnecessary userExists() function.

GUACAMOLE-220: Remove unnecessary userExists() function.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/244dd19a
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/244dd19a
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/244dd19a

Branch: refs/heads/master
Commit: 244dd19aa0b5b17f28443465d927b6f0d34b21db
Parents: 6ca076f
Author: Michael Jumper <mj...@apache.org>
Authored: Tue May 1 17:19:40 2018 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Tue May 1 20:58:28 2018 -0700

----------------------------------------------------------------------
 .../manage/controllers/manageUserController.js  | 27 +-------------------
 1 file changed, 1 insertion(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/244dd19a/guacamole/src/main/webapp/app/manage/controllers/manageUserController.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/manage/controllers/manageUserController.js b/guacamole/src/main/webapp/app/manage/controllers/manageUserController.js
index 27cb933..800ad00 100644
--- a/guacamole/src/main/webapp/app/manage/controllers/manageUserController.js
+++ b/guacamole/src/main/webapp/app/manage/controllers/manageUserController.js
@@ -171,31 +171,6 @@ angular.module('manage').controller('manageUserController', ['$scope', '$injecto
     };
 
     /**
-     * Returns whether the user being edited already exists within the data
-     * source specified.
-     *
-     * @param {String} [dataSource]
-     *     The identifier of the data source to check. If omitted, this will
-     *     default to the currently-selected data source.
-     *
-     * @returns {Boolean}
-     *     true if the user being edited already exists, false otherwise.
-     */
-    $scope.userExists = function userExists(dataSource) {
-
-        // Do not check if users are not yet loaded
-        if (!$scope.users)
-            return false;
-
-        // Use currently-selected data source if unspecified
-        dataSource = dataSource || $scope.dataSource;
-
-        // Account exists only if it was successfully retrieved
-        return (dataSource in $scope.users);
-
-    };
-
-    /**
      * Returns whether the current user can edit the username of the user being
      * edited within the given data source.
      *
@@ -415,7 +390,7 @@ angular.module('manage').controller('manageUserController', ['$scope', '$injecto
 
         // Save or create the user, depending on whether the user exists
         var saveUserPromise;
-        if ($scope.userExists($scope.dataSource))
+        if ($scope.dataSource in $scope.users)
             saveUserPromise = userService.saveUser($scope.dataSource, $scope.user);
         else
             saveUserPromise = userService.createUser($scope.dataSource, $scope.user);