diff --git a/src/org/gcube/application/framework/core/session/ASLSession.java b/src/org/gcube/application/framework/core/session/ASLSession.java index d659a0d..def0562 100644 --- a/src/org/gcube/application/framework/core/session/ASLSession.java +++ b/src/org/gcube/application/framework/core/session/ASLSession.java @@ -34,6 +34,7 @@ public class ASLSession{ private HashMap notifiers; String scopeName; private ASLGroupModel groupModel; + private boolean loggedIn = false; // ACCESS LOGGER @@ -182,6 +183,7 @@ public class ASLSession{ public String getScopeName() { System.out.println("The scope is name: " + scope); + System.out.println("the username is: " + username); if (scope != null) return scope.toString(); else @@ -214,17 +216,38 @@ public class ASLSession{ System.out.println("la" + scope); if(new PortalSecurityManager(this.scope).isSecurityEnabled()) this.credential = UserCredential.getCredential(username, scope); - if (previousScopeName != null && !previousScopeName.equals(scopeName)) { + + // get the attribute that indicates of log in has been done from the login portlet - or if the user logs in from a bookmark + if (loggedIn == true) { + // don't log + initializeAttributes(); + // clear the attribute + loggedIn = false; + System.out.println("Passing the logging because the variable was set"); + return; + } + if ((previousScopeName != null && !previousScopeName.equals(scopeName)) || previousScopeName == null) { + System.out.println("Logging the entrance"); innerSession.clear(); // ACCESS LOGGER LoginToVreAccessLogEntry loginEntry = new LoginToVreAccessLogEntry(); accessLogger.logEntry(username, scope, loginEntry); - } + } else + System.out.println("Passing the logging because the scope was the same"); initializeAttributes(); } + public void logUserLogin(String scope) { + System.out.println("LogUserLogin method called"); + innerSession.clear(); + loggedIn = true; + // ACCESS LOGGER + LoginToVreAccessLogEntry loginEntry = new LoginToVreAccessLogEntry(); + accessLogger.logEntry(username, scope, loginEntry); + } + /** * @param notification the name of the notification to wait for * @throws InterruptedException when the thread is interrupted