super(id);
if (WebSession.get().isSignedIn()) {
alreadyLoggedIn();
} else {
IAuthenticationStrategy strategy = getApplication().getSecuritySettings().getAuthenticationStrategy();
// get username and password from persistence store
String[] data = strategy.load();
if ((data != null) && (data.length > 1)) {
// try to sign in the user
if (WebSession.get().signIn(data[0], data[1])) {
login = data[0];
password = data[1];
alreadyLoggedIn();
} else {
// the loaded credentials are wrong. erase them.
strategy.remove();
}
}
}
add(new FeedbackPanel("feedback"));
add(new RequiredTextField<String>("login", new PropertyModel<String>(this, "login")));