[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/phpbb/db/migration/data/v30x/ -> release_3_0_12_rc1.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  
  14  namespace phpbb\db\migration\data\v30x;
  15  
  16  /** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.12-RC1 **/
  17  
  18  class release_3_0_12_rc1 extends \phpbb\db\migration\migration
  19  {
  20  	public function effectively_installed()
  21      {
  22          return phpbb_version_compare($this->config['version'], '3.0.12-RC1', '>=');
  23      }
  24  
  25  	static public function depends_on()
  26      {
  27          return array('\phpbb\db\migration\data\v30x\release_3_0_11');
  28      }
  29  
  30  	public function update_data()
  31      {
  32          return array(
  33              array('custom', array(array(&$this, 'update_module_auth'))),
  34              array('custom', array(array(&$this, 'disable_bots_from_receiving_pms'))),
  35  
  36              array('config.update', array('version', '3.0.12-RC1')),
  37          );
  38      }
  39  
  40  	public function disable_bots_from_receiving_pms()
  41      {
  42          // Disable receiving pms for bots
  43          $sql = 'SELECT user_id
  44              FROM ' . BOTS_TABLE;
  45          $result = $this->db->sql_query($sql);
  46  
  47          $bot_user_ids = array();
  48          while ($row = $this->db->sql_fetchrow($result))
  49          {
  50              $bot_user_ids[] = (int) $row['user_id'];
  51          }
  52          $this->db->sql_freeresult($result);
  53  
  54          if (!empty($bot_user_ids))
  55          {
  56              $sql = 'UPDATE ' . USERS_TABLE . '
  57                  SET user_allow_pm = 0
  58                  WHERE ' . $this->db->sql_in_set('user_id', $bot_user_ids);
  59              $this->sql_query($sql);
  60          }
  61      }
  62  
  63  	public function update_module_auth()
  64      {
  65          $sql = 'UPDATE ' . MODULES_TABLE . '
  66              SET module_auth = \'acl_u_sig\'
  67              WHERE module_class = \'ucp\'
  68                  AND module_basename = \'profile\'
  69                  AND module_mode = \'signature\'';
  70          $this->sql_query($sql);
  71      }
  72  }


Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1