aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-03-04 01:04:36 +0100
committerMarc Alexander <admin@m-a-styles.de>2013-03-04 01:04:36 +0100
commitc7ca4e445c7dc6c775e27597cd7b0968fa5fd904 (patch)
tree5d3f512d5d034b48ea287f27854fafdc348384d6 /phpBB
parente1bb76eb096673af9e106f4cbd6e328c2b4bfdb6 (diff)
downloadforums-c7ca4e445c7dc6c775e27597cd7b0968fa5fd904.tar
forums-c7ca4e445c7dc6c775e27597cd7b0968fa5fd904.tar.gz
forums-c7ca4e445c7dc6c775e27597cd7b0968fa5fd904.tar.bz2
forums-c7ca4e445c7dc6c775e27597cd7b0968fa5fd904.tar.xz
forums-c7ca4e445c7dc6c775e27597cd7b0968fa5fd904.zip
[feature/avatars] Add migrations data file for avatars
The module_auth of the ucp avatar settings are used for checking if the migration has already been installed. PHPBB3-10018
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/db/migration/data/310/avatars.php64
1 files changed, 64 insertions, 0 deletions
diff --git a/phpBB/includes/db/migration/data/310/avatars.php b/phpBB/includes/db/migration/data/310/avatars.php
new file mode 100644
index 0000000000..de11a64556
--- /dev/null
+++ b/phpBB/includes/db/migration/data/310/avatars.php
@@ -0,0 +1,64 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2013 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
+*
+*/
+
+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');
+ }
+
+ static public function depends_on()
+ {
+ return array('phpbb_db_migration_data_30x_3_0_11');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_avatar_type' => array('VCHAR:255', ''),
+ ),
+ $this->table_prefix . 'groups' => array(
+ 'group_avatar_type' => array('VCHAR:255', ''),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'change_columns' => array(
+ $this->table_prefix . 'users' => array(
+ 'user_avatar_type' => array('TINT:2', ''),
+ ),
+ $this->table_prefix . 'groups' => array(
+ 'group_avatar_type' => array('TINT:2', ''),
+ ),
+ ),
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('allow_avatar_gravatar', 0)),
+ );
+ }
+}