diff options
| author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-04-26 22:25:26 -0400 | 
|---|---|---|
| committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-04-26 22:25:26 -0400 | 
| commit | cd6f6d2813c4436d9ca49b6a16b531def7218c9b (patch) | |
| tree | f7161591cc181daf995df5388e62d3f239cad61b | |
| parent | 7d92cccf74319bbc7ab2f8fecc2ddf65f4ba1cc7 (diff) | |
| parent | 3a67604900a5301c133bfb0bf8f2d998306c3827 (diff) | |
| download | forums-cd6f6d2813c4436d9ca49b6a16b531def7218c9b.tar forums-cd6f6d2813c4436d9ca49b6a16b531def7218c9b.tar.gz forums-cd6f6d2813c4436d9ca49b6a16b531def7218c9b.tar.bz2 forums-cd6f6d2813c4436d9ca49b6a16b531def7218c9b.tar.xz forums-cd6f6d2813c4436d9ca49b6a16b531def7218c9b.zip | |
Merge PR #771 branch 'develop-olympus' into develop
* develop-olympus:
  [ticket/10836] Check if avatar directory is writable after install
  [ticket/10836] Enable avatars by default at install
| -rw-r--r-- | phpBB/install/install_install.php | 16 | ||||
| -rw-r--r-- | phpBB/install/schemas/schema_data.sql | 4 | 
2 files changed, 18 insertions, 2 deletions
| diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 9b27a268f5..3b963e75c0 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -104,6 +104,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'); @@ -1875,6 +1876,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) diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index ec162754cb..2ea5eca768 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -8,10 +8,10 @@  INSERT INTO phpbb_config (config_name, config_value) VALUES ('active_sessions', '0');  INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_attachments', '1');  INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_autologin', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar', '1');  INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_local', '0');  INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_remote', '0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_upload', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_upload', '1');  INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_remote_upload', '0');  INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_bbcode', '1');  INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_birthdays', '1'); | 
