// will be used
boolean masterLogin = false;
// Create authentication session
AuthenticationSession authSession = null;
AuthenticationModule authModule = getAuthenticationModule();
// Master login
if (user == null && credentials == null) {
user = this.masterLoginInputName;
credentials = this.masterLoginPassword;
masterLogin = true;
authSession = MasterLoginAuthSession.getInstance();
}
// Anonymous login
else if (user.equals(WGDatabase.ANONYMOUS_USER)) {
authSession = AnonymousAuthSession.getInstance();
}
// Regular login against authentication module
else if (authModule != null) {
if (certAuthEnabled() && (credentials instanceof X509Certificate)) {
authSession = ((CertAuthCapableAuthModule) authModule).login((X509Certificate) credentials);
}
else {
authSession = authModule.login(user, credentials);
}
if (authSession == null) {
return WGDatabase.ACCESSLEVEL_NOTLOGGEDIN;
}