session expired fix
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@129634 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
418d7cb11a
commit
96c214d9fa
|
@ -52,6 +52,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(CKANPublisherServicesImpl.class);
|
||||
|
||||
public static final String TEST_SCOPE = "/gcube/devsec/devVRE";
|
||||
public static final String TEST_USER = "test.user";
|
||||
|
||||
public static final String CKAN_TOKEN_KEY = "ckanToken";
|
||||
public static final String CKAN_LICENSES_KEY = "ckanLicenses";
|
||||
|
@ -108,7 +109,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
* @return .
|
||||
*/
|
||||
public String getDevelopmentUser() {
|
||||
String user = "test.user";
|
||||
String user = TEST_USER;
|
||||
// user = "costantino.perciante";
|
||||
return user;
|
||||
}
|
||||
|
@ -122,6 +123,9 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
ASLSession session = getASLSession();
|
||||
String username = session.getUsername();
|
||||
logger.debug("User in session is " + username);
|
||||
|
||||
if(username.equals(TEST_USER))
|
||||
return null;
|
||||
|
||||
String token = null;
|
||||
if(this.getThreadLocalRequest().getSession().getAttribute(CKAN_TOKEN_KEY) != null)
|
||||
|
@ -319,7 +323,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
String user = aslSession.getUsername();
|
||||
|
||||
// check if session expired
|
||||
if(user.equals(getDevelopmentUser())){
|
||||
if(user.equals(TEST_USER)){
|
||||
logger.debug("SESSION EXPIRED");
|
||||
return null;
|
||||
}
|
||||
|
@ -470,7 +474,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
try{
|
||||
|
||||
// check if session expired
|
||||
if(user.equals(getDevelopmentUser())){
|
||||
if(user.equals(TEST_USER)){
|
||||
logger.debug("SESSION EXPIRED");
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue