1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-20 07:21:30 +02:00

- adding ability to assign moderator specific ban options

- fixing destroying of sql caches
- fixing referencing of sql cached queries if more than one are active on one page
- other fixes


git-svn-id: file:///svn/phpbb/trunk@5633 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2006-03-15 13:03:57 +00:00
parent 8c3f94f9ae
commit d907d066f2
22 changed files with 440 additions and 133 deletions

View File

@@ -53,15 +53,6 @@ class acp_ban
trigger_error($user->lang['BAN_UPDATE_SUCESSFUL'] . adm_back_link($this->u_action));
}
// Ban length options
$ban_end_text = array(0 => $user->lang['PERMANENT'], 30 => $user->lang['30_MINS'], 60 => $user->lang['1_HOUR'], 360 => $user->lang['6_HOURS'], 1440 => $user->lang['1_DAY'], 10080 => $user->lang['7_DAYS'], 20160 => $user->lang['2_WEEKS'], 40320 => $user->lang['1_MONTH'], -1 => $user->lang['UNTIL'] . ' -> ');
$ban_end_options = '';
foreach ($ban_end_text as $length => $text)
{
$ban_end_options .= '<option value="' . $length . '">' . $text . '</option>';
}
// Define language vars
$this->page_title = $user->lang[strtoupper($mode) . '_BAN'];
@@ -71,6 +62,53 @@ class acp_ban
$l_unban_explain = $user->lang[strtoupper($mode) . '_UNBAN_EXPLAIN'];
$l_no_ban_cell = $user->lang[strtoupper($mode) . '_NO_BANNED'];
switch ($mode)
{
case 'user':
$l_ban_cell = $user->lang['USERNAME'];
break;
case 'ip':
$l_ban_cell = $user->lang['IP_HOSTNAME'];
break;
case 'email':
$l_ban_cell = $user->lang['EMAIL_ADDRESS'];
break;
}
$this->display_ban_options($mode);
$template->assign_vars(array(
'L_TITLE' => $this->page_title,
'L_EXPLAIN' => $l_ban_explain,
'L_UNBAN_TITLE' => $l_unban_title,
'L_UNBAN_EXPLAIN' => $l_unban_explain,
'L_BAN_CELL' => $l_ban_cell,
'L_BAN_EXCLUDE_EXPLAIN' => $l_ban_exclude_explain,
'L_NO_BAN_CELL' => $l_no_ban_cell,
'S_USERNAME_BAN' => ($mode == 'user') ? true : false,
'U_ACTION' => $this->u_action,
'U_FIND_USER' => $phpbb_root_path . "memberlist.$phpEx$SID&amp;mode=searchuser&amp;form=acp_ban&amp;field=ban",
)
);
}
function display_ban_options($mode)
{
global $user, $db, $template;
// Ban length options
$ban_end_text = array(0 => $user->lang['PERMANENT'], 30 => $user->lang['30_MINS'], 60 => $user->lang['1_HOUR'], 360 => $user->lang['6_HOURS'], 1440 => $user->lang['1_DAY'], 10080 => $user->lang['7_DAYS'], 20160 => $user->lang['2_WEEKS'], 40320 => $user->lang['1_MONTH'], -1 => $user->lang['UNTIL'] . ' -&gt; ');
$ban_end_options = '';
foreach ($ban_end_text as $length => $text)
{
$ban_end_options .= '<option value="' . $length . '">' . $text . '</option>';
}
switch ($mode)
{
case 'user':
@@ -163,22 +201,9 @@ class acp_ban
}
$template->assign_vars(array(
'L_TITLE' => $this->page_title,
'L_EXPLAIN' => $l_ban_explain,
'L_UNBAN_TITLE' => $l_unban_title,
'L_UNBAN_EXPLAIN' => $l_unban_explain,
'L_BAN_CELL' => $l_ban_cell,
'L_BAN_EXCLUDE_EXPLAIN' => $l_ban_exclude_explain,
'L_NO_BAN_CELL' => $l_no_ban_cell,
'S_USERNAME_BAN' => ($mode == 'user') ? true : false,
'S_BAN_END_OPTIONS' => $ban_end_options,
'S_BANNED_OPTIONS' => ($banned_options) ? true : false,
'BANNED_OPTIONS' => $banned_options,
'U_ACTION' => $this->u_action,
'U_FIND_USER' => $phpbb_root_path . "memberlist.$phpEx$SID&amp;mode=searchuser&amp;form=acp_ban&amp;field=ban",
)
'BANNED_OPTIONS' => $banned_options)
);
}
}

View File

@@ -75,6 +75,8 @@ class acp_forums
}
$auth->acl_clear_prefetch();
$cache->destroy('sql', FORUMS_TABLE);
recalc_btree('forum_id', FORUMS_TABLE);
trigger_error($user->lang['FORUM_DELETED'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
@@ -174,6 +176,8 @@ class acp_forums
}
$auth->acl_clear_prefetch();
$cache->destroy('sql', FORUMS_TABLE);
recalc_btree('forum_id', FORUMS_TABLE);
$acl_url = '&amp;mode=setting_forum_local&amp;forum_id[]=' . $forum_data['forum_id'];
@@ -306,6 +310,8 @@ class acp_forums
add_log('admin', $log_action, $forum_data['forum_name'], $move_forum_name);
unset($forum_data);
$cache->destroy('sql', FORUMS_TABLE);
break;
case 'sync':
@@ -328,6 +334,7 @@ class acp_forums
sync('forum', 'forum_id', $forum_id);
add_log('admin', 'LOG_FORUM_SYNC', $row['forum_name']);
$cache->destroy('sql', FORUMS_TABLE);
$template->assign_var('L_FORUM_RESYNCED', sprintf($user->lang['FORUM_RESYNCED'], $row['forum_name']));

View File

@@ -303,6 +303,7 @@ class acp_icons
}
$cache->destroy('icons');
$cache->destroy('sql', $table);
if ($action == 'modify')
{
@@ -427,6 +428,8 @@ class acp_icons
}
$cache->destroy('icons');
$cache->destroy('sql', $table);
trigger_error($user->lang[$lang . '_IMPORT_SUCCESS'] . adm_back_link($this->u_action));
}
else
@@ -553,6 +556,7 @@ class acp_icons
$db->sql_query($sql);
$cache->destroy('icons');
$cache->destroy('sql', $table);
break;
}

View File

@@ -755,6 +755,9 @@ class acp_modules
$p_class = str_replace(array('.', '/', '\\'), '', basename($this->module_class));
$cache->destroy('_modules_' . $p_class);
// Additionally remove sql cache
$cache->destroy('sql', MODULES_TABLE);
}
/**