--- /dev/null
+package mircoders.module;
+
+import java.io.*;
+import java.lang.*;
+import java.util.*;
+import java.sql.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+import freemarker.template.*;
+
+import webdb.servlet.*;
+import webdb.module.*;
+import webdb.entity.*;
+import webdb.misc.*;
+import webdb.storage.*;
+
+import mir.entity.*;
+import mir.storage.*;
+
+
+/*
+ * Users Module -
+ *
+ *
+ * @author RK
+ */
+
+public class ModuleUsers extends AbstractModule
+{
+ static Logfile theLog;
+
+ // Kontruktor
+
+ public ModuleUsers(StorageObject theStorage)
+ {
+
+ if (theLog == null) theLog = Logfile.getInstance(Configuration.getProperty("Home") + Configuration.getProperty("Module.Users.Logfile"));
+ if (theStorage == null) theLog.printWarning("StorageObject was null!");
+ this.theStorage = theStorage;
+
+ }
+
+ /**
+ * login method
+ */
+
+ public EntityUsers getUserForLogin(String user, String password) throws ModuleException
+ {
+ String whereString = "login='" +user + "' and password='"+ password + "' and is_admin='1'";
+ EntityList userList = getByWhereClause(whereString, -1);
+ if (userList != null && userList.getCount()==1)
+ return (EntityUsers)userList.elementAt(0);
+ else return null;
+ }
+
+
+
+ public EntityList getUsers(String whereClause, int offset, int limit)
+ throws ModuleException
+ {
+ try {
+ return theStorage.selectByWhereClause(whereClause, null, offset, limit);
+ }
+ catch (StorageObjectException e){
+ throw new ModuleException(e.toString());
+ }
+ }
+
+ public SimpleList getUsersAsSimpleList() {
+ // String sql = "select id, name from Users order by name";
+ return ((DatabaseUsers)theStorage).getPopupData();
+ }
+
+}