import javax.security.auth.callback.PasswordCallback;
import javax.security.auth.callback.TextOutputCallback;
import javax.security.auth.callback.UnsupportedCallbackException;
+import javax.security.auth.login.AccountNotFoundException;
import javax.security.auth.login.FailedLoginException;
import javax.security.auth.login.LoginContext;
import org.splat.dal.bo.kernel.User;
import org.splat.som.ApplicationRights;
+import org.splat.wapp.Constants;
/**
* User login action.
Subject identity = context.getSubject();
Set<User> table = identity.getPrincipals(User.class);
if (table.isEmpty()) {
- throw new Exception();
+ throw new AccountNotFoundException();
}
User user = table.iterator().next(); // The user is (apparently...) the 1st principal
Map<String, Object> sfilter = (Map<String, Object>) session
.get("study.filter");
- sfilter.put("state", "ANY");
- sfilter.put("visibility", "PRIVATE");
- if (logged.canCreateStudy()) {
- sfilter.put("author", String.valueOf(user.getIndex()));
+ if (sfilter != null) {
+ sfilter.put("state", "ANY");
+ sfilter.put("visibility", "PRIVATE");
+ if (logged.canCreateStudy()) {
+ sfilter.put("author", String.valueOf(user
+ .getIndex()));
+ }
}
}
this.connect(context, user); // Updates the session context
- setMenuProperty("none");
+ setMenuProperty(Constants.NONE);
initializationScreenContext(_menuProperty);
res = _backmenu;
+ if (res == null || "null".equals(res)) {
+ res = Constants.NONE;
+ }
} catch (FailedLoginException error) {
setErrorCode("message.error.login." + error.getMessage());
res = INPUT;
this.disconnect(); // Updates the session context
- setMenuProperty("none");
+ setMenuProperty(Constants.NONE);
initializationScreenContext(_menuProperty);
res = _backmenu;
+ if (res == null || "null".equals(res)) {
+ res = Constants.NONE;
+ }
} catch (Exception error) {
LOG.error("Reason:", error);
res = ERROR;