1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-14 19:45:21 +02:00

[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
This commit is contained in:
galaxyAbstractor 2012-04-21 22:52:11 +02:00
parent a21b367b21
commit 1a8db76a20

View File

@ -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');
@ -1941,6 +1942,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
*/