PMA\libraries\config\ServerConfigChecks::performConfigChecks PHP Method

performConfigChecks() public method

Perform config checks
public performConfigChecks ( ) : void
return void
    public function performConfigChecks()
    {
        $blowfishSecret = $this->cfg->get('blowfish_secret');
        $blowfishSecretSet = false;
        $cookieAuthUsed = false;
        list($sAllowArbitraryServerWarn, $sBlowfishSecretMsg, $sBZipDumpWarn, $sDirectoryNotice, $sGZipDumpWarn, $sLoginCookieValidityWarn, $sLoginCookieValidityWarn2, $sLoginCookieValidityWarn3, $sSecurityInfoMsg, $sSrvAuthCfgMsg, $sZipDumpExportWarn, $sZipDumpImportWarn) = self::defineMessages();
        list($cookieAuthUsed, $blowfishSecret, $blowfishSecretSet) = $this->performConfigChecksServers($cookieAuthUsed, $blowfishSecret, $sSrvAuthCfgMsg, $sSecurityInfoMsg, $blowfishSecretSet);
        $this->performConfigChecksCookieAuthUsed($cookieAuthUsed, $blowfishSecretSet, $sBlowfishSecretMsg, $blowfishSecret);
        //
        // $cfg['AllowArbitraryServer']
        // should be disabled
        //
        if ($this->cfg->getValue('AllowArbitraryServer')) {
            PMA_messagesSet('notice', 'AllowArbitraryServer', PMA_lang(PMA_langName('AllowArbitraryServer')), PMA_lang($sAllowArbitraryServerWarn));
        }
        $this->performConfigChecksLoginCookie($sLoginCookieValidityWarn, $sLoginCookieValidityWarn2, $sLoginCookieValidityWarn3);
        //
        // $cfg['SaveDir']
        // should not be world-accessible
        //
        if ($this->cfg->getValue('SaveDir') != '') {
            PMA_messagesSet('notice', 'SaveDir', PMA_lang(PMA_langName('SaveDir')), PMA_lang($sDirectoryNotice));
        }
        //
        // $cfg['TempDir']
        // should not be world-accessible
        //
        if ($this->cfg->getValue('TempDir') != '') {
            PMA_messagesSet('notice', 'TempDir', PMA_lang(PMA_langName('TempDir')), PMA_lang($sDirectoryNotice));
        }
        $this->performConfigChecksZips($sGZipDumpWarn, $sBZipDumpWarn, $sZipDumpImportWarn, $sZipDumpExportWarn);
    }

Usage Example

Exemplo n.º 1
0
/** @var ConfigFile $cf */
$cf = $GLOBALS['ConfigFile'];
$separator = URL::getArgSeparator('html');
// message handling
PMA_messagesBegin();
//
// Check phpMyAdmin version
//
if (isset($_GET['version_check'])) {
    PMA_versionCheck();
}
//
// Perform various security, compatibility and consistency checks
//
$configChecker = new ServerConfigChecks($GLOBALS['ConfigFile']);
$configChecker->performConfigChecks();
//
// Check whether we can read/write configuration
//
$config_readable = false;
$config_writable = false;
$config_exists = false;
PMA_checkConfigRw($config_readable, $config_writable, $config_exists);
if (!$config_writable || !$config_readable) {
    PMA_messagesSet('error', 'config_rw', __('Cannot load or save configuration'), Sanitize::sanitize(__('Please create web server writable folder [em]config[/em] in ' . 'phpMyAdmin top level directory as described in ' . '[doc@setup_script]documentation[/doc]. Otherwise you will be ' . 'only able to download or display it.')));
}
//
// Check https connection
//
$is_https = !empty($_SERVER['HTTPS']) && mb_strtolower($_SERVER['HTTPS']) == 'on';
if (!$is_https) {
All Usage Examples Of PMA\libraries\config\ServerConfigChecks::performConfigChecks