aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-04-26 22:08:42 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2012-04-26 22:08:42 -0400
commit3a67604900a5301c133bfb0bf8f2d998306c3827 (patch)
treef87f540c3c7643e17e3c8cad2466df9176af55b1 /phpBB
parentcdf7ff17974eb20f37b25998036a723ea783a381 (diff)
parent1a8db76a200bd0de0bf17acd89e87e4875513d4c (diff)
downloadforums-3a67604900a5301c133bfb0bf8f2d998306c3827.tar
forums-3a67604900a5301c133bfb0bf8f2d998306c3827.tar.gz
forums-3a67604900a5301c133bfb0bf8f2d998306c3827.tar.bz2
forums-3a67604900a5301c133bfb0bf8f2d998306c3827.tar.xz
forums-3a67604900a5301c133bfb0bf8f2d998306c3827.zip
Merge PR #771 branch 'galaxyAbstractor/ticket/10836' into develop-olympus
* galaxyAbstractor/ticket/10836: [ticket/10836] Check if avatar directory is writable after install [ticket/10836] Enable avatars by default at install
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/install/install_install.php16
-rw-r--r--phpBB/install/schemas/schema_data.sql4
2 files changed, 18 insertions, 2 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)
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index efc81e37c0..ba2d18da00 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');