Changeset 1931


Ignore:
Timestamp:
Jun 17, 2011, 10:11:20 AM (5 years ago)
Author:
robert@…
Message:

Users will be logged out from modules when logging out from GSCF now. See ticket #485

Location:
trunk/grails-app
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/authentication/LogoutController.groovy

    r1816 r1931  
    1515                        redirect uri: SpringSecurityUtils.securityConfig.logout.filterProcessesUrl // '/j_spring_security_logout'
    1616                }
    17                 // TODO  put any pre-logout code here
     17
     18                // Remove all remote sessions for this user.
     19                def user = authenticationService.getLoggedInUser();
     20                if( user )
     21                        authenticationService.deleteRemoteSessions( user );
    1822               
    1923                // Remove all queries from session
     
    3640                }
    3741               
    38                 println "REDIRECT: " + returnUrl;
    39                 println "parameters: " + params
    40                
    4142                // Try to rest the redirect url
    4243                if( params[ SpringSecurityUtils.securityConfig.successHandler.targetUrlParameter ] ) {
  • trunk/grails-app/services/dbnp/authentication/AuthenticationService.groovy

    r1783 r1931  
    9595        return user ? user.secUser : null
    9696    }
     97       
     98        /**
     99         * Remove all remote sessions for a user
     100         * @param user
     101         */
     102        public void deleteRemoteSessions( SecUser user ) {
     103        if( user ) {
     104                        SessionAuthenticatedUser.executeUpdate("delete SessionAuthenticatedUser u where u.secUser = :secUser", [ secUser: user ])
     105        }
     106        }
    97107
    98108    /**
Note: See TracChangeset for help on using the changeset viewer.