commit | author | age
|
c65695
|
1 |
package de.uhilger.um.api; |
U |
2 |
|
|
3 |
import de.uhilger.baselink.GenericRecord; |
|
4 |
import de.uhilger.baselink.Record; |
|
5 |
import de.uhilger.um.App; |
|
6 |
import de.uhilger.um.daten.User; |
|
7 |
import org.apache.catalina.realm.RealmBase; |
|
8 |
|
|
9 |
/** |
|
10 |
* |
|
11 |
* @author Ulrich Hilger |
|
12 |
*/ |
|
13 |
public class UserMgr { |
|
14 |
|
|
15 |
private static final String MD5 = "MD5"; |
|
16 |
|
|
17 |
private static final Record UserMapper = new GenericRecord(User.class); |
|
18 |
|
|
19 |
public User createUser(User user) { |
|
20 |
String kw = user.getPw(); |
|
21 |
String digestedPw = RealmBase.Digest(kw, MD5, null); |
|
22 |
user.setPw(digestedPw); |
|
23 |
App.getDatabase().insert(user, UserMapper); |
|
24 |
return user; |
|
25 |
} |
|
26 |
|
f8b605
|
27 |
public String hallo() { |
U |
28 |
return "Hallo Welt"; |
|
29 |
} |
|
30 |
|
c65695
|
31 |
} |