package de.uhilger.um.api;
|
|
import de.uhilger.baselink.GenericRecord;
|
import de.uhilger.baselink.Record;
|
import de.uhilger.um.App;
|
import de.uhilger.um.daten.User;
|
import org.apache.catalina.realm.RealmBase;
|
|
/**
|
*
|
* @author Ulrich Hilger
|
*/
|
public class UserMgr {
|
|
private static final String MD5 = "MD5";
|
|
private static final Record UserMapper = new GenericRecord(User.class);
|
|
public User createUser(User user) {
|
String kw = user.getPw();
|
String digestedPw = RealmBase.Digest(kw, MD5, null);
|
user.setPw(digestedPw);
|
App.getDatabase().insert(user, UserMapper);
|
return user;
|
}
|
|
}
|