diff options
Diffstat (limited to 'phpBB/install/install_install.php')
| -rw-r--r-- | phpBB/install/install_install.php | 77 | 
1 files changed, 59 insertions, 18 deletions
| diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 7558fde944..ef384edb78 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -52,11 +52,13 @@ class install_install extends module  	function main($mode, $sub)  	{ -		global $lang, $template, $language, $phpbb_root_path; +		global $lang, $template, $language, $phpbb_root_path, $cache;  		switch ($sub)  		{  			case 'intro': +				$cache->purge(); +  				$this->page_title = $lang['SUB_INTRO'];  				$template->assign_vars(array( @@ -104,6 +106,7 @@ class install_install extends module  				$this->add_language($mode, $sub);  				$this->add_bots($mode, $sub);  				$this->email_admin($mode, $sub); +				$this->disable_avatars_if_unwritable();  				// Remove the lock file  				@unlink($phpbb_root_path . 'cache/install_lock'); @@ -128,7 +131,7 @@ class install_install extends module  			'BODY'		=> $lang['REQUIREMENTS_EXPLAIN'],  		)); -		$passed = array('php' => false, 'db' => false, 'files' => false, 'pcre' => false, 'imagesize' => false,); +		$passed = array('php' => false, 'db' => false, 'files' => false, 'pcre' => false, 'imagesize' => false, 'json' => false,);  		// Test for basic PHP settings  		$template->assign_block_vars('checks', array( @@ -165,25 +168,28 @@ class install_install extends module  			'S_LEGEND'		=> false,  		)); -		// Check for register_globals being enabled -		if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') -		{ -			$result = '<strong style="color:red">' . $lang['NO'] . '</strong>'; -		} -		else +		// Don't check for register_globals on 5.4+ +		if (version_compare($php_version, '5.4.0-dev') < 0)  		{ -			$result = '<strong style="color:green">' . $lang['YES'] . '</strong>'; -		} - -		$template->assign_block_vars('checks', array( -			'TITLE'			=> $lang['PHP_REGISTER_GLOBALS'], -			'TITLE_EXPLAIN'	=> $lang['PHP_REGISTER_GLOBALS_EXPLAIN'], -			'RESULT'		=> $result, +			// Check for register_globals being enabled +			if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') +			{ +				$result = '<strong style="color:red">' . $lang['NO'] . '</strong>'; +			} +			else +			{ +				$result = '<strong style="color:green">' . $lang['YES'] . '</strong>'; +			} -			'S_EXPLAIN'		=> true, -			'S_LEGEND'		=> false, -		)); +			$template->assign_block_vars('checks', array( +				'TITLE'			=> $lang['PHP_REGISTER_GLOBALS'], +				'TITLE_EXPLAIN'	=> $lang['PHP_REGISTER_GLOBALS_EXPLAIN'], +				'RESULT'		=> $result, +				'S_EXPLAIN'		=> true, +				'S_LEGEND'		=> false, +			)); +		}  		// Check for url_fopen  		if (@ini_get('allow_url_fopen') == '1' || strtolower(@ini_get('allow_url_fopen')) == 'on') @@ -244,6 +250,26 @@ class install_install extends module  			'S_EXPLAIN'		=> true,  			'S_LEGEND'		=> false,  		)); +		 +		// Check for php json support +		if (@extension_loaded('json')) +		{ +			$passed['json'] = true; +			$result = '<strong style="color:green">' . $lang['YES'] . '</strong>'; +		} +		else +		{ +			$result = '<strong style="color:red">' . $lang['NO'] . '</strong>'; +		} + +		$template->assign_block_vars('checks', array( +			'TITLE'			=> $lang['PHP_JSON_SUPPORT'], +			'TITLE_EXPLAIN'	=> $lang['PHP_JSON_SUPPORT_EXPLAIN'], +			'RESULT'		=> $result, + +			'S_EXPLAIN'		=> true, +			'S_LEGEND'		=> false, +		));  /**  *		Better not enabling and adding to the loaded extensions due to the specific requirements needed @@ -1852,6 +1878,21 @@ class install_install extends module  	}  	/** +	* Check if the avatar directory is writable and disable avatars +	* if it isn't writable. +	*/ +	function disable_avatars_if_unwritable() +	{ +		global $phpbb_root_path; + +		if (!phpbb_is_writable($phpbb_root_path . 'images/avatars/upload/')) +		{ +			set_config('allow_avatar', 0); +			set_config('allow_avatar_upload', 0); +		} +	} + +	/**  	* Generate a list of available mail server authentication methods  	*/  	function mail_auth_select($selected_method) | 
