diff options
author | Marc Alexander <admin@m-a-styles.de> | 2013-03-04 10:30:49 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2013-03-04 10:30:49 +0100 |
commit | 2e2ddd7e85034f747d5dd312803aadfc47ac80e2 (patch) | |
tree | 220feb9e1451c0f38b40f46b9e638c5f3edfd945 /phpBB/includes/db | |
parent | c7ca4e445c7dc6c775e27597cd7b0968fa5fd904 (diff) | |
download | forums-2e2ddd7e85034f747d5dd312803aadfc47ac80e2.tar forums-2e2ddd7e85034f747d5dd312803aadfc47ac80e2.tar.gz forums-2e2ddd7e85034f747d5dd312803aadfc47ac80e2.tar.bz2 forums-2e2ddd7e85034f747d5dd312803aadfc47ac80e2.tar.xz forums-2e2ddd7e85034f747d5dd312803aadfc47ac80e2.zip |
[feature/avatars] Update module_auth of ucp module and fix small issues
Reduced the check effectively_installed() to just checking for the config
entry "allow_avatar_gravatar". Also added the missing update of the
module_auth of the ucp_profile avatar mode.
PHPBB3-10018
Diffstat (limited to 'phpBB/includes/db')
-rw-r--r-- | phpBB/includes/db/migration/data/310/avatars.php | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/phpBB/includes/db/migration/data/310/avatars.php b/phpBB/includes/db/migration/data/310/avatars.php index de11a64556..79547337f7 100644 --- a/phpBB/includes/db/migration/data/310/avatars.php +++ b/phpBB/includes/db/migration/data/310/avatars.php @@ -11,15 +11,7 @@ class phpbb_db_migration_data_310_avatars extends phpbb_db_migration { public function effectively_installed() { - $sql = 'SELECT module_auth - FROM ' . MODULES_TABLE . " - WHERE module_class = 'ucp' - AND module_basename = 'ucp_profile' - AND module_mode = 'avatar'"; - $result = $this->db->sql_query($sql); - $module_auth = $this->db->sql_fetchfield('module_auth'); - $this->db->sql_freeresult($result); - return ($module_auth == 'cfg_allow_avatar'); + return isset($this->config['allow_avatar_gravatar']); } static public function depends_on() @@ -59,6 +51,17 @@ class phpbb_db_migration_data_310_avatars extends phpbb_db_migration { return array( array('config.add', array('allow_avatar_gravatar', 0)), + array('custom', array(array($this, 'update_module_auth'))), ); } + + public function update_module_auth() + { + $sql = 'UPDATE ' . $this->table_prefix . "modules + SET module_auth = 'cfg_allow_avatar' + WHERE module_class = 'ucp' + AND module_basename = 'ucp_profile' + AND module_mode = 'avatar'"; + $this->db->sql_query($sql); + } } |