diff options
author | Oliver Schramm <oliver.schramm97@gmail.com> | 2014-07-16 18:30:27 +0200 |
---|---|---|
committer | Oliver Schramm <oliver.schramm97@gmail.com> | 2015-07-19 21:26:47 +0200 |
commit | df56b2ed364e24f803047c9f64d168432ba2680c (patch) | |
tree | 1639bc2251c411bb68e0be3e33f67b74bf468fc7 /phpBB/phpbb | |
parent | 39f3313534f63c720da31b4deb726cb5d8a5d3ae (diff) | |
download | forums-df56b2ed364e24f803047c9f64d168432ba2680c.tar forums-df56b2ed364e24f803047c9f64d168432ba2680c.tar.gz forums-df56b2ed364e24f803047c9f64d168432ba2680c.tar.bz2 forums-df56b2ed364e24f803047c9f64d168432ba2680c.tar.xz forums-df56b2ed364e24f803047c9f64d168432ba2680c.zip |
[ticket/8708] Add f_announce_global permission
PHPBB3-8708
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r-- | phpBB/phpbb/db/migration/data/v320/announce_global_permission.php | 41 | ||||
-rw-r--r-- | phpBB/phpbb/permissions.php | 1 |
2 files changed, 42 insertions, 0 deletions
diff --git a/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php b/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php new file mode 100644 index 0000000000..fe30a1c1b8 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php @@ -0,0 +1,41 @@ +<?php +/** +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited <https://www.phpbb.com> +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class announce_global_permission extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + $sql = 'SELECT auth_option_id + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option = 'f_announce_global'"; + $result = $this->db->sql_query($sql); + $auth_option_id = $this->db->sql_fetchfield('auth_option_id'); + $this->db->sql_freeresult($result); + + return $auth_option_id !== false; + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\rc2'); + } + + public function update_data() + { + return array( + array('permission.add', array('f_announce_global', false, 'f_announce')), + ); + } +} diff --git a/phpBB/phpbb/permissions.php b/phpBB/phpbb/permissions.php index 82f59b5c20..c462f72a73 100644 --- a/phpBB/phpbb/permissions.php +++ b/phpBB/phpbb/permissions.php @@ -251,6 +251,7 @@ class permissions 'f_post' => array('lang' => 'ACL_F_POST', 'cat' => 'post'), 'f_sticky' => array('lang' => 'ACL_F_STICKY', 'cat' => 'post'), 'f_announce' => array('lang' => 'ACL_F_ANNOUNCE', 'cat' => 'post'), + 'f_announce_global' => array('lang' => 'ACL_F_ANNOUNCE_GLOBAL', 'cat' => 'post'), 'f_reply' => array('lang' => 'ACL_F_REPLY', 'cat' => 'post'), 'f_edit' => array('lang' => 'ACL_F_EDIT', 'cat' => 'post'), 'f_delete' => array('lang' => 'ACL_F_DELETE', 'cat' => 'post'), |