Commit 15e88c37 by Juho Juopperi

dunno what

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