主题: to Kara: PostfixAdmin-2.2.1.1 的一个补丁

注意:该补丁不是用于 iRedMail 环境的,纯技术探讨。

--- login.php   2007-12-29 20:32:33.000000000 -0500
+++ login.php.bak       2008-10-27 14:46:22.000000000 -0400
@@ -67,18 +67,23 @@
     {
         $row = db_array ($result['result']);
         $password = pacrypt ($fPassword, $row['password']);
-        $result = db_query ("SELECT * FROM $table_admin WHERE username='$fUsername' AND password='$password' AND active='1'");
-        if ($result['rows'] != 1)
+
+        //$result = db_query ("SELECT * FROM $table_admin WHERE username='$fUsername' AND password='$password' AND active='1'");
+        //if ($result['rows'] != 1)
+        if ($password != $row['password'])
         {
             $error = 1;
-            $tMessage = $PALANG['pLogin_password_incorrect'];
+            //$tMessage = $PALANG['pLogin_password_incorrect'];
+            $tMessage = $PALANG['pLogin_incorrect'];
             $tUsername = $fUsername;
         }
     }
     else
     {
         $error = 1;
+        //$tMessage = $PALANG['pLogin_username_incorrect'];
         $tMessage = $PALANG['pLogin_username_incorrect'];
+        $tMessage = $PALANG['pLogin_incorrect'];
     }
 
     if ($error != 1)

--- languages/en.lang   2007-12-29 05:42:09.000000000 +0800
+++ languages/en.lang.new       2008-10-27 14:45:01.000000000 +0800
@@ -24,6 +24,7 @@
 $PALANG['pLogin_username'] = 'Login (email)';
 $PALANG['pLogin_password'] = 'Password';
 $PALANG['pLogin_button'] = 'Login';
+$PALANG['pLogin_incorrect'] = '<span class="error_msg">Username or password is not correct!</span>';
 $PALANG['pLogin_username_incorrect'] = '<span class="error_msg">Your login is not correct. Make sure that you login with your email address!</span>';
 $PALANG['pLogin_password_incorrect'] = '<span class="error_msg">Your password is not correct!</span>';
 $PALANG['pLogin_login_users'] = 'Users click here to login to the user section.';

回复: to Kara: PostfixAdmin-2.2.1.1 的一个补丁

该补丁不是用于 iRedMail 环境的,纯技术探讨。