From 246bc8cf08e0c8a093a55ed298e3f2eebd313acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sat, 9 Sep 2017 17:59:33 +0200 Subject: [PATCH 1/4] [ticket/15289] Fix missing language string PHPBB3-15289 --- phpBB/includes/acp/info/acp_storage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/info/acp_storage.php b/phpBB/includes/acp/info/acp_storage.php index 25807be91f..facec03c66 100644 --- a/phpBB/includes/acp/info/acp_storage.php +++ b/phpBB/includes/acp/info/acp_storage.php @@ -17,7 +17,7 @@ class acp_storage_info { return array( 'filename' => 'acp_storage', - 'title' => 'ACP_STORAGE', + 'title' => 'ACP_STORAGE_SETTINGS', 'modes' => array( 'settings' => array('title' => 'ACP_STORAGE_SETTINGS', 'auth' => 'acl_a_storage', 'cat' => array('ACP_SERVER_CONFIGURATION')), ), From cb350e20e196dac688837a52e80d4ae6ef708e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sun, 10 Sep 2017 11:35:39 +0200 Subject: [PATCH 2/4] [ticket/15289] Add permission for storage PHPBB3-15289 --- phpBB/language/en/acp/permissions_phpbb.php | 1 + .../data/v330/add_storage_permission.php | 29 +++++++++++++++++++ phpBB/phpbb/permissions.php | 1 + 3 files changed, 31 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v330/add_storage_permission.php diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php index f986eced38..817854c8ed 100644 --- a/phpBB/language/en/acp/permissions_phpbb.php +++ b/phpBB/language/en/acp/permissions_phpbb.php @@ -199,6 +199,7 @@ $lang = array_merge($lang, array( 'ACL_A_ROLES' => 'Can manage roles', 'ACL_A_SWITCHPERM' => 'Can use others permissions', + 'ACL_A_STORAGE' => 'Can manage storages', 'ACL_A_STYLES' => 'Can manage styles', 'ACL_A_EXTENSIONS' => 'Can manage extensions', 'ACL_A_VIEWLOGS' => 'Can view logs', diff --git a/phpBB/phpbb/db/migration/data/v330/add_storage_permission.php b/phpBB/phpbb/db/migration/data/v330/add_storage_permission.php new file mode 100644 index 0000000000..6cc3e49c89 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v330/add_storage_permission.php @@ -0,0 +1,29 @@ + +* @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\v330; + +class add_storage_permission extends \phpbb\db\migration\migration +{ + public function update_data() + { + return array( + // Add permission + array('permission.add', array('a_storage')), + + // Set permissions + array('permission.permission_set', array('ROLE_ADMIN_FULL', 'a_storage')), + array('permission.permission_set', array('ROLE_ADMIN_STANDARD', 'a_storage')), + ); + } +} diff --git a/phpBB/phpbb/permissions.php b/phpBB/phpbb/permissions.php index c9181e6202..09b3277b13 100644 --- a/phpBB/phpbb/permissions.php +++ b/phpBB/phpbb/permissions.php @@ -348,6 +348,7 @@ class permissions 'a_roles' => array('lang' => 'ACL_A_ROLES', 'cat' => 'permissions'), 'a_switchperm' => array('lang' => 'ACL_A_SWITCHPERM', 'cat' => 'permissions'), + 'a_storage' => array('lang' => 'ACL_A_STORAGE', 'cat' => 'misc'), 'a_styles' => array('lang' => 'ACL_A_STYLES', 'cat' => 'misc'), 'a_extensions' => array('lang' => 'ACL_A_EXTENSIONS', 'cat' => 'misc'), 'a_viewlogs' => array('lang' => 'ACL_A_VIEWLOGS', 'cat' => 'misc'), From 748235276e9ed6cc94cd9be2a39d2571fb36b88c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sun, 10 Sep 2017 13:23:02 +0200 Subject: [PATCH 3/4] [ticket/15289] Remove permission for standard admin PHPBB3-15289 --- phpBB/install/schemas/schema_data.sql | 2 +- phpBB/phpbb/db/migration/data/v330/add_storage_permission.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index b965d2e784..7ed0eaf92a 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -523,7 +523,7 @@ INSERT INTO phpbb_ranks (rank_title, rank_min, rank_special, rank_image) VALUES # -- Roles data # Standard Admin (a_) -INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 1, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'a_%' AND auth_option NOT IN ('a_switchperm', 'a_jabber', 'a_phpinfo', 'a_server', 'a_backup', 'a_styles', 'a_clearlogs', 'a_modules', 'a_language', 'a_email', 'a_bots', 'a_search', 'a_storage', 'a_aauth', 'a_roles'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 1, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'a_%' AND auth_option NOT IN ('a_switchperm', 'a_jabber', 'a_phpinfo', 'a_server', 'a_backup', 'a_styles', 'a_clearlogs', 'a_modules', 'a_language', 'a_email', 'a_bots', 'a_search', 'a_aauth', 'a_roles'); # Forum admin (a_) INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 2, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'a_%' AND auth_option IN ('a_', 'a_authgroups', 'a_authusers', 'a_fauth', 'a_forum', 'a_forumadd', 'a_forumdel', 'a_mauth', 'a_prune', 'a_uauth', 'a_viewauth', 'a_viewlogs'); diff --git a/phpBB/phpbb/db/migration/data/v330/add_storage_permission.php b/phpBB/phpbb/db/migration/data/v330/add_storage_permission.php index 6cc3e49c89..0836462f03 100644 --- a/phpBB/phpbb/db/migration/data/v330/add_storage_permission.php +++ b/phpBB/phpbb/db/migration/data/v330/add_storage_permission.php @@ -23,7 +23,6 @@ class add_storage_permission extends \phpbb\db\migration\migration // Set permissions array('permission.permission_set', array('ROLE_ADMIN_FULL', 'a_storage')), - array('permission.permission_set', array('ROLE_ADMIN_STANDARD', 'a_storage')), ); } } From c10f1b38ac492463e5ac594757dc9eac535099c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sun, 10 Sep 2017 14:10:56 +0200 Subject: [PATCH 4/4] [ticket/15289] Add migration for storage module PHPBB3-15289 --- .../data/v330/acp_storage_module.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v330/acp_storage_module.php diff --git a/phpBB/phpbb/db/migration/data/v330/acp_storage_module.php b/phpBB/phpbb/db/migration/data/v330/acp_storage_module.php new file mode 100644 index 0000000000..90741e8f97 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v330/acp_storage_module.php @@ -0,0 +1,31 @@ + +* @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\v330; + +class acp_storage_module extends \phpbb\db\migration\migration +{ + public function update_data() + { + return array( + array('module.add', array( + 'acp', + 'ACP_SERVER_CONFIGURATION', + array( + 'module_basename' => 'acp_storage', + 'modes' => array('settings'), + ), + )), + ); + } +}