PMA\libraries\config\ServerConfigChecks::performConfigChecksCookieAuthUsed PHP Метод

performConfigChecksCookieAuthUsed() защищенный Метод

Check config of servers
protected performConfigChecksCookieAuthUsed ( boolean $cookieAuthUsed, boolean $blowfishSecretSet, string $sBlowfishSecretMsg, string $blowfishSecret ) : array
$cookieAuthUsed boolean Cookie auth is used
$blowfishSecretSet boolean Blowfish secret set
$sBlowfishSecretMsg string Blowfish secret message
$blowfishSecret string Blowfish secret
Результат array
    protected function performConfigChecksCookieAuthUsed($cookieAuthUsed, $blowfishSecretSet, $sBlowfishSecretMsg, $blowfishSecret)
    {
        //
        // $cfg['blowfish_secret']
        // it's required for 'cookie' authentication
        //
        if ($cookieAuthUsed) {
            if ($blowfishSecretSet) {
                // 'cookie' auth used, blowfish_secret was generated
                PMA_messagesSet('notice', 'blowfish_secret_created', PMA_lang(PMA_langName('blowfish_secret')), PMA_lang($sBlowfishSecretMsg));
            } else {
                $blowfishWarnings = array();
                // check length
                if (strlen($blowfishSecret) < 32) {
                    // too short key
                    $blowfishWarnings[] = __('Key is too short, it should have at least 32 characters.');
                }
                // check used characters
                $hasDigits = (bool) preg_match('/\\d/', $blowfishSecret);
                $hasChars = (bool) preg_match('/\\S/', $blowfishSecret);
                $hasNonword = (bool) preg_match('/\\W/', $blowfishSecret);
                if (!$hasDigits || !$hasChars || !$hasNonword) {
                    $blowfishWarnings[] = PMA_lang(__('Key should contain letters, numbers [em]and[/em] ' . 'special characters.'));
                }
                if (!empty($blowfishWarnings)) {
                    PMA_messagesSet('error', 'blowfish_warnings' . count($blowfishWarnings), PMA_lang(PMA_langName('blowfish_secret')), implode('<br />', $blowfishWarnings));
                }
            }
        }
    }