[ Index ] |
PHP Cross Reference of phpBB-3.1.12-deutsch |
[Summary view] [Print] [Text view]
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 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu Jan 11 00:25:41 2018 | Cross-referenced by PHPXref 0.7.1 |