Add xf12 to PasswordUtil
authorTim Düsterhus <timwolla@googlemail.com>
Thu, 13 Feb 2014 22:29:52 +0000 (23:29 +0100)
committerTim Düsterhus <timwolla@googlemail.com>
Thu, 13 Feb 2014 22:29:52 +0000 (23:29 +0100)
wcfsetup/install/files/lib/util/PasswordUtil.class.php

index 26fef06477d51b1c38a95258f473dc924ee04b3d..261360ead90d9629f48bde316aedaecd13264045 100644 (file)
@@ -37,7 +37,8 @@ final class PasswordUtil {
                'wbb2',         // WoltLab Burning Board 2.x
                'wcf1',         // WoltLab Community Framework 1.x
                'wcf2',         // WoltLab Community Framework 2.x
-               'xf1',          // XenForo 1.x
+               'xf1',          // XenForo 1.0 / 1.1
+               'xf12',         // XenForo 1.2+
                'joomla1',      // Joomla 1.x
                'joomla2',      // Joomla 2.x
                'joomla3',      // Joomla 3.x
@@ -590,7 +591,7 @@ final class PasswordUtil {
        }
        
        /**
-        * Validates the password hash for XenForo 1.x with (xf1).
+        * Validates the password hash for XenForo 1.0 / 1.1 (xf1).
         * 
         * @param       string          $username
         * @param       string          $password
@@ -609,6 +610,23 @@ final class PasswordUtil {
                return false;
        }
        
+       /**
+        * Validates the password hash for XenForo 1.2+ (xf12).
+        * 
+        * @param       string          $username
+        * @param       string          $password
+        * @param       string          $salt
+        * @param       string          $dbHash
+        * @return      boolean
+        */
+       protected static function xf12($username, $password, $salt, $dbHash) {
+               if (self::secureCompare($dbHash, self::getSaltedHash($password, $dbHash))) {
+                       return true;
+               }
+               
+               return false;
+       }
+       
        /**
         * Validates the password hash for Joomla 1.x (kunea)
         *