diff options
author | Andreas Fischer <bantu@phpbb.com> | 2009-07-28 22:09:46 +0000 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2009-07-28 22:09:46 +0000 |
commit | 1b8a1f73d77d3df21b8404611a130bb4ee19b822 (patch) | |
tree | 2895a73dde574d975869cf2742c06e474ac2bcdf /phpBB/install | |
parent | b4f3a0eb2d20cd618a1ade5f2d38a90cb9c6d265 (diff) | |
download | forums-1b8a1f73d77d3df21b8404611a130bb4ee19b822.tar forums-1b8a1f73d77d3df21b8404611a130bb4ee19b822.tar.gz forums-1b8a1f73d77d3df21b8404611a130bb4ee19b822.tar.bz2 forums-1b8a1f73d77d3df21b8404611a130bb4ee19b822.tar.xz forums-1b8a1f73d77d3df21b8404611a130bb4ee19b822.zip |
[Feature] Ability to copy permissions from one forum to several other forums.
[Fix] Add log entry when copying forum permissions.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9887 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install')
-rw-r--r-- | phpBB/install/database_update.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index a00d928a12..b2460009f7 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1235,6 +1235,49 @@ function change_database_data(&$no_updates, $version) } $db->sql_freeresult($result); + // Also install the "Copy forum permissions" module + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_FORUM_BASED_PERMISSIONS' + AND module_mode = '' + AND module_basename = ''"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $category_id = (int) $row['module_id']; + + // Check if we actually need to add the feed module or if it is already added. ;) + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_FORUM_PERMISSIONS_COPY' + AND module_mode = 'setting_forum_copy' + AND module_auth = 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth' + AND parent_id = {$category_id}"; + $result2 = $db->sql_query($sql); + $row2 = $db->sql_fetchrow($result2); + $db->sql_freeresult($result2); + + if (!$row2) + { + $module_data = array( + 'module_basename' => 'permissions', + 'module_enabled' => 1, + 'module_display' => 1, + 'parent_id' => $category_id, + 'module_class' => 'acp', + 'module_langname' => 'ACP_FORUM_PERMISSIONS_COPY', + 'module_mode' => 'setting_forum_copy', + 'module_auth' => 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth', + ); + + $_module->update_module_data($module_data, true); + } + } + $db->sql_freeresult($result); + $_module->remove_cache_file(); // Add newly_registered group... but check if it already exists (we always supported running the updater on any schema) |