Exemple #1
0
// Initial Tests
if (!isset($_GET['sessiontest']) && !isset($_POST['page'])) {
    // Test for session
    $_SESSION['test'] = true;
    // Tests for smarty
    if (!extension_loaded_or('tokenizer')) {
        installerShowErrorPage('Tokenizer extension is disabled or missing in your PHP, this could cause pages to render as purely white. We required you have this installed! Check your installation, exiting!', 'Tokenizer_extension_is_disable_or_missing');
    }
    @clearstatcache();
    $pathSmartClass = cms_join_path(CMS_BASE, 'lib', 'smarty', 'Smarty.class.php');
    if (!is_readable($pathSmartClass)) {
        installerShowErrorPage('Smarty.class.php cannot be found or not readable! Check your installation for ' . $pathSmartClass . ', exiting!', 'Smarty.class.php_cannot_be_found_or_not_readable');
    }
    $test_writables = array(TMP_TEMPLATES_C_LOCATION, TMP_CACHE_LOCATION);
    foreach ($test_writables as $d) {
        $test = testDirWrite('', '', $d, '', 0, $debug);
        if ($test->res == 'red') {
            installerShowErrorPage('Directory not writable! ' . $d . '<br />Please correct by executing: <em>chmod 777</em> or set writing permission for php process, exiting!', 'Directory_not_writable');
        }
    }
    require_once $pathSmartClass;
    $smarty = new Smarty();
    $smarty->compile_dir = TMP_TEMPLATES_C_LOCATION;
    $smarty->cache_dir = TMP_CACHE_LOCATION;
    $smarty->template_dir = cms_join_path(CMS_INSTALL_BASE, 'templates');
    $smarty->caching = false;
    $smarty->force_compile = true;
    $smarty->debugging = false;
    $smarty->assign('languages', $installer->dropdown_lang());
    $smarty->display('installer_start.tpl');
    $smarty->display('pagestart.tpl');
 function assignVariables()
 {
     $settings = array('info' => array(), 'required' => array(), 'recommended' => array());
     $safe_mode = ini_get('safe_mode');
     $open_basedir = ini_get('open_basedir');
     /*
      * Info Settings
      */
     $settings['info']['server_software'] = $_SERVER['SERVER_SOFTWARE'];
     $settings['info']['server_api'] = PHP_SAPI;
     $settings['info']['server_os'] = PHP_OS . ' ' . php_uname('r') . ' ' . ilang('on') . ' ' . php_uname('m');
     if (extension_loaded_or('apache2handler')) {
         $settings['info']['mod_security'] = getApacheModules('mod_security') ? ilang('on') : ilang('off');
     }
     /*
      * Required Settings
      */
     list($minimum, $recommended) = getTestValues('php_version');
     $settings['recommended'][] = testIntegerMask(0, ilang('test_error_estrict'), 'error_reporting', E_STRICT, ilang('test_estrict_failed'), true, true, false);
     if (defined('E_DEPRECATED')) {
         $settings['recommended'][] = testIntegerMask(0, ilang('test_error_edeprecated'), 'error_reporting', E_DEPRECATED, ilang('test_edeprecated_failed'), true, true, false);
     }
     $settings['required'][] = testVersionRange(1, ilang('test_check_php', $minimum) . '<br />' . ilang('test_min_recommend', $minimum, $recommended), phpversion(), ilang('test_requires_php_version', phpversion(), $recommended), $minimum, $recommended, false);
     $settings['required'][] = testBoolean(1, ilang('test_check_md5_func'), function_exists('md5'), '', false, false, 'Function_md5_disabled');
     list($minimum, $recommended) = getTestValues('gd_version');
     $settings['required'][] = testGDVersion(1, ilang('test_check_gd'), $minimum, ilang('test_check_gd_failed'), 'min_GD_version');
     $settings['required'][] = testFileWritable(1, ilang('test_check_write') . ' config.php', CONFIG_FILE_LOCATION, ilang('test_may_not_exist'), $this->debug);
     $settings['required'][] = testBoolean(1, ilang('test_check_tempnam'), function_exists('tempnam'), '', false, false, 'Function_tempnam_disabled');
     $settings['required'][] = testBoolean(1, ilang('test_check_magic_quotes_runtime'), 'magic_quotes_runtime', ilang('test_check_magic_quotes_runtime_failed'), true, true, 'magic_quotes_runtime_On');
     $settings['required'][] = testSupportedDatabase(1, ilang('test_check_db_drivers'), false, ilang('test_check_db_drivers_failed'));
     if ('1' != $safe_mode && !isset($_SESSION['allowsafemode'])) {
         $settings['required'][] = testCreateDirAndFile(1, ilang('test_create_dir_and_file'), ilang('info_create_dir_and_file'), $this->debug);
     }
     /*
      * Recommended Settings
      */
     list($minimum, $recommended) = getTestValues('memory_limit');
     $settings['recommended'][] = testRange(0, ilang('test_check_memory') . '<br />' . ilang('test_min_recommend', $minimum, $recommended), 'memory_limit', ilang('test_check_memory_failed'), $minimum, $recommended, true, true, null, 'memory_limit_range');
     list($minimum, $recommended) = getTestValues('max_execution_time');
     $settings['recommended'][] = testRange(0, ilang('test_check_time_limit') . '<br />' . ilang('test_min_recommend', $minimum, $recommended), 'max_execution_time', ilang('test_check_time_limit_failed'), $minimum, $recommended, true, false, 0, 'max_execution_time_range');
     $settings['recommended'][] = testBoolean(0, ilang('test_check_register_globals'), 'register_globals', ilang('test_check_register_globals_failed'), true, true, 'register_globals_enabled');
     $settings['recommended'][] = testInteger(0, ilang('test_check_output_buffering'), 'output_buffering', ilang('test_check_output_buffering_failed'), true, true, 'output_buffering_disabled');
     $settings['recommended'][] = testString(0, ilang('test_check_disable_functions'), 'disable_functions', ilang('test_check_disable_functions_failed'), true, 'green', 'yellow', 'disable_functions_not_empty');
     if (!isset($_SESSION['allowsafemode'])) {
         $settings['recommended'][] = testBoolean(0, ilang('test_check_safe_mode'), 'safe_mode', ilang('test_check_safe_mode_failed'), true, true, 'safe_mode_enabled');
     }
     $settings['recommended'][] = testString(0, ilang('test_check_open_basedir'), $open_basedir, ilang('test_check_open_basedir_failed'), false, 'green', 'yellow', 'open_basedir_enabled');
     if (!isset($_SESSION['skipremote'])) {
         $settings['recommended'][] = testRemoteFile(0, ilang('test_remote_url'), '', ilang('test_remote_url_failed'), $this->debug);
     }
     $settings['recommended'][] = testBoolean(0, ilang('test_check_file_upload'), 'file_uploads', ilang('test_check_file_failed'), true, false, 'Function_file_uploads_disabled');
     list($minimum, $recommended) = getTestValues('post_max_size');
     $settings['recommended'][] = testRange(0, ilang('test_check_post_max') . '<br />' . ilang('test_min_recommend', $minimum, $recommended), 'post_max_size', ilang('test_check_post_max_failed'), $minimum, $recommended, true, true, null, 'min_post_max_size');
     list($minimum, $recommended) = getTestValues('upload_max_filesize');
     $settings['recommended'][] = testRange(0, ilang('test_check_upload_max') . '<br />' . ilang('test_min_recommend', $minimum, $recommended), 'upload_max_filesize', ilang('test_check_upload_max_failed'), $minimum, $recommended, true, true, null, 'min_upload_max_filesize');
     $f = cms_join_path(CMS_BASE, 'uploads');
     $settings['recommended'][] = testDirWrite(0, ilang('test_check_writable', $f), $f, ilang('test_check_upload_failed'), 0, $this->debug);
     $f = cms_join_path(CMS_BASE, 'uploads' . DIRECTORY_SEPARATOR . 'images');
     $settings['recommended'][] = testDirWrite(0, ilang('test_check_writable', $f), $f, ilang('test_check_images_failed'), 0, $this->debug);
     $f = cms_join_path(CMS_BASE, 'modules');
     $settings['recommended'][] = testDirWrite(0, ilang('test_check_writable', $f), $f, ilang('test_check_modules_failed'), 0, $this->debug);
     $session_save_path = testSessionSavePath('');
     if (empty($session_save_path)) {
         $settings['recommended'][] = testDummy(ilang('test_check_session_save_path'), '', 'yellow', ilang('test_empty_session_save_path'), 'session_save_path_empty', '');
     } elseif (!empty($open_basedir)) {
         $settings['recommended'][] = testDummy(ilang('test_check_session_save_path'), '', 'yellow', ilang('test_open_basedir_session_save_path'), 'No_check_session_save_path_with_open_basedir', '');
     } else {
         $settings['recommended'][] = testDirWrite(0, ilang('test_check_session_save_path'), $session_save_path, ilang('test_check_session_save_path_failed', $session_save_path), 1, $this->debug);
     }
     $settings['recommended'][] = testBoolean(0, 'session.use_cookies', 'session.use_cookies', ilang('session_use_cookies'));
     $settings['recommended'][] = testBoolean(0, ilang('test_check_xml_func'), extension_loaded_or('xml'), ilang('test_check_xml_failed'), false, false, 'Function_xml_disabled');
     $settings['recommended'][] = testBoolean(0, ilang('test_xmlreader_class'), class_exists('XMLReader', false), ilang('test_xmlreader_failed'), false, false, 'class_xmlreader_unavailable');
     $settings['recommended'][] = testBoolean(0, ilang('test_check_file_get_contents'), function_exists('file_get_contents'), ilang('test_check_file_get_contents_failed'), false, false, 'Function_file_get_content_disabled');
     #		$settings['recommended'][] =
     #			testBoolean(0, ilang('test_check_magic_quotes_gpc'),
     #				'magic_quotes_gpc', ilang('test_check_magic_quotes_gpc_failed'), true, true, 'magic_quotes_gpc_On');
     $_log_errors_max_len = ini_get('log_errors_max_len') ? ini_get('log_errors_max_len') . '0' : '99';
     ini_set('log_errors_max_len', $_log_errors_max_len);
     $result = ini_get('log_errors_max_len') == $_log_errors_max_len;
     $settings['recommended'][] = testBoolean(0, ilang('test_check_ini_set'), $result, ilang('test_check_ini_set_failed'), false, false, 'ini_set_disabled');
     // assign settings
     list($this->continueon, $this->special_failed) = testGlobal(array(true, false), true);
     $this->smarty->assign('settings', $settings);
     $this->smarty->assign('special_failed', $this->special_failed);
     if (isset($_SESSION['advanceduser'])) {
         $this->smarty->assign('continueon', true);
     } else {
         $this->smarty->assign('continueon', $this->continueon);
     }
     $this->smarty->assign('phpinfo', getEmbedPhpInfo(INFO_CONFIGURATION | INFO_MODULES));
     $this->smarty->assign('errors', $this->errors);
 }
Exemple #3
0
            if (!$found_grantall) {
                $tmp[0]['server_db_grants'] = testDummy('db_grants', lang('error_nograntall_found'), 'yellow');
            } else {
                $tmp[0]['server_db_grants'] = testDummy('db_grants', lang('msg_grantall_found'), 'green');
            }
        }
        break;
}
$smarty->assign('count_server_info', count($tmp[0]));
$smarty->assign('server_info', $tmp);
$tmp = array(0 => array(), 1 => array());
$dir = $config['root_path'] . DIRECTORY_SEPARATOR . 'tmp';
$tmp[1]['tmp'] = testDirWrite(0, $dir, $dir);
$dir = TMP_TEMPLATES_C_LOCATION;
$tmp[1]['templates_c'] = testDirWrite(0, $dir, $dir);
$dir = $config['root_path'] . DIRECTORY_SEPARATOR . 'modules';
$tmp[1]['modules'] = testDirWrite(0, $dir, $dir);
$global_umask = get_site_preference('global_umask', '022');
$tmp[1][lang('global_umask')] = testUmask(0, lang('global_umask'), $global_umask);
$result = is_writable(CONFIG_FILE_LOCATION);
#$tmp[1]['config_file'] = testFileWritable(0, lang('config_writable'), CONFIG_FILE_LOCATION, '');
$tmp[1]['config_file'] = testDummy('', substr(sprintf('%o', fileperms(CONFIG_FILE_LOCATION)), -4), $result ? 'red' : 'green', $result ? lang('config_writable') : '');
$smarty->assign('count_permission_info', count($tmp[0]));
$smarty->assign('permission_info', $tmp);
if (isset($_GET['cleanreport']) && $_GET['cleanreport'] == 1) {
    echo $smarty->fetch('systeminfo.txt.tpl');
} else {
    echo $smarty->fetch('systeminfo.tpl');
}
include_once "footer.php";
# vim:ts=4 sw=4 noet