diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2009-07-14 20:35:53 +0000 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2009-07-14 20:35:53 +0000 |
commit | e3866c939d78b925844cd61d6ad567988f24e42d (patch) | |
tree | 5dc7ead67990b8770adac05a2d9464064e33e617 /phpBB/install | |
parent | 0b2979c6bab97297f839937606635fd4cc6b1eae (diff) | |
download | forums-e3866c939d78b925844cd61d6ad567988f24e42d.tar forums-e3866c939d78b925844cd61d6ad567988f24e42d.tar.gz forums-e3866c939d78b925844cd61d6ad567988f24e42d.tar.bz2 forums-e3866c939d78b925844cd61d6ad567988f24e42d.tar.xz forums-e3866c939d78b925844cd61d6ad567988f24e42d.zip |
Feature Bug #43375 - Ability to delete warnings and keep warnings permanently
Authorised by: AcydBurn
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9758 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 31d7976033..e13bc1d546 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1122,6 +1122,49 @@ function change_database_data(&$no_updates, $version) } } + // Also install the "User Warning" module + $sql = 'SELECT module_id + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_USER_MANAGEMENT' + 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 module or if it is already added. ;) + $sql = 'SELECT * + FROM ' . MODULES_TABLE . " + WHERE module_class = 'acp' + AND module_langname = 'ACP_USER_WARNINGS' + AND module_mode = 'warnings' + AND module_auth = 'acl_a_user' + 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' => 'users', + 'module_enabled' => 1, + 'module_display' => 0, + 'parent_id' => $category_id, + 'module_class' => 'acp', + 'module_langname' => 'ACP_USER_WARNINGS', + 'module_mode' => 'warnings', + 'module_auth' => 'acl_a_user', + ); + + $_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) |