Subversion Repositories oidplus

Rev

Rev 329 | Rev 392 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 329 Rev 360
Line 109... Line 109...
109
        }
109
        }
110
 
110
 
111
        public static function adminCheckPassword($password) {
111
        public static function adminCheckPassword($password) {
112
                $hashed = OIDplus::baseConfig()->getValue('ADMIN_PASSWORD', '');
112
                $hashed = OIDplus::baseConfig()->getValue('ADMIN_PASSWORD', '');
113
                if (empty($hashed)) {
113
                if (empty($hashed)) {
114
                        throw new OIDplusException("No admin password set in userdata/baseconfig/config.inc.php");
114
                        throw new OIDplusException(_L('No admin password set in %1','userdata/baseconfig/config.inc.php'));
115
                }
115
                }
116
                $calc_authkey = bin2hex(version_compare(PHP_VERSION, '7.1.0') >= 0 ? hash('sha3-512', $password, true) : bb\Sha3\Sha3::hash($password, 512, true));
116
                $calc_authkey = bin2hex(version_compare(PHP_VERSION, '7.1.0') >= 0 ? hash('sha3-512', $password, true) : bb\Sha3\Sha3::hash($password, 512, true));
117
                return $calc_authkey == bin2hex(base64_decode($hashed));
117
                return $calc_authkey == bin2hex(base64_decode($hashed));
118
        }
118
        }
119
 
119