package mircoders.module;
+import java.util.HashMap;
+import java.util.Map;
+
import mir.entity.EntityList;
import mir.log.LoggerWrapper;
import mir.module.AbstractModule;
import mircoders.global.MirGlobal;
import mircoders.storage.DatabaseUsers;
-import java.util.HashMap;
-import java.util.Map;
-
/*
* Users Module -
try {
String whereString =
"login='" + JDBCStringRoutines.escapeStringLiteral(user) + "' " +
- "and password='" + JDBCStringRoutines.escapeStringLiteral(
- MirGlobal.localizer().adminInterface().makePasswordDigest(password)) +
- "' " +
+ "and (" +
+ " password='" + JDBCStringRoutines.escapeStringLiteral(MirGlobal.localizer().adminInterface().makePasswordDigest(password)) + "'" +
+ " or password='" + JDBCStringRoutines.escapeStringLiteral(password) + "'" +
+ " )" +
"and is_admin='1'";
EntityList userList = getByWhereClause(whereString, -1);
- if (userList != null && userList.getCount() == 1) {
+ if (userList != null && userList.size() == 1) {
EntityUsers result = (EntityUsers) userList.elementAt(0);
if (result.getFieldValue("is_disabled") == null ||
}
}
- /**
- *
- * @param theValues
- * @return
- * @throws ModuleExc
- * @throws ModuleFailure
- */
public String set (Map theValues) throws ModuleExc, ModuleFailure {
try {
return super.set(digestPassword(theValues));
try {
String sql = "update webdb_users set lastlogin=now() where id = " + aUser.getId();
- storage.executeUpdate(sql);
+ database.executeUpdate(sql);
}
catch (Throwable t) {
// no propagation of this error for now, to allow mir to still function