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

[3/8] incubator-guacamole-client git commit: GUACAMOLE-78: Do not display user menu for anonymous users.

GUACAMOLE-78: Do not display user menu for anonymous users.

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

Branch: refs/heads/master
Commit: c6323503d86520d0d261baea5a9cbe516f1c8dc9
Parents: df3f54a
Author: Michael Jumper <mj...@apache.org>
Authored: Fri Aug 12 13:55:59 2016 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Fri Aug 12 13:55:59 2016 -0700

----------------------------------------------------------------------
 .../webapp/app/navigation/directives/guacUserMenu.js   | 13 ++++++++++++-
 .../webapp/app/navigation/templates/guacUserMenu.html  |  2 +-
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/c6323503/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js b/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js
index 249f217..f94d006 100644
--- a/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js
+++ b/guacamole/src/main/webapp/app/navigation/directives/guacUserMenu.js
@@ -68,7 +68,18 @@ angular.module('navigation').directive('guacUserMenu', [function guacUserMenu()
             .then(function retrievedMainPages(pages) {
                 $scope.pages = pages;
             });
-            
+
+            /**
+             * Returns whether the current user has authenticated anonymously.
+             *
+             * @returns {Boolean}
+             *     true if the current user has authenticated anonymously, false
+             *     otherwise.
+             */
+            $scope.isAnonymous = function isAnonymous() {
+                return authenticationService.isAnonymous();
+            };
+
             /**
              * Logs out the current user, redirecting them to back to the root
              * after logout completes.

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/c6323503/guacamole/src/main/webapp/app/navigation/templates/guacUserMenu.html
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/navigation/templates/guacUserMenu.html b/guacamole/src/main/webapp/app/navigation/templates/guacUserMenu.html
index 351da0f..4ffd937 100644
--- a/guacamole/src/main/webapp/app/navigation/templates/guacUserMenu.html
+++ b/guacamole/src/main/webapp/app/navigation/templates/guacUserMenu.html
@@ -1,4 +1,4 @@
-<div class="user-menu">
+<div class="user-menu" ng-show="!isAnonymous()">
     <guac-menu menu-title="username">
            
         <!-- Local actions -->