Commit 15e88c37 by Juho Juopperi

dunno what

1 parent 2126e11a
...@@ -60,5 +60,4 @@ public class UserBean implements UserBeanLocal { ...@@ -60,5 +60,4 @@ public class UserBean implements UserBeanLocal {
public User getUser(String nick) { public User getUser(String nick) {
return userFacade.findByLogin(nick); return userFacade.findByLogin(nick);
} }
} }
...@@ -12,5 +12,6 @@ ...@@ -12,5 +12,6 @@
<attribute name="owner.project.facets" value="jst.java"/> <attribute name="owner.project.facets" value="jst.java"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry combineaccessrules="false" kind="src" path="/LanBortalUtilities"/>
<classpathentry kind="output" path="build/classes"/> <classpathentry kind="output" path="build/classes"/>
</classpath> </classpath>
...@@ -26,6 +26,8 @@ import javax.persistence.Version; ...@@ -26,6 +26,8 @@ import javax.persistence.Version;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import fi.insomnia.bortal.utilities.PasswordFunctions;
import sun.reflect.generics.reflectiveObjects.NotImplementedException; import sun.reflect.generics.reflectiveObjects.NotImplementedException;
/** /**
...@@ -61,10 +63,10 @@ public class User implements ModelInterface<Integer> { ...@@ -61,10 +63,10 @@ public class User implements ModelInterface<Integer> {
@Column(name = "created", nullable = false, columnDefinition = "timestamptz default now()") @Column(name = "created", nullable = false, columnDefinition = "timestamptz default now()")
@Temporal(TemporalType.TIMESTAMP) @Temporal(TemporalType.TIMESTAMP)
private Calendar created; private Calendar created = Calendar.getInstance();
@Column(name = "active", nullable = false, columnDefinition = "boolean default true") @Column(name = "active", nullable = false, columnDefinition = "boolean default true")
private boolean active; private boolean active = true;
@Column(name = "password") @Column(name = "password")
private String password; private String password;
...@@ -534,11 +536,12 @@ public class User implements ModelInterface<Integer> { ...@@ -534,11 +536,12 @@ public class User implements ModelInterface<Integer> {
} }
public void resetPassword(String password) { public void resetPassword(String password) {
// XXX: Couldn't reference utility project String newEncryptedPassword = PasswordFunctions.getEncryptedPassword(password);
throw new NotImplementedException(); this.password = newEncryptedPassword; // Bypass setter
} }
public boolean checkPassword(String password) { public boolean checkPassword(String plainPassword) {
throw new NotImplementedException(); boolean matches = PasswordFunctions.checkPlainPassword(plainPassword, this.password);
return matches;
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!