syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject syncope git commit: SYNCOPE-798 now cancel does logout plus refactoring authorization
Date Mon, 02 May 2016 15:33:49 GMT
Repository: syncope
Updated Branches:
  refs/heads/master a637694af -> edb0cb33d


SYNCOPE-798 now cancel does logout plus refactoring authorization


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/edb0cb33
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/edb0cb33
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/edb0cb33

Branch: refs/heads/master
Commit: edb0cb33d4ca6ac6b993dfc2f8ee536752f17e02
Parents: a637694
Author: Matteo Di Carlo <matteo.dicarlo@bhuman.it>
Authored: Tue Apr 26 12:17:55 2016 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Mon May 2 17:33:21 2016 +0200

----------------------------------------------------------------------
 .../enduser/SyncopeEnduserApplication.java      |  11 ++
 .../enduser/resources/AbstractBaseResource.java |   2 +-
 .../enduser/resources/UserSelfIsLogged.java     |  66 ++++++++++
 .../resources/META-INF/resources/app/js/app.js  | 125 +++++++++++--------
 .../app/js/controllers/HomeController.js        |  16 ---
 .../app/js/controllers/LoginController.js       |  13 +-
 .../resources/app/js/services/authService.js    |  36 ++----
 .../META-INF/resources/app/views/self.html      |   6 +-
 .../resources/app/views/user-credentials.html   |   2 +-
 .../app/views/user-derived-schemas.html         |   2 +-
 .../resources/app/views/user-form-finish.html   |   2 +-
 .../resources/app/views/user-groups.html        |   2 +-
 .../resources/app/views/user-plain-schemas.html |   2 +-
 .../resources/app/views/user-resources.html     |   2 +-
 .../app/views/user-virtual-schemas.html         |   2 +-
 15 files changed, 180 insertions(+), 109 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/edb0cb33/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
index 9a3e32e..75f758d 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.client.enduser;
 
+import org.apache.syncope.client.enduser.resources.UserSelfIsLogged;
 import java.io.File;
 import java.io.Serializable;
 import org.apache.syncope.client.enduser.pages.HomePage;
@@ -155,6 +156,16 @@ public class SyncopeEnduserApplication extends WebApplication implements
Seriali
             }
         });
 
+        mountResource("/api/self/islogged", new ResourceReference("userSelfIsLogged") {
+
+            private static final long serialVersionUID = -128426276529456602L;
+
+            @Override
+            public IResource getResource() {
+                return new UserSelfIsLogged();
+            }
+        });
+
         // resource to retrieve info about logged user
         mountResource("/api/self/read", new ResourceReference("userSelfRead") {
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/edb0cb33/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
index a364841..6f38d0d 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/AbstractBaseResource.java
@@ -33,7 +33,7 @@ public abstract class AbstractBaseResource extends AbstractResource {
 
     private static final long serialVersionUID = -7875801358718612782L;
 
-    private static final Logger LOG = LoggerFactory.getLogger(AbstractBaseResource.class);
+    protected static final Logger LOG = LoggerFactory.getLogger(AbstractBaseResource.class);
 
     protected static final ObjectMapper MAPPER = new ObjectMapper();
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/edb0cb33/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfIsLogged.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfIsLogged.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfIsLogged.java
new file mode 100644
index 0000000..d1f0c7a
--- /dev/null
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfIsLogged.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.enduser.resources;
+
+import java.io.IOException;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.client.enduser.SyncopeEnduserSession;
+import org.apache.wicket.request.resource.IResource;
+
+public class UserSelfIsLogged extends AbstractBaseResource {
+
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    protected ResourceResponse newResourceResponse(final Attributes attributes) {
+
+        ResourceResponse response = new ResourceResponse();
+
+        LOG.debug("Checking if user is authenticated");
+
+        try {
+            HttpServletRequest request = (HttpServletRequest) attributes.getRequest().getContainerRequest();
+            if (!xsrfCheck(request)) {
+                LOG.error("XSRF TOKEN does not match");
+                response.setError(Response.Status.BAD_REQUEST.getStatusCode(), "XSRF TOKEN
does not match");
+                return response;
+            }
+
+            response.setWriteCallback(new WriteCallback() {
+
+                @Override
+                public void writeData(final IResource.Attributes attributes) throws IOException
{
+                    attributes.getResponse().write(
+                            Boolean.toString(SyncopeEnduserSession.get().isAuthenticated()));
+                }
+            });
+            response.setStatusCode(Response.Status.OK.getStatusCode());
+
+        } catch (Exception e) {
+            LOG.error("Could not read credentials from request", e);
+            response.setError(Response.Status.BAD_REQUEST.getStatusCode(), new StringBuilder()
+                    .append("ErrorMessage{{ ")
+                    .append(e.getMessage())
+                    .append(" }}")
+                    .toString());
+        }
+        return response;
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/edb0cb33/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/app.js b/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
index 8217dc8..17e0816 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
+++ b/client/enduser/src/main/resources/META-INF/resources/app/js/app.js
@@ -61,9 +61,10 @@ app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider',
               templateUrl: 'views/home.html',
               controller: 'HomeController',
               resolve: {
-                'authenticated': function (AuthenticationHelper) {
-                  return AuthenticationHelper.authenticated();
-                }
+                'authenticated': ['AuthService',
+                  function (AuthService) {
+                    return AuthService.islogged()
+                  }]
               }
             })
             .state('create', {
@@ -105,9 +106,10 @@ app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider',
               url: '/self/update',
               templateUrl: 'views/editUser.html',
               resolve: {
-                'authenticated': function (AuthenticationHelper) {
-                  return AuthenticationHelper.authenticated();
-                }
+                'authenticated': ['AuthService',
+                  function (AuthService) {
+                    return AuthService.islogged();
+                  }]
               }
             })
             // nested states 
@@ -117,63 +119,70 @@ app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider',
               url: '/credentials',
               templateUrl: 'views/user-credentials.html',
               resolve: {
-                'authenticated': function (AuthenticationHelper) {
-                  return AuthenticationHelper.authenticated();
-                }
+                'authenticated': ['AuthService',
+                  function (AuthService) {
+                    return AuthService.islogged();
+                  }]
               }
             })
             .state('update.plainSchemas', {
               url: '/plainSchemas',
               templateUrl: 'views/user-plain-schemas.html',
               resolve: {
-                'authenticated': function (AuthenticationHelper) {
-                  return AuthenticationHelper.authenticated();
-                }
+                'authenticated': ['AuthService',
+                  function (AuthService) {
+                    return AuthService.islogged();
+                  }]
               }
             })
             .state('update.derivedSchemas', {
               url: '/derivedSchemas',
               templateUrl: 'views/user-derived-schemas.html',
               resolve: {
-                'authenticated': function (AuthenticationHelper) {
-                  return AuthenticationHelper.authenticated();
-                }
+                'authenticated': ['AuthService',
+                  function (AuthService) {
+                    return AuthService.islogged();
+                  }]
               }
             })
             .state('update.virtualSchemas', {
               url: '/virtualSchemas',
               templateUrl: 'views/user-virtual-schemas.html',
               resolve: {
-                'authenticated': function (AuthenticationHelper) {
-                  return AuthenticationHelper.authenticated();
-                }
+                'authenticated': ['AuthService',
+                  function (AuthService) {
+                    return AuthService.islogged();
+                  }]
               }
             })
             .state('update.groups', {
               url: '/groups',
               templateUrl: 'views/user-groups.html',
               resolve: {
-                'authenticated': function (AuthenticationHelper) {
-                  return AuthenticationHelper.authenticated();
-                }
+                'authenticated': ['AuthService',
+                  function (AuthService) {
+                    return AuthService.islogged();
+                  }]
               }
             })
             .state('update.resources', {
               url: '/resources',
               templateUrl: 'views/user-resources.html',
               resolve: {
-                'authenticated': function (AuthenticationHelper) {
-                  return AuthenticationHelper.authenticated();
-                }
+                'authenticated': ['AuthService',
+                  function (AuthService) {
+                    return AuthService.islogged();
+                  }]
               }
             })
             .state('update.finish', {
               url: '/finish',
               templateUrl: 'views/user-form-finish.html',
               resolve: {
-                'authenticated': function (AuthenticationHelper) {
-                  return AuthenticationHelper.authenticated();
-                }
+                'authenticated': ['AuthService',
+                  function (AuthService) {
+                    return AuthService.islogged();
+                  }]
               }
             })
             .state('passwordreset', {
@@ -197,7 +206,7 @@ app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider',
     $httpProvider.defaults.withCredentials = true;
     $httpProvider.defaults.xsrfCookieName = 'XSRF-TOKEN';
     $httpProvider.defaults.xsrfHeaderName = 'X-XSRF-TOKEN';
-    
+
     //SYNCOPE-780
     $httpProvider.defaults.headers.common["If-Modified-Since"] = "0";
 
@@ -238,12 +247,10 @@ app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider',
 
   }]);
 
-app.run(['$rootScope', '$location', '$cookies', '$state',
-  function ($rootScope, $location, $cookies, $state) {
+app.run(['$rootScope', '$location', '$cookies', '$state', 'AuthService',
+  function ($rootScope, $location, $cookies, $state, AuthService) {
     // main program
     // keep user logged in after page refresh
-    // check if user is logged or not
-    $rootScope.currentUser = $cookies.get('currentUser') || null;
     //If the route change failed due to authentication error, redirect them out
     $rootScope.$on('$routeChangeError', function (event, current, previous, rejection) {
       if (rejection === 'Not Authenticated') {
@@ -254,10 +261,38 @@ app.run(['$rootScope', '$location', '$cookies', '$state',
     $rootScope.$on('$stateChangeSuccess', function (event, toState) {
       if (toState.name === 'create') {
         $state.go('create.credentials');
+
       } else if (toState.name === 'update') {
         $state.go('update.credentials');
-      }
-      else {
+
+      } else if (toState.name.indexOf("update") > -1) {
+        AuthService.islogged().then(function (response) {
+          if (response === "true") {
+            $state.go(toState);
+          } else {
+            $state.go('self');
+          }
+        }, function (response) {
+          console.log("not logged");
+          $state.go('self');
+        }
+        );
+
+      } else if (toState.name === 'home' || toState.name === 'self') {
+        AuthService.islogged().then(function (response) {
+          console.log("User logged (change): ", response)
+          console.log("User logged (change): ", AuthService.islogged())
+          if (response === "true") {
+            $state.go('update.credentials');
+          } else {
+            $state.go('self');
+          }
+        }, function (response) {
+          console.log("not logged");
+          $state.go('self');
+        }
+        );
+      } else {
         $state.go(toState);
       }
     });
@@ -361,8 +396,7 @@ app.controller('ApplicationController', ['$scope', '$rootScope', 'InfoService',
                 }
               });
             }, timer);
-          }
-          else {
+          } else {
             pendingNotifications.each(function (idx, element) {
               var popup = $(element).data("kendoPopup");
               if (popup) {
@@ -387,7 +421,6 @@ app.controller('ApplicationController', ['$scope', '$rootScope', 'InfoService',
       $scope.$on('hideErrorMessage', function (event, popupMessage) {
         $scope.hideError(popupMessage, $scope.notification);
       });
-
       //wizard active element
       $scope.wizard = {
         "credentials": {url: "/credentials", templateUrl: "views/user-credentials.html"},
@@ -398,23 +431,5 @@ app.controller('ApplicationController', ['$scope', '$rootScope', 'InfoService',
         "resources": {url: "/resources", templateUrl: "views/user-resources.html"},
         "finish": {url: "/finish", templateUrl: "views/user-form-finish.html"}
       };
-
-
     }
   }]);
-app.factory('AuthenticationHelper', ['$q', '$rootScope',
-  function ($q, $rootScope) {
-    return {
-      authenticated: function () {
-
-        var currentUser = $rootScope.currentUser;
-        console.log("AuthenticationHelper, currentUser: ", currentUser);
-        if (angular.isDefined(currentUser) && currentUser) {
-          return true;
-        } else {
-          console.log("NOT AUTHENTICATED, REDIRECT TO LOGIN PAGE");
-          return $q.reject('Not Authenticated');
-        }
-      }
-    };
-  }]);

http://git-wip-us.apache.org/repos/asf/syncope/blob/edb0cb33/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/HomeController.js
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/HomeController.js
b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/HomeController.js
index bf86413..0470587 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/HomeController.js
+++ b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/HomeController.js
@@ -20,20 +20,4 @@
 'use strict';
 
 angular.module("home").controller("HomeController", ['$scope', '$http', '$location', function
($scope, $http, $location) {
-    $scope.title = 'Hello world!';
-    $scope.subtitle = 'Hello world SUBTITLE!';
-    $scope.name = "";
-
-// check if user is logged or not, check session variables: if user isn't logged redirect
to login page
-
-      console.log("SONO IN HomeController");
-      
-//      var isLogged = false;
-//      if (!isLogged) {
-//        console.log("REDIRECT TO LOGIN PAGE");
-////        window.location = "./self.html";
-//        $location.path("/self");
-//      }
-
-    
   }]);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/syncope/blob/edb0cb33/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/LoginController.js
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/LoginController.js
b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/LoginController.js
index c1c563c..a166784 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/LoginController.js
+++ b/client/enduser/src/main/resources/META-INF/resources/app/js/controllers/LoginController.js
@@ -45,7 +45,7 @@ angular.module("login").controller("LoginController", ['$scope', '$rootScope',
'
           errorMessage = errorMessage.split("}}")[0];
         }
         $scope.credentials.errorMessage = "Login failed: " + errorMessage;
-        $scope.showError($scope.credentials.errorMessage, $scope.notification);        
+        $scope.showError($scope.credentials.errorMessage, $scope.notification);
       });
     };
 
@@ -57,8 +57,13 @@ angular.module("login").controller("LoginController", ['$scope', '$rootScope',
'
       });
     };
 
-    $scope.isLogged = function () {
-      return angular.isDefined($rootScope.currentUser) && $rootScope.currentUser;
+    $scope.islogged = function () {
+      AuthService.islogged().then(function (response) {
+        console.log("user login status detected", response);
+        return response.data === true;
+      }, function (response) {
+        console.log("error retrieving user login status", response);
+      });
     };
 
     $scope.selfCreate = function () {
@@ -66,7 +71,7 @@ angular.module("login").controller("LoginController", ['$scope', '$rootScope',
'
     };
 
     $scope.passwordReset = function () {
-       $location.path("/passwordreset");
+      $location.path("/passwordreset");
     };
 
     $scope.errorAPI = function () {

http://git-wip-us.apache.org/repos/asf/syncope/blob/edb0cb33/client/enduser/src/main/resources/META-INF/resources/app/js/services/authService.js
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/js/services/authService.js
b/client/enduser/src/main/resources/META-INF/resources/app/js/services/authService.js
index 3c3f7af..56a5e36 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/js/services/authService.js
+++ b/client/enduser/src/main/resources/META-INF/resources/app/js/services/authService.js
@@ -25,21 +25,12 @@ angular.module('login')
 
             var authService = {};
 
-            var clearUserCookie = function () {
-              $rootScope.currentUser = null;
-              $cookies.remove('currentUser');
-            };
-
             authService.login = function (credentials) {
               return $http
                       .post('/syncope-enduser/api/login', credentials)
                       .then(function (response) {
-                        var username = response.data;
-                        $cookies.put('currentUser', username);
-                        $rootScope.currentUser = username;
-                        return username;
+                        return response.data;
                       }, function (response) {
-                        clearUserCookie();
                         console.log("Something went wrong during login, exit with status:
", response);
                         return $q.reject(response.data || response.statusText);
                       });
@@ -49,26 +40,25 @@ angular.module('login')
               return $http
                       .get('/syncope-enduser/api/logout')
                       .then(function (response) {
-                        clearUserCookie();
                         return response;
                       }, function (response) {
-                        clearUserCookie();
                         console.log("Something went wrong during logout, exit with status:
", response);
                       });
             };
 
-            return authService;
-//            return {
-//              login: $resource('/syncope-enduser/api/login', {}, {
-//                do: {method: 'POST', params: {}, isArray: false}
-//              })
-//            };
-//            return {
-//              logout: $resource('/cradleDashboard/api/logout', {}, {
-//                query: {method: 'GET', params: {}, isArray: false}
-//              })
-//            };
 
+            authService.islogged = function () {
+              return $http
+                      .get('/syncope-enduser/api/self/islogged')
+                      .then(function (response) {
+                        console.log("user logged: (authServ)" + response.data);
+                        return response.data;
+                      }, function (response) {
+                        console.log("error retrieving user login status");
+                      });
+            };
+
+            return authService;
           }]);
 
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/edb0cb33/client/enduser/src/main/resources/META-INF/resources/app/views/self.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/self.html b/client/enduser/src/main/resources/META-INF/resources/app/views/self.html
index 43a539d..482fedd 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/self.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/self.html
@@ -52,7 +52,7 @@ under the License.
             <div id="login-form" class="form">              
             </div>
 
-            <form id="login-form" class="form form-signin" novalidate ng-show="!isLogged()"
>
+            <form id="login-form" class="form form-signin" novalidate>
 
               <fieldset class="form-group input-group">
 
@@ -77,14 +77,14 @@ under the License.
           </div>
 
         </div>
-        <div class="text-center" ng-show="!isLogged() && $root.isSelfRegAllowed()">
+        <div class="text-center" ng-show="$root.isSelfRegAllowed()">
           <a href="javascript:void(0);" class="btn btn-link" ng-click="selfCreate()">Self
Registration</a>
 
           <!--      <div id="initialLoaderDiv">
                   <img src="img/busy.gif" class="ajax-loader"/>
                 </div>-->
         </div>
-        <div class="text-center" ng-show="!isLogged() && $root.isPwdResetAllowed()">
+        <div class="text-center" ng-show="$root.isPwdResetAllowed()">
           <a href="javascript:void(0);" class="btn btn-link" ng-click="passwordReset()">Password
Reset</a>
         </div>
         <!-- /#login-container -->

http://git-wip-us.apache.org/repos/asf/syncope/blob/edb0cb33/client/enduser/src/main/resources/META-INF/resources/app/views/user-credentials.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/user-credentials.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/user-credentials.html
index faee268..a09ab98 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/user-credentials.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/user-credentials.html
@@ -65,6 +65,6 @@ under the License.
   <navigation-buttons ng-show="createMode" base="create" current="credentials" wizard="{{wizard}}"></navigation-buttons>
   <navigation-buttons ng-show="!createMode" base= "update" current="credentials" wizard="{{wizard}}"></navigation-buttons>
   <div class="pull-left">
-    <a id="cancel" href="#/self" class="btn btn-danger pull-left">Cancel</a>
+    <a id="cancel" href="#/self" class="btn btn-danger pull-left" ng-click="logout()">Cancel</a>
   </div>
 </div>

http://git-wip-us.apache.org/repos/asf/syncope/blob/edb0cb33/client/enduser/src/main/resources/META-INF/resources/app/views/user-derived-schemas.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/user-derived-schemas.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/user-derived-schemas.html
index 23fbc12..b764352 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/user-derived-schemas.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/user-derived-schemas.html
@@ -24,6 +24,6 @@ under the License.
   <navigation-buttons ng-show="createMode" base="create" current="derivedSchemas" wizard="{{wizard}}"></navigation-buttons>
   <navigation-buttons ng-show="!createMode" base="update" current="derivedSchemas" wizard="{{wizard}}"></navigation-buttons>
   <div class="pull-left">
-    <a id="cancel" href="#/self" class="btn btn-danger">Cancel</a>
+    <a id="cancel" href="#/self" class="btn btn-danger" ng-click="logout()">Cancel</a>
   </div>
 </div>

http://git-wip-us.apache.org/repos/asf/syncope/blob/edb0cb33/client/enduser/src/main/resources/META-INF/resources/app/views/user-form-finish.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/user-form-finish.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/user-form-finish.html
index 5a0003b..5c6465c 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/user-form-finish.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/user-form-finish.html
@@ -25,6 +25,6 @@ under the License.
   <navigation-buttons ng-show="createMode" base="create" current="finish" wizard="{{wizard}}"></navigation-buttons>
   <navigation-buttons ng-show="!createMode" base="update" current="finish" wizard="{{wizard}}"></navigation-buttons>
   <div class="pull-left">
-    <a id="cancel" href="#/self" class="btn btn-danger">Cancel</a>
+    <a id="cancel" href="#/self" class="btn btn-danger" ng-click="logout()">Cancel</a>
   </div>
 </div>

http://git-wip-us.apache.org/repos/asf/syncope/blob/edb0cb33/client/enduser/src/main/resources/META-INF/resources/app/views/user-groups.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/user-groups.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/user-groups.html
index 0c86b3f..63d6855 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/user-groups.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/user-groups.html
@@ -37,6 +37,6 @@ under the License.
   <navigation-buttons ng-show="createMode" base="create" current="groups" wizard="{{wizard}}"></navigation-buttons>
   <navigation-buttons ng-show="!createMode" base="update" current="groups" wizard="{{wizard}}"></navigation-buttons>
   <div class="pull-left">
-    <a id="cancel" href="#/self" class="btn btn-danger pull-left">Cancel</a>
+    <a id="cancel" href="#/self" class="btn btn-danger pull-left" ng-click="logout()">Cancel</a>
   </div>
 </div>

http://git-wip-us.apache.org/repos/asf/syncope/blob/edb0cb33/client/enduser/src/main/resources/META-INF/resources/app/views/user-plain-schemas.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/user-plain-schemas.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/user-plain-schemas.html
index 3baae9a..ef2fb57 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/user-plain-schemas.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/user-plain-schemas.html
@@ -24,6 +24,6 @@ under the License.
   <navigation-buttons ng-show="createMode" base="create" current="plainSchemas" wizard="{{wizard}}"></navigation-buttons>
   <navigation-buttons ng-show="!createMode" base="update" current="plainSchemas" wizard="{{wizard}}"></navigation-buttons>
   <div class="pull-left">
-    <a id="cancel" href="#/self" class="btn btn-danger pull-left">Cancel</a>
+    <a id="cancel" href="#/self" class="btn btn-danger pull-left" ng-click="logout()">Cancel</a>
   </div>
 </div>

http://git-wip-us.apache.org/repos/asf/syncope/blob/edb0cb33/client/enduser/src/main/resources/META-INF/resources/app/views/user-resources.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/user-resources.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/user-resources.html
index 67c9645..f0eb228 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/user-resources.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/user-resources.html
@@ -23,6 +23,6 @@ under the License.
   <navigation-buttons ng-show="createMode" base="create" current="resources" wizard="{{wizard}}"></navigation-buttons>
   <navigation-buttons ng-show="!createMode" base="update" current="resources" wizard="{{wizard}}"></navigation-buttons>
   <div class="pull-left">
-    <a id="cancel" href="#/self" class="btn btn-danger">Cancel</a>
+    <a id="cancel" href="#/self" class="btn btn-danger" ng-click="logout()">Cancel</a>
   </div>
 </div>

http://git-wip-us.apache.org/repos/asf/syncope/blob/edb0cb33/client/enduser/src/main/resources/META-INF/resources/app/views/user-virtual-schemas.html
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/META-INF/resources/app/views/user-virtual-schemas.html
b/client/enduser/src/main/resources/META-INF/resources/app/views/user-virtual-schemas.html
index 4cb2cf1..6e72ba6 100644
--- a/client/enduser/src/main/resources/META-INF/resources/app/views/user-virtual-schemas.html
+++ b/client/enduser/src/main/resources/META-INF/resources/app/views/user-virtual-schemas.html
@@ -25,6 +25,6 @@ under the License.
   <navigation-buttons ng-show="createMode" base="create" current="virtualSchemas" wizard="{{wizard}}"></navigation-buttons>
   <navigation-buttons ng-show="!createMode" base="update" current="virtualSchemas" wizard="{{wizard}}"></navigation-buttons>
   <div class="pull-left">
-    <a id="cancel" href="#/self" class="btn btn-danger">Cancel</a>
+    <a id="cancel" href="#/self" class="btn btn-danger" ng-click="logout()">Cancel</a>
   </div>
 </div>


Mime
View raw message