mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00: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:
parent
8c3f94f9ae
commit
d907d066f2
22 changed files with 440 additions and 133 deletions
|
@ -69,6 +69,8 @@
|
||||||
<input class="button2" type="reset" id="banreset" name="banreset" value="{L_RESET}" />
|
<input class="button2" type="reset" id="banreset" name="banreset" value="{L_RESET}" />
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
<br /><br />
|
||||||
|
|
||||||
<h1>{L_UNBAN_TITLE}</h1>
|
<h1>{L_UNBAN_TITLE}</h1>
|
||||||
|
|
||||||
<p>{L_UNBAN_EXPLAIN}</p>
|
<p>{L_UNBAN_EXPLAIN}</p>
|
||||||
|
|
|
@ -154,11 +154,6 @@ class acm
|
||||||
{
|
{
|
||||||
global $phpEx;
|
global $phpEx;
|
||||||
|
|
||||||
if (!$this->_exists($var_name))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($var_name == 'sql' && !empty($table))
|
if ($var_name == 'sql' && !empty($table))
|
||||||
{
|
{
|
||||||
$regex = '(' . ((is_array($table)) ? implode('|', $table) : $table) . ')';
|
$regex = '(' . ((is_array($table)) ? implode('|', $table) : $table) . ')';
|
||||||
|
@ -166,7 +161,7 @@ class acm
|
||||||
$dir = opendir($this->cache_dir);
|
$dir = opendir($this->cache_dir);
|
||||||
while ($entry = readdir($dir))
|
while ($entry = readdir($dir))
|
||||||
{
|
{
|
||||||
if (substr($entry, 0, 4) != 'sql_')
|
if (strpos($entry, 'sql_') !== 0)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -181,8 +176,16 @@ class acm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@closedir($dir);
|
@closedir($dir);
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if ($var_name{0} == '_')
|
|
||||||
|
if (!$this->_exists($var_name))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($var_name{0} == '_')
|
||||||
{
|
{
|
||||||
@unlink($this->cache_dir . 'data' . $var_name . ".$phpEx");
|
@unlink($this->cache_dir . 'data' . $var_name . ".$phpEx");
|
||||||
}
|
}
|
||||||
|
@ -251,7 +254,7 @@ class acm
|
||||||
|
|
||||||
// Remove extra spaces and tabs
|
// Remove extra spaces and tabs
|
||||||
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
|
||||||
$query_id = 'Cache id #' . sizeof($this->sql_rowset);
|
$query_id = sizeof($this->sql_rowset);
|
||||||
|
|
||||||
if (!file_exists($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"))
|
if (!file_exists($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"))
|
||||||
{
|
{
|
||||||
|
@ -285,7 +288,7 @@ class acm
|
||||||
@flock($fp, LOCK_EX);
|
@flock($fp, LOCK_EX);
|
||||||
|
|
||||||
$lines = array();
|
$lines = array();
|
||||||
$query_id = 'Cache id #' . sizeof($this->sql_rowset);
|
$query_id = sizeof($this->sql_rowset);
|
||||||
$this->sql_rowset[$query_id] = array();
|
$this->sql_rowset[$query_id] = array();
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($query_result))
|
while ($row = $db->sql_fetchrow($query_result))
|
||||||
|
|
|
@ -53,15 +53,6 @@ class acp_ban
|
||||||
trigger_error($user->lang['BAN_UPDATE_SUCESSFUL'] . adm_back_link($this->u_action));
|
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
|
// Define language vars
|
||||||
$this->page_title = $user->lang[strtoupper($mode) . '_BAN'];
|
$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_unban_explain = $user->lang[strtoupper($mode) . '_UNBAN_EXPLAIN'];
|
||||||
$l_no_ban_cell = $user->lang[strtoupper($mode) . '_NO_BANNED'];
|
$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&mode=searchuser&form=acp_ban&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'] . ' -> ');
|
||||||
|
|
||||||
|
$ban_end_options = '';
|
||||||
|
foreach ($ban_end_text as $length => $text)
|
||||||
|
{
|
||||||
|
$ban_end_options .= '<option value="' . $length . '">' . $text . '</option>';
|
||||||
|
}
|
||||||
|
|
||||||
switch ($mode)
|
switch ($mode)
|
||||||
{
|
{
|
||||||
case 'user':
|
case 'user':
|
||||||
|
@ -163,22 +201,9 @@ class acp_ban
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$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_BAN_END_OPTIONS' => $ban_end_options,
|
||||||
'S_BANNED_OPTIONS' => ($banned_options) ? true : false,
|
'S_BANNED_OPTIONS' => ($banned_options) ? true : false,
|
||||||
'BANNED_OPTIONS' => $banned_options,
|
'BANNED_OPTIONS' => $banned_options)
|
||||||
|
|
||||||
'U_ACTION' => $this->u_action,
|
|
||||||
'U_FIND_USER' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=acp_ban&field=ban",
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,8 @@ class acp_forums
|
||||||
}
|
}
|
||||||
|
|
||||||
$auth->acl_clear_prefetch();
|
$auth->acl_clear_prefetch();
|
||||||
|
$cache->destroy('sql', FORUMS_TABLE);
|
||||||
|
|
||||||
recalc_btree('forum_id', FORUMS_TABLE);
|
recalc_btree('forum_id', FORUMS_TABLE);
|
||||||
|
|
||||||
trigger_error($user->lang['FORUM_DELETED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));
|
trigger_error($user->lang['FORUM_DELETED'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id));
|
||||||
|
@ -174,6 +176,8 @@ class acp_forums
|
||||||
}
|
}
|
||||||
|
|
||||||
$auth->acl_clear_prefetch();
|
$auth->acl_clear_prefetch();
|
||||||
|
$cache->destroy('sql', FORUMS_TABLE);
|
||||||
|
|
||||||
recalc_btree('forum_id', FORUMS_TABLE);
|
recalc_btree('forum_id', FORUMS_TABLE);
|
||||||
|
|
||||||
$acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_data['forum_id'];
|
$acl_url = '&mode=setting_forum_local&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);
|
add_log('admin', $log_action, $forum_data['forum_name'], $move_forum_name);
|
||||||
unset($forum_data);
|
unset($forum_data);
|
||||||
|
|
||||||
|
$cache->destroy('sql', FORUMS_TABLE);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'sync':
|
case 'sync':
|
||||||
|
@ -328,6 +334,7 @@ class acp_forums
|
||||||
|
|
||||||
sync('forum', 'forum_id', $forum_id);
|
sync('forum', 'forum_id', $forum_id);
|
||||||
add_log('admin', 'LOG_FORUM_SYNC', $row['forum_name']);
|
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']));
|
$template->assign_var('L_FORUM_RESYNCED', sprintf($user->lang['FORUM_RESYNCED'], $row['forum_name']));
|
||||||
|
|
||||||
|
|
|
@ -303,6 +303,7 @@ class acp_icons
|
||||||
}
|
}
|
||||||
|
|
||||||
$cache->destroy('icons');
|
$cache->destroy('icons');
|
||||||
|
$cache->destroy('sql', $table);
|
||||||
|
|
||||||
if ($action == 'modify')
|
if ($action == 'modify')
|
||||||
{
|
{
|
||||||
|
@ -427,6 +428,8 @@ class acp_icons
|
||||||
}
|
}
|
||||||
|
|
||||||
$cache->destroy('icons');
|
$cache->destroy('icons');
|
||||||
|
$cache->destroy('sql', $table);
|
||||||
|
|
||||||
trigger_error($user->lang[$lang . '_IMPORT_SUCCESS'] . adm_back_link($this->u_action));
|
trigger_error($user->lang[$lang . '_IMPORT_SUCCESS'] . adm_back_link($this->u_action));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -553,6 +556,7 @@ class acp_icons
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
$cache->destroy('icons');
|
$cache->destroy('icons');
|
||||||
|
$cache->destroy('sql', $table);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -755,6 +755,9 @@ class acp_modules
|
||||||
$p_class = str_replace(array('.', '/', '\\'), '', basename($this->module_class));
|
$p_class = str_replace(array('.', '/', '\\'), '', basename($this->module_class));
|
||||||
|
|
||||||
$cache->destroy('_modules_' . $p_class);
|
$cache->destroy('_modules_' . $p_class);
|
||||||
|
|
||||||
|
// Additionally remove sql cache
|
||||||
|
$cache->destroy('sql', MODULES_TABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -209,7 +209,7 @@ class p_master
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check module authorisation
|
* Check module authorisation
|
||||||
* @todo implement $this->is_module_id
|
* @todo Have a look at the eval statement and replace with other code...
|
||||||
*/
|
*/
|
||||||
function module_auth($module_auth)
|
function module_auth($module_auth)
|
||||||
{
|
{
|
||||||
|
@ -291,7 +291,7 @@ class p_master
|
||||||
*/
|
*/
|
||||||
function load_active($mode = false)
|
function load_active($mode = false)
|
||||||
{
|
{
|
||||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID;
|
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $user;
|
||||||
|
|
||||||
$module_path = $phpbb_root_path . 'includes/' . $this->p_class;
|
$module_path = $phpbb_root_path . 'includes/' . $this->p_class;
|
||||||
$icat = request_var('icat', '');
|
$icat = request_var('icat', '');
|
||||||
|
@ -322,7 +322,14 @@ class p_master
|
||||||
$this->module = new $instance($this);
|
$this->module = new $instance($this);
|
||||||
|
|
||||||
// We pre-define the action parameter we are using all over the place
|
// We pre-define the action parameter we are using all over the place
|
||||||
$this->module->u_action = "{$phpbb_admin_path}index.$phpEx$SID" . (($icat) ? '&icat=' . $icat : '') . "&i={$this->p_id}&mode={$this->p_mode}";
|
if (defined('IN_ADMIN'))
|
||||||
|
{
|
||||||
|
$this->module->u_action = "{$phpbb_admin_path}index.$phpEx$SID" . (($icat) ? '&icat=' . $icat : '') . "&i={$this->p_id}&mode={$this->p_mode}";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->module->u_action = "{$phpbb_root_path}{$user->page['page_dir']}{$user->page['page_name']}$SID" . (($icat) ? '&icat=' . $icat : '') . "&i={$this->p_id}&mode={$this->p_mode}";
|
||||||
|
}
|
||||||
|
|
||||||
// Execute the main method for the new instance, we send the module
|
// Execute the main method for the new instance, we send the module
|
||||||
// id and mode as parameters
|
// id and mode as parameters
|
||||||
|
|
|
@ -923,40 +923,7 @@ function validate_email($email)
|
||||||
return 'EMAIL_INVALID';
|
return 'EMAIL_INVALID';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
if ($user->check_ban('', '', $email, true) == true)
|
||||||
* @todo This is a duplication of code from session->check_ban()
|
|
||||||
*/
|
|
||||||
$sql = 'SELECT ban_ip, ban_userid, ban_email, ban_exclude, ban_give_reason, ban_end
|
|
||||||
FROM ' . BANLIST_TABLE . '
|
|
||||||
WHERE ban_end >= ' . time() . '
|
|
||||||
OR ban_end = 0';
|
|
||||||
$result = $db->sql_query($sql);
|
|
||||||
|
|
||||||
$banned = false;
|
|
||||||
if ($row = $db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if (!empty($row['ban_email']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_email']) . '$#i', $email))
|
|
||||||
{
|
|
||||||
if (!empty($row['ban_exclude']))
|
|
||||||
{
|
|
||||||
$banned = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$banned = true;
|
|
||||||
$ban_row = $row;
|
|
||||||
// Don't break. Check if there is an exclude rule for this user
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
while ($row = $db->sql_fetchrow($result));
|
|
||||||
}
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
if ($banned == true)
|
|
||||||
{
|
{
|
||||||
return 'EMAIL_BANNED';
|
return 'EMAIL_BANNED';
|
||||||
}
|
}
|
||||||
|
|
140
phpBB/includes/mcp/mcp_ban.php
Normal file
140
phpBB/includes/mcp/mcp_ban.php
Normal file
|
@ -0,0 +1,140 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @package mcp
|
||||||
|
* @version $Id$
|
||||||
|
* @copyright (c) 2005 phpBB Group
|
||||||
|
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @package mcp
|
||||||
|
*/
|
||||||
|
class mcp_ban
|
||||||
|
{
|
||||||
|
var $u_action;
|
||||||
|
|
||||||
|
function main($id, $mode)
|
||||||
|
{
|
||||||
|
global $config, $db, $user, $auth, $template, $cache;
|
||||||
|
global $SID, $phpbb_root_path, $phpEx;
|
||||||
|
|
||||||
|
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||||
|
|
||||||
|
// Include the admin banning interface...
|
||||||
|
include($phpbb_root_path . 'includes/acp/acp_ban.' . $phpEx);
|
||||||
|
|
||||||
|
$bansubmit = (isset($_POST['bansubmit'])) ? true : false;
|
||||||
|
$unbansubmit= (isset($_POST['unbansubmit'])) ? true : false;
|
||||||
|
$current_time = time();
|
||||||
|
|
||||||
|
$user->add_lang('acp/ban');
|
||||||
|
$this->tpl_name = 'mcp_ban';
|
||||||
|
|
||||||
|
// Ban submitted?
|
||||||
|
if ($bansubmit)
|
||||||
|
{
|
||||||
|
// Grab the list of entries
|
||||||
|
$ban = request_var('ban', '');
|
||||||
|
$ban_len = request_var('banlength', 0);
|
||||||
|
$ban_len_other = request_var('banlengthother', '');
|
||||||
|
$ban_exclude = request_var('banexclude', 0);
|
||||||
|
$ban_reason = request_var('banreason', '');
|
||||||
|
$ban_give_reason = request_var('bangivereason', '');
|
||||||
|
|
||||||
|
user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason);
|
||||||
|
|
||||||
|
trigger_error($user->lang['BAN_UPDATE_SUCESSFUL']);
|
||||||
|
}
|
||||||
|
else if ($unbansubmit)
|
||||||
|
{
|
||||||
|
$ban = request_var('unban', array(''));
|
||||||
|
|
||||||
|
user_unban($mode, $ban);
|
||||||
|
|
||||||
|
trigger_error($user->lang['BAN_UPDATE_SUCESSFUL']);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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'];
|
||||||
|
|
||||||
|
$l_ban_explain = $user->lang[strtoupper($mode) . '_BAN_EXPLAIN'];
|
||||||
|
$l_ban_exclude_explain = $user->lang[strtoupper($mode) . '_BAN_EXCLUDE_EXPLAIN'];
|
||||||
|
$l_unban_title = $user->lang[strtoupper($mode) . '_UNBAN'];
|
||||||
|
$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;
|
||||||
|
}
|
||||||
|
|
||||||
|
acp_ban::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&mode=searchuser&form=mcp_ban&field=ban",
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @package module_install
|
||||||
|
*/
|
||||||
|
class mcp_ban_info
|
||||||
|
{
|
||||||
|
function module()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
'filename' => 'mcp_ban',
|
||||||
|
'title' => 'MCP_BAN',
|
||||||
|
'version' => '1.0.0',
|
||||||
|
'modes' => array(
|
||||||
|
'email' => array('title' => 'MCP_BAN_EMAILS', 'auth' => 'acl_m_ban'),
|
||||||
|
'ip' => array('title' => 'MCP_BAN_IPS', 'auth' => 'acl_m_ban'),
|
||||||
|
'user' => array('title' => 'MCP_BAN_USERNAMES', 'auth' => 'acl_m_ban'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function install()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
function uninstall()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
|
@ -557,7 +557,7 @@ function disapprove_post($post_id_list, $mode)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If the reason is defined within the language file, we will use the localized version, else just use the database entry...
|
// If the reason is defined within the language file, we will use the localized version, else just use the database entry...
|
||||||
$disapprove_reason = ($row['reason_title'] != 'other') ? ((isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])] : $row['reason_description']) : '';
|
$disapprove_reason = ($row['reason_title'] != 'other') ? ((isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])] : $row['reason_description']) : '';
|
||||||
$disapprove_reason .= ($reason) ? "\n\n" . $_REQUEST['reason'] : '';
|
$disapprove_reason .= ($reason) ? "\n\n" . $_REQUEST['reason'] : '';
|
||||||
unset($reason);
|
unset($reason);
|
||||||
}
|
}
|
||||||
|
|
|
@ -643,11 +643,11 @@ class session
|
||||||
* Check for banned user
|
* Check for banned user
|
||||||
*
|
*
|
||||||
* Checks whether the supplied user is banned by id, ip or email. If no parameters
|
* Checks whether the supplied user is banned by id, ip or email. If no parameters
|
||||||
* are passed to the method pre-existing session data is used. This routine does
|
* are passed to the method pre-existing session data is used. If $return is false
|
||||||
* not return on finding a banned user, it outputs a relevant message and stops
|
* this routine does not return on finding a banned user , it outputs a relevant
|
||||||
* execution.
|
* message and stops execution.
|
||||||
*/
|
*/
|
||||||
function check_ban($user_id = false, $user_ip = false, $user_email = false)
|
function check_ban($user_id = false, $user_ip = false, $user_email = false, $return = false)
|
||||||
{
|
{
|
||||||
global $config, $db;
|
global $config, $db;
|
||||||
|
|
||||||
|
@ -684,7 +684,7 @@ class session
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
if ($banned)
|
if ($banned && !$return)
|
||||||
{
|
{
|
||||||
// Initiate environment ... since it won't be set at this stage
|
// Initiate environment ... since it won't be set at this stage
|
||||||
$this->setup();
|
$this->setup();
|
||||||
|
@ -703,6 +703,11 @@ class session
|
||||||
trigger_error($message);
|
trigger_error($message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($banned)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -928,8 +933,7 @@ class user extends session
|
||||||
$this->img_lang = (file_exists($phpbb_root_path . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . $this->lang_name)) ? $this->lang_name : $config['default_lang'];
|
$this->img_lang = (file_exists($phpbb_root_path . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . $this->lang_name)) ? $this->lang_name : $config['default_lang'];
|
||||||
|
|
||||||
// Is board disabled and user not an admin or moderator?
|
// Is board disabled and user not an admin or moderator?
|
||||||
// TODO
|
// @todo new ACL enabling board access while offline?
|
||||||
// New ACL enabling board access while offline?
|
|
||||||
if ($config['board_disable'] && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_'))
|
if ($config['board_disable'] && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_'))
|
||||||
{
|
{
|
||||||
$message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
|
$message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
|
||||||
|
|
|
@ -85,7 +85,7 @@ class ucp_main
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
$topic_tracking_info = get_topic_tracking(0, $topic_list, $rowset, array(0 => false), $topic_list);
|
$topic_tracking_info = get_topic_tracking(0, $topic_list, $rowset, false, $topic_list);
|
||||||
|
|
||||||
foreach ($topic_list as $topic_id)
|
foreach ($topic_list as $topic_id)
|
||||||
{
|
{
|
||||||
|
@ -334,12 +334,15 @@ class ucp_main
|
||||||
ORDER BY t.topic_last_post_time DESC';
|
ORDER BY t.topic_last_post_time DESC';
|
||||||
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
|
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
|
||||||
|
|
||||||
$topic_list = $global_announce_list = $rowset = array();
|
$topic_list = $topic_forum_list = $global_announce_list = $rowset = array();
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$topic_list[] = $row['topic_id'];
|
$topic_list[] = $row['topic_id'];
|
||||||
$rowset[$row['topic_id']] = $row;
|
$rowset[$row['topic_id']] = $row;
|
||||||
|
|
||||||
|
$topic_forum_list[$row['forum_id']]['forum_mark_time'] = ($config['load_db_lastread']) ? $row['forum_mark_time'] : 0;
|
||||||
|
$topic_forum_list[$row['forum_id']]['topics'][] = $row['topic_id'];
|
||||||
|
|
||||||
if ($row['topic_type'] == POST_GLOBAL)
|
if ($row['topic_type'] == POST_GLOBAL)
|
||||||
{
|
{
|
||||||
$global_announce_list[] = $row['topic_id'];
|
$global_announce_list[] = $row['topic_id'];
|
||||||
|
@ -347,10 +350,21 @@ class ucp_main
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
/**
|
$topic_tracking_info = array();
|
||||||
* @todo get_topic_tracking able to fetch from multiple forums
|
if ($config['load_db_lastread'])
|
||||||
*/
|
{
|
||||||
$topic_tracking_info = get_topic_tracking(0, $topic_list, $rowset, array(0 => false), $global_announce_list);
|
foreach ($topic_forum_list as $f_id => $topic_row)
|
||||||
|
{
|
||||||
|
$topic_tracking_info += get_topic_tracking($f_id, $topic_row['topics'], $rowset, array($f_id => $topic_row['forum_mark_time']), ($f_id == 0) ? $global_announce_list : false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach ($topic_forum_list as $f_id => $topic_row)
|
||||||
|
{
|
||||||
|
$topic_tracking_info += get_complete_topic_tracking($f_id, $topic_row['topics'], $global_announce_list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($topic_list as $topic_id)
|
foreach ($topic_list as $topic_id)
|
||||||
{
|
{
|
||||||
|
|
|
@ -255,6 +255,8 @@ INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_mov
|
||||||
INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_split', 1, 1);
|
INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_split', 1, 1);
|
||||||
INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_warn', 1, 1);
|
INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_warn', 1, 1);
|
||||||
|
|
||||||
|
INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_ban', 0, 1);
|
||||||
|
|
||||||
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_', 1);
|
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_', 1);
|
||||||
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_aauth', 1);
|
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_aauth', 1);
|
||||||
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_attach', 1);
|
INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_attach', 1);
|
||||||
|
@ -591,28 +593,34 @@ INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class,
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (199, 1, 'reasons', 'acp', 1, 66, 441, 442, 'ACP_MANAGE_REASONS', 'main', 'acl_a_reasons');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (199, 1, 'reasons', 'acp', 1, 66, 441, 442, 'ACP_MANAGE_REASONS', 'main', 'acl_a_reasons');
|
||||||
|
|
||||||
# MCP
|
# MCP
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (124, 1, 1, '', 'mcp', 0, 37, 46, 'MCP_MAIN', '', '');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (124, 1, '', 'mcp', 1, 0, 57, 66, 'MCP_MAIN', '', '');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (125, 1, 1, '', 'mcp', 0, 47, 52, 'MCP_NOTES', '', '');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (125, 1, '', 'mcp', 1, 0, 67, 72, 'MCP_NOTES', '', '');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (126, 1, 1, '', 'mcp', 0, 53, 62, 'MCP_QUEUE', '', '');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (126, 1, '', 'mcp', 1, 0, 73, 80, 'MCP_QUEUE', '', '');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (127, 1, 1, '', 'mcp', 0, 63, 72, 'MCP_WARN', '', '');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (127, 1, '', 'mcp', 1, 0, 81, 90, 'MCP_WARN', '', '');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (128, 1, 1, 'main', 'mcp', 124, 38, 39, 'MCP_MAIN_FRONT', 'front', 'acl_m_');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (128, 1, 'main', 'mcp', 1, 124, 58, 59, 'MCP_MAIN_FRONT', 'front', 'acl_m_');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (129, 1, 1, 'main', 'mcp', 124, 40, 41, 'MCP_MAIN_FORUM_VIEW', 'forum_view', 'acl_m_,$id');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (129, 1, 'main', 'mcp', 1, 124, 60, 61, 'MCP_MAIN_FORUM_VIEW', 'forum_view', 'acl_m_,$id');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (130, 1, 1, 'main', 'mcp', 124, 42, 43, 'MCP_MAIN_TOPIC_VIEW', 'topic_view', 'acl_m_,$id');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (130, 1, 'main', 'mcp', 1, 124, 62, 63, 'MCP_MAIN_TOPIC_VIEW', 'topic_view', 'acl_m_,$id');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (131, 1, 1, 'main', 'mcp', 124, 44, 45, 'MCP_MAIN_POST_DETAILS', 'post_details', 'acl_m_,$id');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (131, 1, 'main', 'mcp', 1, 124, 64, 65, 'MCP_MAIN_POST_DETAILS', 'post_details', 'acl_m_,$id');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (132, 1, 1, 'notes', 'mcp', 125, 48, 49, 'MCP_NOTES_FRONT', 'front', '');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (132, 1, 'notes', 'mcp', 1, 125, 68, 69, 'MCP_NOTES_FRONT', 'front', '');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (133, 1, 1, 'notes', 'mcp', 125, 50, 51, 'MCP_NOTES_USER', 'user_notes', '');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (133, 1, 'notes', 'mcp', 1, 125, 70, 71, 'MCP_NOTES_USER', 'user_notes', '');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (134, 1, 1, 'queue', 'mcp', 126, 54, 55, 'MCP_QUEUE_UNAPPROVED_TOPICS', 'unapproved_topics', 'acl_m_approve || aclf_m_approve');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (134, 1, 'queue', 'mcp', 1, 126, 74, 75, 'MCP_QUEUE_UNAPPROVED_TOPICS', 'unapproved_topics', 'acl_m_approve');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (135, 1, 1, 'queue', 'mcp', 126, 56, 57, 'MCP_QUEUE_UNAPPROVED_POSTS', 'unapproved_posts', 'acl_m_approve || aclf_m_approve');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (135, 1, 'queue', 'mcp', 1, 126, 76, 77, 'MCP_QUEUE_UNAPPROVED_POSTS', 'unapproved_posts', 'acl_m_approve');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (136, 1, 1, 'queue', 'mcp', 126, 60, 61, 'MCP_QUEUE_REPORTS', 'reports', 'acl_m_approve');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (136, 1, 'queue', 'mcp', 1, 126, 78, 79, 'MCP_QUEUE_REPORTS', 'reports', 'acl_m_approve');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (137, 1, 1, 'warn', 'mcp', 127, 64, 65, 'MCP_WARN_FRONT', 'front', '');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (137, 1, 'warn', 'mcp', 1, 127, 82, 83, 'MCP_WARN_FRONT', 'front', '');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (138, 1, 1, 'warn', 'mcp', 127, 66, 67, 'MCP_WARN_LIST', 'list', '');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (138, 1, 'warn', 'mcp', 1, 127, 84, 85, 'MCP_WARN_LIST', 'list', '');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (139, 1, 1, 'warn', 'mcp', 127, 68, 69, 'MCP_WARN_USER', 'warn_user', '');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (139, 1, 'warn', 'mcp', 1, 127, 86, 87, 'MCP_WARN_USER', 'warn_user', '');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (140, 1, 1, 'warn', 'mcp', 127, 70, 71, 'MCP_WARN_POST', 'warn_post', 'acl_m_,$id');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (140, 1, 'warn', 'mcp', 1, 127, 88, 89, 'MCP_WARN_POST', 'warn_post', 'acl_m_,$id');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (166, 1, 1, 'queue', 'mcp', 126, 58, 59, 'MCP_QUEUE_APPROVE_DETAILS', 'approve_details', 'acl_m_approve || aclf_m_approve');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (192, 1, '', 'mcp', 1, 0, 91, 104, 'Reports', '', '');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (189, 1, 1, '', 'mcp', 0, 81, 88, 'MCP_LOGS', '', '');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (193, 1, 'reports', 'mcp', 1, 192, 92, 93, 'MCP_REPORTS_FRONT', 'front', 'acl_m_');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (190, 1, 1, 'logs', 'mcp', 189, 82, 83, 'MCP_LOGS_FRONT', 'front', '');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (194, 1, 'reports', 'mcp', 1, 192, 94, 95, 'MCP_REPORTS_YOURS', 'reports_yours', 'acl_m_');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (191, 1, 1, 'logs', 'mcp', 189, 84, 85, 'MCP_LOGS_FORUM_VIEW', 'forum_logs', 'acl_m_,$id');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (195, 1, 'reports', 'mcp', 1, 192, 96, 97, 'MCP_REPORTS_NEW', 'reports_new', 'acl_m_');
|
||||||
INSERT INTO phpbb_modules (module_id, module_enabled, module_display, module_name, module_class, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (192, 1, 1, 'logs', 'mcp', 189, 86, 87, 'MCP_LOGS_TOPIC_VIEW', 'topic_logs', 'acl_m_,$id');
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (196, 1, 'reports', 'mcp', 1, 192, 98, 99, 'MCP_REPORTS_TOPICS', 'reports_topics', 'acl_m_');
|
||||||
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (197, 1, 'reports', 'mcp', 1, 192, 100, 101, 'MCP_REPORTS_VIEW_TOPIC', 'reports_view_topic', 'acl_m_');
|
||||||
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (198, 1, 'reports', 'mcp', 1, 192, 102, 103, 'MCP_REPORTS_VIEW', 'reports_view', 'acl_m_');
|
||||||
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (200, 1, '', 'mcp', 1, 0, 105, 112, 'MCP_BAN', '', '');
|
||||||
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (201, 1, 'ban', 'mcp', 1, 200, 106, 107, 'MCP_BAN_EMAILS', 'email', 'acl_m_ban');
|
||||||
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (202, 1, 'ban', 'mcp', 1, 200, 108, 109, 'MCP_BAN_IPS', 'ip', 'acl_m_ban');
|
||||||
|
INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (203, 1, 'ban', 'mcp', 1, 200, 110, 111, 'MCP_BAN_USERNAMES', 'user', 'acl_m_ban');
|
||||||
|
|
||||||
# MSSQL IDENTITY phpbb_modules OFF #
|
# MSSQL IDENTITY phpbb_modules OFF #
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ $lang = array_merge($lang, array(
|
||||||
'IP_BAN' => 'Ban one or more ips',
|
'IP_BAN' => 'Ban one or more ips',
|
||||||
'IP_BAN_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered IP from all current bans.',
|
'IP_BAN_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered IP from all current bans.',
|
||||||
'IP_BAN_EXPLAIN' => 'To specify several different IP\'s or hostnames enter each on a new line. To specify a range of IP addresses separate the start and end with a hyphen (-), to specify a wildcard use *',
|
'IP_BAN_EXPLAIN' => 'To specify several different IP\'s or hostnames enter each on a new line. To specify a range of IP addresses separate the start and end with a hyphen (-), to specify a wildcard use *',
|
||||||
|
'IP_HOSTNAME' => 'IP addresses or hostnames',
|
||||||
'IP_NO_BANNED' => 'No banned IP addresses',
|
'IP_NO_BANNED' => 'No banned IP addresses',
|
||||||
'IP_UNBAN' => 'Un-ban or Un-exclude IPs',
|
'IP_UNBAN' => 'Un-ban or Un-exclude IPs',
|
||||||
'IP_UNBAN_EXPLAIN' => 'You can unban (or un-exclude) multiple IP addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded IP\'s have a grey background.',
|
'IP_UNBAN_EXPLAIN' => 'You can unban (or un-exclude) multiple IP addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded IP\'s have a grey background.',
|
||||||
|
|
|
@ -167,6 +167,7 @@ $lang = array_merge($lang, array(
|
||||||
|
|
||||||
'acl_m_info' => array('lang' => 'Can view post details', 'cat' => 'misc'),
|
'acl_m_info' => array('lang' => 'Can view post details', 'cat' => 'misc'),
|
||||||
'acl_m_warn' => array('lang' => 'Can issue warnings', 'cat' => 'misc'),
|
'acl_m_warn' => array('lang' => 'Can issue warnings', 'cat' => 'misc'),
|
||||||
|
'acl_m_ban' => array('lang' => 'Can manage bans', 'cat' => 'misc'), // This moderator setting is only global (and not local)
|
||||||
));
|
));
|
||||||
|
|
||||||
// Admin Permissions
|
// Admin Permissions
|
||||||
|
|
|
@ -128,6 +128,11 @@ $lang = array_merge($lang, array(
|
||||||
|
|
||||||
'MCP_ADD' => 'Add a warning',
|
'MCP_ADD' => 'Add a warning',
|
||||||
|
|
||||||
|
'MCP_BAN' => 'Banning',
|
||||||
|
'MCP_BAN_EMAILS' => 'Ban Emails',
|
||||||
|
'MCP_BAN_IPS' => 'Ban IPs',
|
||||||
|
'MCP_BAN_USERNAMES' => 'Ban Usernames',
|
||||||
|
|
||||||
'MCP_LOGS' => 'Moderator Logs',
|
'MCP_LOGS' => 'Moderator Logs',
|
||||||
'MCP_LOGS_FRONT' => 'Front Page',
|
'MCP_LOGS_FRONT' => 'Front Page',
|
||||||
'MCP_LOGS_FORUM_VIEW' => 'Forum Logs',
|
'MCP_LOGS_FORUM_VIEW' => 'Forum Logs',
|
||||||
|
|
|
@ -109,6 +109,7 @@ $lang = array_merge($lang, array(
|
||||||
'LOAD_DRAFT' => 'Load Draft',
|
'LOAD_DRAFT' => 'Load Draft',
|
||||||
'LOAD_DRAFT_EXPLAIN' => 'Here you are able to select the draft you want to continue writing. Your current post will be canceled, all current post contents will be deleted. View, edit and delete drafts within your User Control Panel.',
|
'LOAD_DRAFT_EXPLAIN' => 'Here you are able to select the draft you want to continue writing. Your current post will be canceled, all current post contents will be deleted. View, edit and delete drafts within your User Control Panel.',
|
||||||
'LOGIN_EXPLAIN_POST' => 'You need to login in order to post within this forum',
|
'LOGIN_EXPLAIN_POST' => 'You need to login in order to post within this forum',
|
||||||
|
'LOGIN_EXPLAIN_REPLY' => 'You need to login in order to reply to topics within this forum',
|
||||||
|
|
||||||
'MAX_FONT_SIZE_EXCEEDED' => 'You may only use fonts up to size %1$d.',
|
'MAX_FONT_SIZE_EXCEEDED' => 'You may only use fonts up to size %1$d.',
|
||||||
'MAX_IMG_HEIGHT_EXCEEDED' => 'Your images may only be up to %1$d pixels high.',
|
'MAX_IMG_HEIGHT_EXCEEDED' => 'Your images may only be up to %1$d pixels high.',
|
||||||
|
@ -176,6 +177,7 @@ $lang = array_merge($lang, array(
|
||||||
'TOPIC_BUMPED' => 'Topic has been bumped successfully',
|
'TOPIC_BUMPED' => 'Topic has been bumped successfully',
|
||||||
|
|
||||||
'UNAUTHORISED_BBCODE' => 'You cannot use certain bbcodes: ',
|
'UNAUTHORISED_BBCODE' => 'You cannot use certain bbcodes: ',
|
||||||
|
'UNGLOBALISE_EXPLAIN' => 'To switch this topic back from being global to a normal topic, you need to select the forum you whish this topic to be displayed',
|
||||||
'UPDATE_COMMENT' => 'Update comment',
|
'UPDATE_COMMENT' => 'Update comment',
|
||||||
'URL_INVALID' => 'The URL you specified is invalid.',
|
'URL_INVALID' => 'The URL you specified is invalid.',
|
||||||
'USER_CANNOT_BUMP' => 'You cannot bump topics in this forum',
|
'USER_CANNOT_BUMP' => 'You cannot bump topics in this forum',
|
||||||
|
|
|
@ -750,6 +750,8 @@ if ($submit || $preview || $refresh)
|
||||||
|
|
||||||
if (!$to_forum_id)
|
if (!$to_forum_id)
|
||||||
{
|
{
|
||||||
|
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_FORUM_SELECT' => make_forum_select(false, false, false, true, true),
|
'S_FORUM_SELECT' => make_forum_select(false, false, false, true, true),
|
||||||
'S_UNGLOBALISE' => true)
|
'S_UNGLOBALISE' => true)
|
||||||
|
|
108
phpBB/styles/subSilver/template/mcp_ban.html
Normal file
108
phpBB/styles/subSilver/template/mcp_ban.html
Normal file
|
@ -0,0 +1,108 @@
|
||||||
|
<!-- INCLUDE mcp_header.html -->
|
||||||
|
|
||||||
|
<!-- $Id$ -->
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
<!--
|
||||||
|
|
||||||
|
var ban_length = new Array();
|
||||||
|
<!-- BEGIN ban_length -->
|
||||||
|
ban_length['{ban_length.BAN_ID}'] = "{ban_length.LENGTH}";
|
||||||
|
<!-- END ban_length -->
|
||||||
|
|
||||||
|
var ban_reason = new Array();
|
||||||
|
<!-- BEGIN ban_reason -->
|
||||||
|
ban_reason['{ban_reason.BAN_ID}'] = "{ban_reason.REASON}";
|
||||||
|
<!-- END ban_reason -->
|
||||||
|
|
||||||
|
var ban_give_reason = new Array();
|
||||||
|
<!-- BEGIN ban_give_reason -->
|
||||||
|
ban_give_reason['{ban_give_reason.BAN_ID}'] = "{ban_give_reason.REASON}";
|
||||||
|
<!-- END ban_give_reason -->
|
||||||
|
|
||||||
|
function display_details(option)
|
||||||
|
{
|
||||||
|
document.getElementById('mcp_ban').unbangivereason.value = ban_give_reason[option];
|
||||||
|
document.getElementById('mcp_ban').unbanreason.value = ban_reason[option];
|
||||||
|
document.getElementById('mcp_ban').unbanlength.value = ban_length[option];
|
||||||
|
}
|
||||||
|
|
||||||
|
//-->
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<form id="mcp_ban" method="post" action="{U_ACTION}">
|
||||||
|
|
||||||
|
<table width="100%" class="tablebg" cellspacing="1" cellpadding="4" border="0">
|
||||||
|
<tr>
|
||||||
|
<th colspan="2" height="28" nowrap="nowrap">{L_TITLE}</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row3" colspan="2">{L_EXPLAIN}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" width="45%" valign="top"><b>{L_BAN_CELL}:</b></td>
|
||||||
|
<td class="row2">
|
||||||
|
<textarea name="ban" id="ban" cols="40" rows="3" class="post"></textarea>
|
||||||
|
<!-- IF S_USERNAME_BAN --><br />[ <a href="#" onclick="window.open('{U_FIND_USER}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]<!-- ENDIF -->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" valign="top"><b>{L_BAN_LENGTH}:</b></td>
|
||||||
|
<td class="row2"><select name="banlength">{S_BAN_END_OPTIONS}</select><br /><input type="text" name="banlengthother" class="post" /> (YYYY-MM-DD)</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" valign="top"><b>{L_BAN_EXCLUDE}:</b><br /><span class="gensmall">{L_BAN_EXCLUDE_EXPLAIN}</span></td>
|
||||||
|
<td class="row2"><input type="radio" name="banexclude" value="1" /> {L_YES} <input type="radio" name="banexclude" value="0" checked="checked" /> {L_NO}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" valign="top"><b>{L_BAN_REASON}:</b></td>
|
||||||
|
<td class="row2"><input name="banreason" type="text" class="post" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" valign="top"><b>{L_BAN_GIVE_REASON}:</b></td>
|
||||||
|
<td class="row2"><input name="bangivereason" type="text" class="post" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="cat" colspan="2" align="center"><input type="submit" name="bansubmit" value="{L_SUBMIT}" class="btnmain" /> <input type="reset" value="{L_RESET}" class="btnlite" /> </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<br /><br />
|
||||||
|
|
||||||
|
<table width="100%" class="tablebg" cellspacing="1" cellpadding="4" border="0">
|
||||||
|
<tr>
|
||||||
|
<th colspan="2" height="28" nowrap="nowrap">{L_UNBAN_TITLE}</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row3" colspan="2">{L_UNBAN_EXPLAIN}</td>
|
||||||
|
</tr>
|
||||||
|
<!-- IF S_BANNED_OPTIONS -->
|
||||||
|
<tr>
|
||||||
|
<td class="row1" valign="top" width="45%"><b>{L_BAN_CELL}:</b></td>
|
||||||
|
<td class="row2"><select name="unban[]" multiple="multiple" size="10" style="width: 50%" onchange="display_details(this.options[this.selectedIndex].value)">{BANNED_OPTIONS}</select></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" valign="top"><b>{L_BAN_LENGTH}:</b></td>
|
||||||
|
<td class="row2"><input style="border: 0px; width: 100%" type="text" name="unbanlength" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" valign="top"><b>{L_BAN_REASON}:</b></td>
|
||||||
|
<td class="row2"><input style="border: 0px; width: 100%" type="text" name="unbanreason" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="row1" valign="top"><b>{L_BAN_GIVE_REASON}:</b></td>
|
||||||
|
<td class="row2"><input style="border: 0px; width: 100%" type="text" name="unbangivereason" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="cat" colspan="2" align="center"><input type="submit" name="unbansubmit" value="{L_SUBMIT}" class="btnmain" /> <input type="reset" value="{L_RESET}" class="btnlite" /> </td>
|
||||||
|
</tr>
|
||||||
|
<!-- ELSE -->
|
||||||
|
<tr>
|
||||||
|
<td class="row1" colspan="2"><b>{L_NO_BAN_CELL}</b></td>
|
||||||
|
</tr>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<!-- INCLUDE mcp_footer.html -->
|
|
@ -1,6 +1,7 @@
|
||||||
<!-- $Id$ -->
|
|
||||||
<!-- INCLUDE overall_header.html -->
|
<!-- INCLUDE overall_header.html -->
|
||||||
|
|
||||||
|
<!-- $Id$ -->
|
||||||
|
|
||||||
<div id="pagecontent">
|
<div id="pagecontent">
|
||||||
|
|
||||||
<form name="confirm" action="{S_CONFIRM_ACTION}" method="post"><table class="tablebg" width="100%" cellspacing="1">
|
<form name="confirm" action="{S_CONFIRM_ACTION}" method="post"><table class="tablebg" width="100%" cellspacing="1">
|
||||||
|
|
|
@ -848,24 +848,27 @@ while ($row = $db->sql_fetchrow($result))
|
||||||
'sig_bbcode_uid' => '',
|
'sig_bbcode_uid' => '',
|
||||||
'sig_bbcode_bitfield' => '',
|
'sig_bbcode_bitfield' => '',
|
||||||
|
|
||||||
'online' => false,
|
'online' => false,
|
||||||
'avatar' => '',
|
'avatar' => '',
|
||||||
'rank_title' => '',
|
'rank_title' => '',
|
||||||
'rank_image' => '',
|
'rank_image' => '',
|
||||||
'sig' => '',
|
'rank_image_src' => '',
|
||||||
'posts' => '',
|
'sig' => '',
|
||||||
'profile' => '',
|
'posts' => '',
|
||||||
'pm' => '',
|
'profile' => '',
|
||||||
'email' => '',
|
'pm' => '',
|
||||||
'www' => '',
|
'email' => '',
|
||||||
'icq_status_img'=> '',
|
'www' => '',
|
||||||
'icq' => '',
|
'icq_status_img' => '',
|
||||||
'aim' => '',
|
'icq' => '',
|
||||||
'msn' => '',
|
'aim' => '',
|
||||||
'yim' => '',
|
'msn' => '',
|
||||||
'jabber' => '',
|
'yim' => '',
|
||||||
'search' => '',
|
'jabber' => '',
|
||||||
'username' => ($row['user_colour']) ? '<span style="color:#' . $row['user_colour'] . '">' . $poster . '</span>' : $poster
|
'search' => '',
|
||||||
|
'username' => ($row['user_colour']) ? '<span style="color:#' . $row['user_colour'] . '">' . $poster . '</span>' : $poster,
|
||||||
|
|
||||||
|
'warnings' => 0,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1243,14 +1246,14 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
|
||||||
|
|
||||||
//
|
//
|
||||||
$postrow = array(
|
$postrow = array(
|
||||||
'POSTER_NAME' => $row['poster'],
|
'POSTER_NAME' => $row['poster'],
|
||||||
'POSTER_RANK' => $user_cache[$poster_id]['rank_title'],
|
'POSTER_RANK' => $user_cache[$poster_id]['rank_title'],
|
||||||
'RANK_IMAGE' => $user_cache[$poster_id]['rank_image'],
|
'RANK_IMAGE' => $user_cache[$poster_id]['rank_image'],
|
||||||
'RANK_IMAGE_SRC' => $user_cache[$poster_id]['rank_image_src'],
|
'RANK_IMAGE_SRC' => $user_cache[$poster_id]['rank_image_src'],
|
||||||
'POSTER_JOINED' => $user_cache[$poster_id]['joined'],
|
'POSTER_JOINED' => $user_cache[$poster_id]['joined'],
|
||||||
'POSTER_POSTS' => $user_cache[$poster_id]['posts'],
|
'POSTER_POSTS' => $user_cache[$poster_id]['posts'],
|
||||||
'POSTER_FROM' => $user_cache[$poster_id]['from'],
|
'POSTER_FROM' => $user_cache[$poster_id]['from'],
|
||||||
'POSTER_AVATAR' => $user_cache[$poster_id]['avatar'],
|
'POSTER_AVATAR' => $user_cache[$poster_id]['avatar'],
|
||||||
'POSTER_WARNINGS' => $user_cache[$poster_id]['warnings'],
|
'POSTER_WARNINGS' => $user_cache[$poster_id]['warnings'],
|
||||||
|
|
||||||
'POST_DATE' => $user->format_date($row['post_time']),
|
'POST_DATE' => $user->format_date($row['post_time']),
|
||||||
|
|
Loading…
Add table
Reference in a new issue