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
This commit is contained in:
Oleg Pudeyev 2012-04-26 22:25:26 -04:00
commit cd6f6d2813
2 changed files with 18 additions and 2 deletions

View file

@ -104,6 +104,7 @@ class install_install extends module
$this->add_language($mode, $sub); $this->add_language($mode, $sub);
$this->add_bots($mode, $sub); $this->add_bots($mode, $sub);
$this->email_admin($mode, $sub); $this->email_admin($mode, $sub);
$this->disable_avatars_if_unwritable();
// Remove the lock file // Remove the lock file
@unlink($phpbb_root_path . 'cache/install_lock'); @unlink($phpbb_root_path . 'cache/install_lock');
@ -1874,6 +1875,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 * Generate a list of available mail server authentication methods
*/ */

View file

@ -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 ('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_attachments', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_autologin', '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_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_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_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_bbcode', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_birthdays', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_birthdays', '1');