Browse Source

[Web] Implement MD5-CRYPT verification, fixes #1665

André 7 years ago
parent
commit
5db40bf688
1 changed files with 6 additions and 0 deletions
  1. 6 0
      data/web/inc/functions.inc.php

+ 6 - 0
data/web/inc/functions.inc.php

@@ -266,6 +266,12 @@ function verify_hash($hash, $password) {
       return true;
     }
   }
+  elseif (preg_match('/^{MD5-CRYPT}/i', $hash)) {
+    $hash = preg_replace('/^{MD5-CRYPT}/i', '', $hash);
+    if (password_verify($password, $hash)) {
+      return true;
+    }
+  }
   return false;
 }
 function check_login($user, $pass) {