diff options
author | galaxyAbstractor <galaxyAbstractor@gmail.com> | 2012-04-21 22:52:11 +0200 |
---|---|---|
committer | galaxyAbstractor <galaxyAbstractor@gmail.com> | 2012-04-25 11:49:06 +0200 |
commit | 1a8db76a200bd0de0bf17acd89e87e4875513d4c (patch) | |
tree | f87f540c3c7643e17e3c8cad2466df9176af55b1 /phpBB/install/install_install.php | |
parent | a21b367b21d811a3673145572b0bdd123ccc4767 (diff) | |
download | forums-1a8db76a200bd0de0bf17acd89e87e4875513d4c.tar forums-1a8db76a200bd0de0bf17acd89e87e4875513d4c.tar.gz forums-1a8db76a200bd0de0bf17acd89e87e4875513d4c.tar.bz2 forums-1a8db76a200bd0de0bf17acd89e87e4875513d4c.tar.xz forums-1a8db76a200bd0de0bf17acd89e87e4875513d4c.zip |
[ticket/10836] Check if avatar directory is writable after install
Check if the avatar directory is writeable after the installation is complete.
If it isn't, disable avatars and avatar uploading by default.
PHPBB3-10836
Diffstat (limited to 'phpBB/install/install_install.php')
-rw-r--r-- | phpBB/install/install_install.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 81dac9ecde..35fc0bb58e 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -105,6 +105,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'); @@ -1942,6 +1943,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) |