}
AuthenticationResult authn = new AuthenticationResult( true, principal, null );
+ authn.setUser( user );
return new DefaultSecuritySession( authn, user );
}
//$.log("devMode:"+window.archivaDevMode);
+
+
// no cache for ajax queries as we get datas from servers so preventing caching !!
jQuery.ajaxSetup( {
cache: false,//!window.archivaDevMode
displayErrorMessage($.i18n.prop('authz.karma.needed'));
userLogged(function(user){
userLoggedCallbackFn(user);
+ },function(){
+ $.log("not logged");
+ loginBox();
});
},
500: function(data){
/**
* call successFn on success with passing user object coming from cookie
*/
- userLogged=function(successFn) {
+ userLogged=function(successFn,notLoggedFn) {
// call restServices/redbackServices/loginService/isLogged to know
// if a session exists and check the cookie
$.log("userLogged");
if (successFn){
successFn(userLogged ? getUserFromLoginCookie():null);
}
+ if(!userLogged){
+ if(notLoggedFn){
+ notLoggedFn();
+ }
+ }
}
});
}