added method to distinguish logging of the user action from the login portlet from the actions performed through bookmarks
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerCore@33403 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ee56f071a1
commit
fca01bfd33
|
@ -34,6 +34,7 @@ public class ASLSession{
|
|||
private HashMap<String, Notifier> 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
|
||||
|
|
Loading…
Reference in New Issue