some db code rewriting
[mir.git] / source / mircoders / module / ModuleUsers.java
index 5aede0b..23f4295 100755 (executable)
@@ -73,9 +73,10 @@ public class ModuleUsers extends AbstractModule
     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);
@@ -140,13 +141,6 @@ public class ModuleUsers extends AbstractModule
     }
   }
 
-  /**
-   *
-   * @param theValues
-   * @return
-   * @throws ModuleExc
-   * @throws ModuleFailure
-   */
   public String set (Map theValues) throws ModuleExc, ModuleFailure {
     try {
       return super.set(digestPassword(theValues));