Example #1
0
 private function ShowSystemInfo()
 {
     // Server Information
     $GLOBALS['ProductVersion'] = isc_html_escape(PRODUCT_VERSION);
     $GLOBALS['PHPVersion'] = isc_html_escape(phpversion());
     $GLOBALS['MySQLVersion'] = isc_html_escape(mysql_get_server_info());
     $GLOBALS['ServerSoftware'] = isc_html_escape($_SERVER['SERVER_SOFTWARE']);
     if (GetConfig('DisableSystemInfoEdition')) {
         $GLOBALS['HideEdition'] = 'display: none';
     } else {
         if (isset($GLOBALS['ProductEditionUpgrade'])) {
             $GLOBALS['ProductEdition'] .= " (<a href='" . GetConfig('SystemInfoEditionUpgradeLink') . "' target='_blank'>Upgrade</a>)";
         }
     }
     if (GDEnabled()) {
         $php_mods = parsePHPModules();
         $GLOBALS['GDVersion'] = isc_html_escape($php_mods['gd']['GD Version']);
     } else {
         $GLOBALS['GDVersion'] = GetLang('GDMissing');
     }
     if ((bool) ini_get('safe_mode') == true) {
         $GLOBALS['SafeMode'] = GetLang('Enabled');
     } else {
         $GLOBALS['SafeMode'] = GetLang('Disabled');
     }
     $GLOBALS['MultiByteFunctions'] = array();
     if (function_exists("mb_strpos")) {
         $GLOBALS['MultiByteFunctions'][] = "Multibyte";
     }
     if (function_exists("iconv_strpos")) {
         $GLOBALS['MultiByteFunctions'][] = "iconv";
     }
     $GLOBALS['MultiByteFunctions'] = implode("<br />", $GLOBALS['MultiByteFunctions']);
     if (!$GLOBALS['MultiByteFunctions']) {
         $GLOBALS['MultiByteFunctions'] = GetLang('NotSupported');
     }
     $GLOBALS['RemoteConnections'] = array();
     if (function_exists("curl_init")) {
         $GLOBALS['RemoteConnections'][] = "CURL";
     }
     if (!(bool) ini_get('safe_mode') && ini_get('allow_url_fopen')) {
         $GLOBALS['RemoteConnections'][] = GetLang('RemoteFOpen');
     }
     $GLOBALS['RemoteConnections'] = implode("<br />", $GLOBALS['RemoteConnections']);
     if (!$GLOBALS['RemoteConnections']) {
         $GLOBALS['RemoteConnections'] = GetLang('NoneSupported');
     }
     if (function_exists('pspell_suggest')) {
         $GLOBALS['PSpell'] = GetLang('Enabled');
     } else {
         $GLOBALS['PSpell'] = GetLang('NotSupported');
     }
     $GLOBALS['OperatingSystem'] = isc_html_escape(php_uname());
     $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("sysinfo");
     $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();
 }
Example #2
0
		public function CheckInstallationPrerequisites()
		{
			// Check the permissions on required files/folders
			$folders = $this->_CheckPermissions();
			$bad_folders = 0;
			$folder_messages = array();

			foreach($folders as $folder) {
				switch($folder[1]) {
					case NOT_WRITABLE: {
						if ($folder[2]) {
							$type = "file";
						} else {
							$type = "folder";
						}
						$message = "The ".$type." <strong>" . $folder[0] . "</strong> is not writable. Please CHMOD it to ";
						if (isset($folder[2]) && $folder[2] === true) {
							$message .= "646 or 664 or 666";
						} else {
							$message .= "757 or 775 or 777";
						}
						$code = "filePermissions";
						break;
					}
					case DOESNT_EXIST: {
						$message = "The file/folder <strong>" . $folder[0] . "</strong> doesn't exist. Please create it.";
						$code = "doesntExist";
						break;
					}
					default: {
						$code = '';
						$message = '';
					}
				}
				if($code != '' && $message != '') {
					$folder_messages[] = array(
						"code" => $code,
						"extra" => $folder[0],
						"message" => $message
					);
				}
			}

			if(!empty($folder_messages)) {
				$this->ShowInstallErrors(GetLang('PermissionsError'), $folder_messages, true);
			}

			// Are we running the required version of PHP?
			$php_check = version_compare(PHP_VERSION, PHP_VERSION_REQUIRED);

			if($php_check < 0) {
				$errors = array(
					0 => array(
						"code" => "phpVersion",
						"extra" => PHP_VERSION,
						"message" => sprintf(GetLang("PHPV5Message"), PHP_VERSION_REQUIRED, PHP_VERSION)
					)
				);
				$this->ShowInstallErrors(GetLang('BadPHPVersion'), $errors);
			}

			// Is GD enabled?
			if(!GDEnabled()) {
				$errors = array(
					0 => array(
						"code" => "gdRequired",
						"message" => GetLang('GDRequiredMessage'),
					)
				);
				$this->ShowInstallErrors(GetLang('GDRequired'), $errors);
			}

			// Is simpleXML supported?
			if(!function_exists('simplexml_load_string')) {
				$errors = array(
					0 => array(
						"code" => "simpleXMLRequired",
						"message" => GetLang('SimpleXMLRequiredMessage'),
					)
				);
				$this->ShowInstallErrors(GetLang('SimpleXMLRequired'), $errors);
			}
		}