diff options
author | 2020-01-01 12:09:57 +0100 | |
---|---|---|
committer | 2020-01-01 12:09:57 +0100 | |
commit | 8fed25382aea1761c085e0c88a28c84c83308950 (patch) | |
tree | f4eb06620648ec925833ad8aea491f6c0f6f775a | |
parent | [ticket/16284] Use tables array in acp_storage_module (diff) | |
download | phpbb-8fed25382aea1761c085e0c88a28c84c83308950.tar.gz phpbb-8fed25382aea1761c085e0c88a28c84c83308950.tar.bz2 phpbb-8fed25382aea1761c085e0c88a28c84c83308950.zip |
[ticket/16284] Add effectively_installed to add_storage_permission
PHPBB3-16284
-rw-r--r-- | phpBB/phpbb/db/migration/data/v400/add_storage_permission.php | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/phpBB/phpbb/db/migration/data/v400/add_storage_permission.php b/phpBB/phpbb/db/migration/data/v400/add_storage_permission.php index 0836462f03..5987b4ef61 100644 --- a/phpBB/phpbb/db/migration/data/v400/add_storage_permission.php +++ b/phpBB/phpbb/db/migration/data/v400/add_storage_permission.php @@ -11,18 +11,32 @@ * */ -namespace phpbb\db\migration\data\v330; +namespace phpbb\db\migration\data\v400; -class add_storage_permission extends \phpbb\db\migration\migration +use phpbb\db\migration\migration; + +class add_storage_permission extends migration { + public function effectively_installed() + { + $sql = 'SELECT auth_option_id + FROM ' . $this->tables['acl_options'] . " + WHERE auth_option = 'a_storage'"; + $result = $this->db->sql_query($sql); + $a_storage_option_id = (int) $this->db->sql_fetchfield('auth_option_id'); + $this->db->sql_freeresult($result); + + return !empty($a_storage_option_id); + } + public function update_data() { - return array( + return [ // Add permission - array('permission.add', array('a_storage')), + ['permission.add', ['a_storage']], // Set permissions - array('permission.permission_set', array('ROLE_ADMIN_FULL', 'a_storage')), - ); + ['permission.permission_set', ['ROLE_ADMIN_FULL', 'a_storage']], + ]; } } |