From 59f8b3f307819166729c3a4af1b4026720e9accf Mon Sep 17 00:00:00 2001 From: ulrich <undisclosed> Date: Tue, 20 Dec 2016 15:01:59 +0000 Subject: [PATCH] Weiere Anpassungen an der Gestaltung der Benutzerseite --- src/java/de/uhilger/um/api/UserMgr.java | 26 +++++++++++++++++++++++++- 1 files changed, 25 insertions(+), 1 deletions(-) diff --git a/src/java/de/uhilger/um/api/UserMgr.java b/src/java/de/uhilger/um/api/UserMgr.java index 3ae67bf..249dfcf 100644 --- a/src/java/de/uhilger/um/api/UserMgr.java +++ b/src/java/de/uhilger/um/api/UserMgr.java @@ -4,10 +4,12 @@ import de.uhilger.baselink.Record; import de.uhilger.um.App; import de.uhilger.um.daten.User; +import java.util.List; import org.apache.catalina.realm.RealmBase; /** - * + * Klasse zur Verwaltung von Benutzern in einer Datenbank + * * @author Ulrich Hilger */ public class UserMgr { @@ -16,6 +18,10 @@ private static final Record UserMapper = new GenericRecord(User.class); + public static final String SQL_GET_USER_LIST = "getUserList"; + public static final String SQL_GET_USER_NAME_LIST = "getUserNameList"; + public static final String SQL_DELETE_USER = "deleteUser"; + public User createUser(User user) { String kw = user.getPw(); String digestedPw = RealmBase.Digest(kw, MD5, null); @@ -24,6 +30,24 @@ return user; } + public List getUserNameList() { + String sql = App.getSqlStatement(SQL_GET_USER_NAME_LIST); + List userNames = App.getDatabase().select(sql, App.WITHOUT_BLOBS); + return userNames; + } + + public User deleteUser(User user) { + return (User) App.getDatabase().delete(user, UserMapper); + } + + /* + public List getUserList() { + String sql = App.getSqlStatement(SQL_GET_USER_LIST); + List users = App.getDatabase().select(sql, UserMapper, App.WITHOUT_BLOBS); + return users; + } + */ + public String hallo() { return "Hallo Welt"; } -- Gitblit v1.9.3