Outh working!. Pending:

- Test all databases
- Migration Scripts
- Manage error due to changing of authentication schemas.
- Link from the login page.
- What happend with the logout ?.
This commit is contained in:
Paulo Gustavo Veiga
2013-03-17 18:51:33 -03:00
parent 2f8df725c9
commit 94356a5773
13 changed files with 113 additions and 40 deletions

View File

@@ -18,6 +18,7 @@
package com.wisemapping.model;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.Serializable;
@@ -36,9 +37,8 @@ public class User
private Calendar activationDate;
private Set<String> tags = new HashSet<String>();
private boolean allowSendEmail = false;
private int schema;
private String locale;
private AuthenticationSchema authenticationSchema;
public User() {
}
@@ -116,11 +116,25 @@ public class User
this.locale = locale;
}
public int getAutheticationCode() {
return this.schema;
public char getAutheticationCode() {
return this.authenticationSchema != null ? this.authenticationSchema.getCode() : null;
}
public void setAuthenticationCode(int code) {
this.schema = code;
public void setAutheticationCode(char code) {
this.authenticationSchema = AuthenticationSchema.valueOf(code);
}
public AuthenticationSchema getAuthenticationSchema() {
return authenticationSchema;
}
public void setAuthenticationSchema(@NotNull AuthenticationSchema authenticationSchema) {
this.authenticationSchema = authenticationSchema;
}
public boolean isDatabaseSchema(){
return this.authenticationSchema==AuthenticationSchema.DATABASE;
}
}