Moved directory
git-svn-id: file:///svn/phpbb/trunk@3648 89ea8834-ac86-4346-8a33-228a782c2dd0
|
@ -1,578 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* admin_ban.php
|
||||
* -------------------
|
||||
* begin : Tuesday, Jul 31, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
|
||||
if (!empty($setmodules))
|
||||
{
|
||||
if (!$auth->acl_get('a_ban'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$filename = basename(__FILE__);
|
||||
$module['USER']['BAN_USERS'] = $filename . "$SID&mode=user";
|
||||
$module['USER']['BAN_EMAILS'] = $filename . "$SID&mode=email";
|
||||
$module['USER']['BAN_IPS'] = $filename . "$SID&mode=ip";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Load default header
|
||||
$phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
// Do we have ban permissions?
|
||||
if (!$auth->acl_get('a_ban'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
// Mode setting
|
||||
if (isset($_POST['mode']) || isset($_GET['mode']))
|
||||
{
|
||||
$mode = (isset($_POST['mode'])) ? $_POST['mode'] : $_GET['mode'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$mode = '';
|
||||
}
|
||||
|
||||
$current_time = time();
|
||||
|
||||
// Start program
|
||||
if (isset($_POST['bansubmit']) || isset($_GET['bansubmit']))
|
||||
{
|
||||
$ban = (!empty($_POST['ban'])) ? $_POST['ban'] : $_GET['ban'];
|
||||
$ban_list = array_unique(explode("\n", $ban));
|
||||
$ban_list_log = implode(', ', $ban_list);
|
||||
|
||||
$ban_exclude = (!empty($_POST['banexclude'])) ? 1 : 0;
|
||||
$ban_reason = (isset($_POST['banreason'])) ? $_POST['banreason'] : '';
|
||||
|
||||
if (!empty($_POST['banlength']))
|
||||
{
|
||||
if ($_POST['banlength'] != -1 || empty($_POST['banlengthother']))
|
||||
{
|
||||
$ban_end = max($current_time, $current_time + (intval($_POST['banlength']) * 60));
|
||||
}
|
||||
else
|
||||
{
|
||||
$ban_other = explode('-', $_POST['banlengthother']);
|
||||
$ban_end = max($current_time, gmmktime(0, 0, 0, $ban_other[1], $ban_other[2], $ban_other[0]));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$ban_end = 0;
|
||||
}
|
||||
|
||||
$banlist = array();
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
case 'user':
|
||||
$type = 'ban_userid';
|
||||
|
||||
$banlist_tmp = array();
|
||||
for($i = 0; $i < count($ban_list); $i++)
|
||||
{
|
||||
if (trim($ban_list[$i]) != '')
|
||||
{
|
||||
$banlist_tmp[] = '\'' . trim($ban_list[$i]) . '\'';
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "SELECT user_id
|
||||
FROM " . USERS_TABLE . "
|
||||
WHERE username IN (" . implode(', ', $banlist_tmp) . ")";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$banlist[] = $row['user_id'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
unset($banlist_tmp);
|
||||
break;
|
||||
|
||||
case 'ip':
|
||||
$type = 'ban_ip';
|
||||
|
||||
for($i = 0; $i < count($ban_list); $i++)
|
||||
{
|
||||
if (preg_match('/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})[ ]*\-[ ]*([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/', trim($ban_list[$i]), $ip_range_explode))
|
||||
{
|
||||
// Don't ask about all this, just don't ask ... !
|
||||
$ip_1_counter = $ip_range_explode[1];
|
||||
$ip_1_end = $ip_range_explode[5];
|
||||
|
||||
while ($ip_1_counter <= $ip_1_end)
|
||||
{
|
||||
$ip_2_counter = ($ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[2] : 0;
|
||||
$ip_2_end = ($ip_1_counter < $ip_1_end) ? 254 : $ip_range_explode[6];
|
||||
|
||||
if($ip_2_counter == 0 && $ip_2_end == 254)
|
||||
{
|
||||
$ip_2_counter = 256;
|
||||
$ip_2_fragment = 256;
|
||||
|
||||
$banlist[] = "'$ip_1_counter.*'";
|
||||
}
|
||||
|
||||
while ($ip_2_counter <= $ip_2_end)
|
||||
{
|
||||
$ip_3_counter = ($ip_2_counter == $ip_range_explode[2] && $ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[3] : 0;
|
||||
$ip_3_end = ($ip_2_counter < $ip_2_end || $ip_1_counter < $ip_1_end) ? 254 : $ip_range_explode[7];
|
||||
|
||||
if ($ip_3_counter == 0 && $ip_3_end == 254)
|
||||
{
|
||||
$ip_3_counter = 256;
|
||||
$ip_3_fragment = 256;
|
||||
|
||||
$banlist[] = "'$ip_1_counter.$ip_2_counter.*'";
|
||||
}
|
||||
|
||||
while ($ip_3_counter <= $ip_3_end)
|
||||
{
|
||||
$ip_4_counter = ($ip_3_counter == $ip_range_explode[3] && $ip_2_counter == $ip_range_explode[2] && $ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[4] : 0;
|
||||
$ip_4_end = ($ip_3_counter < $ip_3_end || $ip_2_counter < $ip_2_end) ? 254 : $ip_range_explode[8];
|
||||
|
||||
if ($ip_4_counter == 0 && $ip_4_end == 254)
|
||||
{
|
||||
$ip_4_counter = 256;
|
||||
$ip_4_fragment = 256;
|
||||
|
||||
$banlist[] = "'$ip_1_counter.$ip_2_counter.$ip_3_counter.*'";
|
||||
}
|
||||
|
||||
while ($ip_4_counter <= $ip_4_end)
|
||||
{
|
||||
$banlist[] = "'$ip_1_counter.$ip_2_counter.$ip_3_counter.$ip_4_counter'";
|
||||
$ip_4_counter++;
|
||||
}
|
||||
$ip_3_counter++;
|
||||
}
|
||||
$ip_2_counter++;
|
||||
}
|
||||
$ip_1_counter++;
|
||||
}
|
||||
}
|
||||
else if (preg_match('/^([\w\-_]\.?){2,}$/is', trim($ban_list[$i])))
|
||||
{
|
||||
$ip = gethostbynamel(trim($ban_list[$i]));
|
||||
|
||||
for($j = 0; $j < count($ip); $j++)
|
||||
{
|
||||
if (!empty($ip[$j]))
|
||||
{
|
||||
$banlist[] = '\'' . $ip[$j] . '\'';
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (preg_match('/^([0-9]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})$/', trim($ban_list[$i])) || preg_match('/^[a-f0-9:]+\*?$/i', trim($ban_list[$i])))
|
||||
{
|
||||
$banlist[] = '\'' . trim($ban_list[$i]) . '\'';
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'email':
|
||||
$type = 'ban_email';
|
||||
|
||||
for($i = 0; $i < count($ban_list); $i++)
|
||||
{
|
||||
// This ereg match is based on one by php@unreelpro.com
|
||||
// contained in the annotated php manual at php.com (ereg
|
||||
// section)
|
||||
if (eregi('^(([[:alnum:]\*]+([-_.][[:alnum:]\*]+)*\.?)|(\*))@([[:alnum:]]+([-_]?[[:alnum:]]+)*\.){1,3}([[:alnum:]]{2,6})$', trim($ban_list[$i])))
|
||||
{
|
||||
$banlist[] = '\'' . trim($ban_list[$i]) . '\'';
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
$sql = "SELECT $type
|
||||
FROM " . BANLIST_TABLE . "
|
||||
WHERE $type <> ''
|
||||
AND ban_exclude = $ban_exclude";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$banlist_tmp = array();
|
||||
do
|
||||
{
|
||||
switch ($mode)
|
||||
{
|
||||
case 'user':
|
||||
$banlist_tmp[] = $row['ban_userid'];
|
||||
break;
|
||||
|
||||
case 'ip':
|
||||
$banlist_tmp[] = '\'' . $row['ban_ip'] . '\'';
|
||||
break;
|
||||
|
||||
case 'email':
|
||||
$banlist_tmp[] = '\'' . $row['ban_email'] . '\'';
|
||||
break;
|
||||
}
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
$banlist = array_unique(array_diff($banlist, $banlist_tmp));
|
||||
unset($banlist_tmp);
|
||||
}
|
||||
|
||||
if (sizeof($banlist))
|
||||
{
|
||||
for($i = 0; $i < count($banlist); $i++)
|
||||
{
|
||||
$sql = "INSERT INTO " . BANLIST_TABLE . " ($type, ban_start, ban_end, ban_exclude, ban_reason)
|
||||
VALUES (" . $banlist[$i] . ", $current_time, $ban_end, $ban_exclude, '$ban_reason')";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
if (!$ban_exclude)
|
||||
{
|
||||
$sql = '';
|
||||
switch ($mode)
|
||||
{
|
||||
case 'user':
|
||||
$sql = "WHERE session_user_id IN (" . implode(', ', $banlist) . ")";
|
||||
break;
|
||||
|
||||
case 'ip':
|
||||
$sql = "WHERE session_ip IN (" . implode(', ', $banlist) . ")";
|
||||
break;
|
||||
|
||||
case 'email':
|
||||
$sql = "SELECT user_id
|
||||
FROM " . USERS_TABLE . "
|
||||
WHERE user_email IN (" . implode(', ', $banlist) . ")";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$sql = '';
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$sql .= (($sql != '') ? ', ' : '') . $row['user_id'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
$sql = "WHERE session_user_id IN (" . str_replace('*', '%', $sql) . ")";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ($sql != '')
|
||||
{
|
||||
$sql = "DELETE FROM " . SESSIONS_TABLE . "
|
||||
$sql";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
// Update log
|
||||
$log_entry = ($ban_exclude) ? 'LOG_BAN_EXCLUDE_' : 'log_ban_';
|
||||
add_log('admin', $log_entry . $mode, $ban_reason, $ban_list_log);
|
||||
}
|
||||
|
||||
trigger_error($user->lang['BAN_UPDATE_SUCESSFUL']);
|
||||
|
||||
}
|
||||
else if (isset($_POST['unbansubmit']))
|
||||
{
|
||||
$unban_sql = '';
|
||||
for($i = 0; $i < count($_POST['unban']); $i++)
|
||||
{
|
||||
$unban_sql .= (($unban_sql != '') ? ', ' : '') . intval($_POST['unban'][$i]);
|
||||
}
|
||||
|
||||
if ($unban_sql != '')
|
||||
{
|
||||
$sql = "DELETE FROM " . BANLIST_TABLE . "
|
||||
WHERE ban_id IN ($unban_sql)";
|
||||
$db->sql_query($sql);
|
||||
|
||||
add_log('admin', 'log_unban_' . $mode, sizeof($_POST['unban']));
|
||||
}
|
||||
|
||||
trigger_error($user->lang['BAN_UPDATE_SUCESSFUL']);
|
||||
}
|
||||
|
||||
//
|
||||
// Output relevant entry page
|
||||
//
|
||||
|
||||
//
|
||||
// Remove timed out bans
|
||||
//
|
||||
$sql = "DELETE FROM " . BANLIST_TABLE . "
|
||||
WHERE ban_end < " . time() . "
|
||||
AND ban_end <> 0";
|
||||
$db->sql_query($sql);
|
||||
|
||||
//
|
||||
// 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['OTHER'] . ' -> ');
|
||||
|
||||
$ban_end_options = '';
|
||||
foreach ($ban_end_text as $length => $text)
|
||||
{
|
||||
$ban_end_options .= '<option value="' . $length . '">' . $text . '</option>';
|
||||
}
|
||||
|
||||
//
|
||||
// Title
|
||||
//
|
||||
switch ($mode)
|
||||
{
|
||||
case 'user':
|
||||
$l_title = $user->lang['BAN_USERS'];
|
||||
break;
|
||||
case 'email':
|
||||
$l_title = $user->lang['BAN_EMAILS'];
|
||||
break;
|
||||
case 'ip':
|
||||
$l_title = $user->lang['BAN_IPS'];
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
// Output page
|
||||
//
|
||||
page_header($l_title);
|
||||
|
||||
?>
|
||||
|
||||
<p><?php echo $user->lang['BAN_EXPLAIN']; ?></p>
|
||||
|
||||
<?php
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
case 'user':
|
||||
|
||||
$field = 'username';
|
||||
$l_ban_title = $user->lang['BAN_USERS'];
|
||||
$l_ban_explain = $user->lang['BAN_USERNAME_EXPLAIN'];
|
||||
$l_ban_exclude_explain = $user->lang['BAN_USER_EXCLUDE_EXPLAIN'];
|
||||
$l_unban_title = $user->lang['UNBAN_USERNAME'];
|
||||
$l_unban_explain = $user->lang['UNBAN_USERNAME_EXPLAIN'];
|
||||
$l_ban_cell = $user->lang['USERNAME'];
|
||||
$l_no_ban_cell = $user->lang['NO_BANNED_USERS'];
|
||||
$s_submit_extra = '<input type="submit" name="usersubmit" value="' . $user->lang['Find_username'] . '" class="liteoption" onClick="window.open(\'../memberlist.' . $phpEx . $SID . '&mode=searchuser&field=ban\', \'_phpbbsearch\', \'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=740\');return false;" />';
|
||||
|
||||
$sql = "SELECT b.*, u.user_id, u.username
|
||||
FROM " . BANLIST_TABLE . " b, " . USERS_TABLE . " u
|
||||
WHERE (b.ban_end >= " . time() . "
|
||||
OR b.ban_end = 0)
|
||||
AND u.user_id = b.ban_userid
|
||||
AND b.ban_userid <> 0
|
||||
AND u.user_id <> " . ANONYMOUS . "
|
||||
ORDER BY u.user_id ASC";
|
||||
break;
|
||||
|
||||
case 'ip':
|
||||
|
||||
$field = 'ban_ip';
|
||||
$l_ban_title = $user->lang['BAN_IPS'];
|
||||
$l_ban_explain = $user->lang['BAN_IP_EXPLAIN'];
|
||||
$l_ban_exclude_explain = $user->lang['BAN_IP_EXCLUDE_EXPLAIN'];
|
||||
$l_unban_title = $user->lang['UNBAN_IP'];
|
||||
$l_unban_explain = $user->lang['UNBAN_IP_EXPLAIN'];
|
||||
$l_ban_cell = $user->lang['IP_HOSTNAME'];
|
||||
$l_no_ban_cell = $user->lang['NO_BANNED_IP'];
|
||||
$s_submit_extra = '';
|
||||
|
||||
$sql = "SELECT *
|
||||
FROM " . BANLIST_TABLE . "
|
||||
WHERE (ban_end >= " . time() . "
|
||||
OR ban_end = 0)
|
||||
AND ban_ip <> ''";
|
||||
break;
|
||||
|
||||
case 'email':
|
||||
|
||||
$field = 'ban_email';
|
||||
$l_ban_title = $user->lang['BAN_EMAILS'];
|
||||
$l_ban_explain = $user->lang['BAN_EMAIL_EXPLAIN'];
|
||||
$l_ban_exclude_explain = $user->lang['BAN_EMAIL_EXCLUDE_EXPLAIN'];
|
||||
$l_unban_title = $user->lang['UNBAN_EMAIL'];
|
||||
$l_unban_explain = $user->lang['UNBAN_EMAIL_EXPLAIN'];
|
||||
$l_ban_cell = $user->lang['EMAIL_ADDRESS'];
|
||||
$l_no_ban_cell = $user->lang['NO_BANNED_EMAIL'];
|
||||
$s_submit_extra = '';
|
||||
|
||||
$sql = "SELECT *
|
||||
FROM " . BANLIST_TABLE . "
|
||||
WHERE (ban_end >= " . time() . "
|
||||
OR ban_end = 0)
|
||||
AND ban_email <> ''";
|
||||
break;
|
||||
}
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$banned_options = '';
|
||||
$ban_length = $ban_reasons = array();
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
|
||||
$banned_options .= '<option' . (($row['ban_exclude']) ? ' class="sep"' : '') . ' value="' . $row['ban_id'] . '">' . $row[$field] . '</option>';
|
||||
|
||||
$time_length = (!empty($row['ban_end'])) ? ($row['ban_end'] - $row['ban_start']) / 60 : 0;
|
||||
$ban_length[$row['ban_id']] = (!empty($ban_end_text[$time_length])) ? $ban_end_text[$time_length] : $user->lang['OTHER'] . ' -> ' . gmdate('Y-m-d', $row['ban_end']);
|
||||
|
||||
$ban_reasons[$row['ban_id']] = addslashes($row['ban_reason']);
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $l_ban_title; ?></h1>
|
||||
|
||||
<p><?php echo $l_ban_explain; ?></p>
|
||||
|
||||
<script language="Javascript" type="text/javascript">
|
||||
<!--
|
||||
|
||||
var ban_length = new Array();
|
||||
<?php
|
||||
|
||||
if (sizeof($ban_length))
|
||||
{
|
||||
foreach ($ban_length as $ban_id => $length)
|
||||
{
|
||||
echo "ban_length['$ban_id'] = \"$length\";\n";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
var ban_reason = new Array();
|
||||
<?php
|
||||
|
||||
if (sizeof($ban_reasons))
|
||||
{
|
||||
foreach ($ban_reasons as $ban_id => $reason)
|
||||
{
|
||||
echo "ban_reason['$ban_id'] = \"$reason\";\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
function display_details(option)
|
||||
{
|
||||
document.forms[0].unbanreason.value = ban_reason[option];
|
||||
document.forms[0].unbanlength.value = ban_length[option];
|
||||
}
|
||||
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<form method="post" action="<?php echo "admin_ban.$phpEx$SID&mode=$mode"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $l_ban_title; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2" width="45%"><?php echo $l_ban_cell; ?>: </td>
|
||||
<td class="row1"><textarea cols="40" rows="3" name="ban"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2" width="45%"><?php echo $user->lang['BAN_LENGTH']; ?>:</td>
|
||||
<td class="row1"><select name="banlength"><?php echo $ban_end_options; ?></select> <input type="text" name="banlengthother" maxlength="10" size="10" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2" width="45%"><?php echo $user->lang['BAN_EXCLUDE']; ?>: <br /><span class="gensmall"><?php echo $l_ban_exclude_explain;;?></span></td>
|
||||
<td class="row1"><input type="radio" name="banexclude" value="1" /> <?php echo $user->lang['YES']; ?> <input type="radio" name="banexclude" value="0" checked="checked" /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2" width="45%"><?php echo $user->lang['BAN_REASON']; ?>:</td>
|
||||
<td class="row1"><input type="text" name="banreason" maxlength="255" size="40" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"> <input type="submit" name="bansubmit" value="<?php echo $user->lang['SUBMIT']; ?>" class="mainoption" /> <input type="RESET" value="<?php echo $user->lang['RESET']; ?>" class="liteoption" /> <?php echo $s_submit_extra; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h1><?php echo $l_unban_title; ?></h1>
|
||||
|
||||
<p><?php echo $l_unban_explain; ?></p>
|
||||
|
||||
<table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $l_unban_title; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
if ($banned_options != '')
|
||||
{
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row2" width="45%"><?php echo $l_ban_cell; ?>: <br /></td>
|
||||
<td class="row1"> <select name="unban[]" multiple="multiple" size="5" onchange="display_details(this.options[this.selectedIndex].value)"><?php echo $banned_options; ?></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2" width="45%"><?php echo $user->lang['BAN_REASON']; ?>:</td>
|
||||
<td class="row1"><input class="row1" style="border:0px" type="text" name="unbanreason" size="40" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2" width="45%"><?php echo $user->lang['BAN_LENGTH']; ?>:</td>
|
||||
<td class="row1"><input class="row1" style="border:0px" type="text" name="unbanlength" size="40" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><input type="submit" name="unbansubmit" value="<?php echo $user->lang['SUBMIT']; ?>" class="mainoption" /> <input type="RESET" value="<?php echo $user->lang['RESET']; ?>" class="liteoption" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1" colspan="2" align="center"><?php echo $l_no_ban_cell; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
?>
|
|
@ -1,580 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* admin_board.php
|
||||
* -------------------
|
||||
* begin : Thursday, Jul 12, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if (!empty($setmodules))
|
||||
{
|
||||
$file = basename(__FILE__);
|
||||
$module['GENERAL']['COOKIE_SETTINGS'] = ($auth->acl_get('a_cookies')) ? "$file$SID&mode=cookie" : '';
|
||||
$module['GENERAL']['BOARD_DEFAULTS'] = ($auth->acl_get('a_defaults')) ? "$file$SID&mode=default" : '';
|
||||
$module['GENERAL']['BOARD_SETTINGS'] = ($auth->acl_get('a_board')) ? "$file$SID&mode=setting" : '';
|
||||
$module['GENERAL']['AVATAR_SETTINGS'] = ($auth->acl_get('a_board')) ? "$file$SID&mode=avatar" : '';
|
||||
$module['GENERAL']['EMAIL_SETTINGS'] = ($auth->acl_get('a_server')) ? "$file$SID&mode=email" : '';
|
||||
$module['GENERAL']['SERVER_SETTINGS'] = ($auth->acl_get('a_server')) ? "$file$SID&mode=server" : '';
|
||||
$module['GENERAL']['AUTH_SETTINGS'] = ($auth->acl_get('a_server')) ? "$file$SID&mode=auth" : '';
|
||||
return;
|
||||
}
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
// Load default header
|
||||
$phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
// Get mode
|
||||
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : '';
|
||||
|
||||
// Check permissions/set title
|
||||
switch ($mode)
|
||||
{
|
||||
case 'cookie':
|
||||
$l_title = 'COOKIE_SETTINGS';
|
||||
$which_auth = 'a_cookies';
|
||||
break;
|
||||
case 'default':
|
||||
$l_title = 'BOARD_DEFAULTS';
|
||||
$which_auth = 'a_defaults';
|
||||
break;
|
||||
case 'avatar':
|
||||
$l_title = 'AVATAR_SETTINGS';
|
||||
$which_auth = 'a_board';
|
||||
break;
|
||||
case 'setting':
|
||||
$l_title = 'BOARD_SETTINGS';
|
||||
$which_auth = 'a_board';
|
||||
break;
|
||||
case 'email':
|
||||
$l_title = 'EMAIL_SETTINGS';
|
||||
$which_auth = 'a_server';
|
||||
break;
|
||||
case 'server':
|
||||
$l_title = 'SERVER_SETTINGS';
|
||||
$which_auth = 'a_server';
|
||||
break;
|
||||
case 'auth':
|
||||
$l_title = 'AUTH_SETTINGS';
|
||||
$which_auth = 'a_server';
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
// Check permissions
|
||||
if (!$auth->acl_get($which_acl))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
// Pull all config data
|
||||
$sql = "SELECT *
|
||||
FROM " . CONFIG_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$config_name = $row['config_name'];
|
||||
$config_value = $row['config_value'];
|
||||
|
||||
$default_config[$config_name] = $config_value;
|
||||
$new[$config_name] = (isset($_POST[$config_name])) ? $_POST[$config_name] : $default_config[$config_name];
|
||||
|
||||
if (isset($_POST['submit']))
|
||||
{
|
||||
set_config($config_name, stripslashes($new[$config_name]));
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['submit']))
|
||||
{
|
||||
add_log('admin', 'log_' . $mode . '_config');
|
||||
trigger_error($user->lang['Config_updated']);
|
||||
}
|
||||
|
||||
page_header($user->lang[$l_title]);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang[$l_title]; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang[$l_title . '_EXPLAIN']; ?></p>
|
||||
|
||||
<form action="<?php echo "admin_board.$phpEx$SID&mode=$mode"; ?>" method="post"><table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $user->lang[$l_title]; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
//
|
||||
// Output relevant page
|
||||
//
|
||||
switch ($mode)
|
||||
{
|
||||
case 'cookie':
|
||||
|
||||
$cookie_secure_yes = ($new['cookie_secure']) ? 'checked="checked"' : '';
|
||||
$cookie_secure_no = (!$new['cookie_secure']) ? 'checked="checked"' : '';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1" width="50%"><?php echo $user->lang['Cookie_domain']; ?>: </td>
|
||||
<td class="row2"><input type="text" maxlength="255" name="cookie_domain" value="<?php echo $new['cookie_domain']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Cookie_name']; ?>: </td>
|
||||
<td class="row2"><input type="text" maxlength="16" name="cookie_name" value="<?php echo $new['cookie_name']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Cookie_path']; ?>: </td>
|
||||
<td class="row2"><input type="text" maxlength="255" name="cookie_path" value="<?php echo $new['cookie_path']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Cookie_secure']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Cookie_secure_explain']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="cookie_secure" value="0"<?php echo $cookie_secure_no; ?> /><?php echo $user->lang['DISABLED']; ?> <input type="radio" name="cookie_secure" value="1"<?php echo $cookie_secure_yes; ?> /><?php echo $user->lang['ENABLED']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
break;
|
||||
|
||||
case 'avatar':
|
||||
|
||||
$avatars_local_yes = ($new['allow_avatar_local']) ? 'checked="checked"' : '';
|
||||
$avatars_local_no = (!$new['allow_avatar_local']) ? 'checked="checked"' : '';
|
||||
$avatars_remote_yes = ($new['allow_avatar_remote']) ? 'checked="checked"' : '';
|
||||
$avatars_remote_no = (!$new['allow_avatar_remote']) ? 'checked="checked"' : '';
|
||||
$avatars_upload_yes = ($new['allow_avatar_upload']) ? 'checked="checked"' : '';
|
||||
$avatars_upload_no = (!$new['allow_avatar_upload']) ? 'checked="checked"' : '';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1" width="50%"><?php echo $user->lang['Allow_local']; ?>: </td>
|
||||
<td class="row2"><input type="radio" name="allow_avatar_local" value="1"<?php echo $avatars_local_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_avatar_local" value="0"<?php echo $avatars_local_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Allow_remote']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Allow_remote_explain']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="allow_avatar_remote" value="1"<?php echo $avatars_remote_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_avatar_remote" value="0"<?php echo $avatars_remote_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Allow_upload']; ?>: </td>
|
||||
<td class="row2"><input type="radio" name="allow_avatar_upload" value="1"<?php echo $avatars_upload_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_avatar_upload" value="0"<?php echo $avatars_upload_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Max_filesize']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Max_filesize_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" size="4" maxlength="10" name="avatar_filesize" value="<?php echo $new['avatar_filesize']; ?>" /> Bytes</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Max_avatar_size']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Max_avatar_size_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" size="3" maxlength="4" name="avatar_max_height" value="<?php echo $new['avatar_max_height']; ?>" /> x <input type="text" size="3" maxlength="4" name="avatar_max_width" value="<?php echo $new['avatar_max_width']; ?>"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Avatar_storage_path']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Avatar_storage_path_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" size="20" maxlength="255" name="avatar_path" value="<?php echo $new['avatar_path']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Avatar_gallery_path']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Avatar_gallery_path_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" size="20" maxlength="255" name="avatar_gallery_path" value="<?php echo $new['avatar_gallery_path']; ?>" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
break;
|
||||
|
||||
case 'default':
|
||||
|
||||
$style_select = style_select($new['default_style'], 'default_style', '../templates');
|
||||
$lang_select = language_select($new['default_lang'], 'default_lang', '../language');
|
||||
$timezone_select = tz_select($new['board_timezone'], 'board_timezone');
|
||||
|
||||
$override_user_style_yes = ($new['override_user_style']) ? 'checked="checked"' : '';
|
||||
$override_user_style_no = (!$new['override_user_style']) ? 'checked="checked"' : '';
|
||||
|
||||
$topic_notify_yes = ($new['allow_topic_notify']) ? 'checked="checked"' : '';
|
||||
$topic_notify_no = (!$new['allow_topic_notify']) ? 'checked="checked"' : '';
|
||||
|
||||
$forum_notify_yes = ($new['allow_forum_notify']) ? 'checked="checked"' : '';
|
||||
$forum_notify_no = (!$new['allow_forum_notify']) ? 'checked="checked"' : '';
|
||||
|
||||
$html_yes = ($new['allow_html']) ? 'checked="checked"' : '';
|
||||
$html_no = (!$new['allow_html']) ? 'checked="checked"' : '';
|
||||
|
||||
$bbcode_yes = ($new['allow_bbcode']) ? 'checked="checked"' : '';
|
||||
$bbcode_no = (!$new['allow_bbcode']) ? 'checked="checked"' : '';
|
||||
|
||||
$smile_yes = ($new['allow_smilies']) ? 'checked="checked"' : '';
|
||||
$smile_no = (!$new['allow_smilies']) ? 'checked="checked"' : '';
|
||||
|
||||
$sig_yes = ($new['allow_sig']) ? 'checked="checked"' : '';
|
||||
$sig_no = (!$new['allow_sig']) ? 'checked="checked"' : '';
|
||||
|
||||
$namechange_yes = ($new['allow_namechange']) ? 'checked="checked"' : '';
|
||||
$namechange_no = (!$new['allow_namechange']) ? 'checked="checked"' : '';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1" width="50%"><?php echo $user->lang['Default_style']; ?></td>
|
||||
<td class="row2"><?php echo $style_select; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Override_style']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Override_style_explain']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="override_user_style" value="1" <?php echo $override_user_style_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="override_user_style" value="0" <?php echo $override_user_style_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Default_language']; ?>: </td>
|
||||
<td class="row2"><?php echo $lang_select; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Date_format']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Date_format_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" name="default_dateformat" value="<?php echo $new['default_dateformat']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['System_timezone']; ?>: </td>
|
||||
<td class="row2"><?php echo $timezone_select; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Char_limit']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Char_limit_explain']; ?></span</td>
|
||||
<td class="row2"><input type="text" size="4" maxlength="4" name="max_post_chars" value="<?php echo $new['max_post_chars']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Smilies_limit']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Smilies_limit_explain']; ?></span</td>
|
||||
<td class="row2"><input type="text" size="4" maxlength="4" name="max_post_smilies" value="<?php echo $new['max_post_smilies']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Allow_topic_notify']; ?>: </td>
|
||||
<td class="row2"><input type="radio" name="allow_topic_notify" value="1" <?php echo $topic_notify_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_topic_notify" value="0" <?php echo $topic_notify_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Allow_forum_notify']; ?>: </td>
|
||||
<td class="row2"><input type="radio" name="allow_forum_notify" value="1" <?php echo $forum_notify_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_forum_notify" value="0" <?php echo $forum_notify_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Allow_name_change']; ?>: </td>
|
||||
<td class="row2"><input type="radio" name="allow_namechange" value="1" <?php echo $namechange_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_namechange" value="0" <?php echo $namechange_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Allow_HTML']; ?>: </td>
|
||||
<td class="row2"><input type="radio" name="allow_html" value="1" <?php echo $html_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_html" value="0" <?php echo $html_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Allowed_tags']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Allowed_tags_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" size="30" maxlength="255" name="allow_html_tags" value="<?php echo $new['allow_html_tags']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Allow_BBCode']; ?>: </td>
|
||||
<td class="row2"><input type="radio" name="allow_bbcode" value="1" <?php echo $bbcode_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_bbcode" value="0" <?php echo $bbcode_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Allow_smilies']; ?>: </td>
|
||||
<td class="row2"><input type="radio" name="allow_smilies" value="1" <?php echo $smile_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_smilies" value="0" <?php echo $smile_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Allow_sig']; ?>: </td>
|
||||
<td class="row2"><input type="radio" name="allow_sig" value="1" <?php echo $sig_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_sig" value="0" <?php echo $sig_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Max_sig_length']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Max_sig_length_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" size="5" maxlength="4" name="max_sig_chars" value="<?php echo $new['max_sig_chars']; ?>" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
break;
|
||||
|
||||
case 'setting':
|
||||
|
||||
$disable_board_yes = ($new['board_disable']) ? 'checked="checked"' : '';
|
||||
$disable_board_no = (!$new['board_disable']) ? 'checked="checked"' : '';
|
||||
|
||||
$confirm_enabled = ($new['enable_confirm']) ? 'checked="checked"' : '';
|
||||
$confirm_disabled = (!$new['enable_confirm']) ? 'checked="checked"' : '';
|
||||
|
||||
$coppa_enable_yes = ($new['coppa_enable']) ? 'checked="checked"' : '';
|
||||
$coppa_enable_no = (!$new['coppa_enable']) ? 'checked="checked"' : '';
|
||||
|
||||
$activation_none = ($new['require_activation'] == USER_ACTIVATION_NONE) ? 'checked="checked"' : '';
|
||||
$activation_user = ($new['require_activation'] == USER_ACTIVATION_SELF) ? 'checked="checked"' : '';
|
||||
$activation_admin = ($new['require_activation'] == USER_ACTIVATION_ADMIN) ? 'checked="checked"' : '';
|
||||
$activation_disable = ($new['require_activation'] == USER_ACTIVATION_DISABLE) ? 'checked="checked"' : '';
|
||||
|
||||
$privmsg_on = (!$new['privmsg_disable']) ? 'checked="checked"' : '';
|
||||
$privmsg_off = ($new['privmsg_disable']) ? 'checked="checked"' : '';
|
||||
|
||||
$prune_yes = ($new['prune_enable']) ? 'checked="checked"' : '';
|
||||
$prune_no = (!$new['prune_enable']) ? 'checked="checked"' : '';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1" width="50%"><?php echo $user->lang['Site_name']; ?>: </td>
|
||||
<td class="row2"><input type="text" size="40" maxlength="255" name="sitename" value="<?php echo htmlentities($new['sitename']); ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Site_desc']; ?>: </td>
|
||||
<td class="row2"><input type="text" size="40" maxlength="255" name="site_desc" value="<?php echo htmlentities($new['site_desc']); ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Board_disable']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Board_disable_explain']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="board_disable" value="1" <?php echo $disable_board_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="board_disable" value="0" <?php echo $disable_board_no; ?> /> <?php echo $user->lang['NO']; ?><br /><input type="text" name="board_disable_msg" maxlength="255" size="40" value="<?php echo $new['board_disable_msg']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Enable_prune']; ?>: </td>
|
||||
<td class="row2"><input type="radio" name="prune_enable" value="1" <?php echo $prune_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="prune_enable" value="0" <?php echo $prune_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Acct_activation']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Acct_activation_explain']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_NONE; ?>" <?php echo $activation_none; ?> /><?php echo $user->lang['Acc_None']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_SELF; ?>" <?php echo $activation_user; ?> /><?php echo $user->lang['Acc_User']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_ADMIN; ?>" <?php echo $activation_admin; ?> /><?php echo $user->lang['Acc_Admin']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_DISABLE; ?>" <?php echo $activation_disable; ?> /><?php echo $user->lang['Acc_Disable']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['VISUAL_CONFIRM']; ?>: <br /><span class="gensmall"><?php echo $user->lang['VISUAL_CONFIRM_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="enable_confirm" value="1"<?php echo $confirm_enabled ?> /><?php echo $user->lang['YES'] ?> <input type="radio" name="enable_confirm" value="0" <?php echo $confirm_disabled ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Enable_COPPA']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Enable_COPPA_explain']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="coppa_enable" value="1" <?php echo $coppa_enable_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="coppa_enable" value="0" <?php echo $coppa_enable_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['COPPA_fax']; ?>: </td>
|
||||
<td class="row2"><input type="text" size="25" maxlength="100" name="coppa_fax" value="<?php echo $new['coppa_fax']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['COPPA_mail']; ?>: <br /><span class="gensmall"><?php echo $user->lang['COPPA_mail_explain']; ?></span></td>
|
||||
<td class="row2"><textarea name="coppa_mail" rows="5" cols="40"><?php echo $new['coppa_mail']; ?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Private_Messaging']; ?>: </td>
|
||||
<td class="row2"><input type="radio" name="privmsg_disable" value="0" <?php echo $privmsg_on; ?> /><?php echo $user->lang['ENABLED']; ?> <input type="radio" name="privmsg_disable" value="1" <?php echo $privmsg_off; ?> /><?php echo $user->lang['DISABLED']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Boxes_max']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Boxes_max_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" maxlength="4" size="4" name="pm_max_boxes" value="<?php echo $new['pm_max_boxes']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Edit_time']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Edit_time_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" maxlength="3" size="3" name="edit_time" value="<?php echo $new['edit_time']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Flood_Interval']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Flood_Interval_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" size="3" maxlength="4" name="flood_interval" value="<?php echo $new['flood_interval']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Search_Interval']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Search_Interval_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" size="3" maxlength="4" name="search_interval" value="<?php echo $new['search_interval']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Min_search_chars']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Min_search_chars_explain']; ?></span</td>
|
||||
<td class="row2"><input type="text" size="3" maxlength="3" name="min_search_chars" value="<?php echo $new['min_search_chars']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Max_search_chars']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Max_search_chars_explain']; ?></span</td>
|
||||
<td class="row2"><input type="text" size="3" maxlength="3" name="max_search_chars" value="<?php echo $new['max_search_chars']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Topics_per_page']; ?>: </td>
|
||||
<td class="row2"><input type="text" name="topics_per_page" size="3" maxlength="4" value="<?php echo $new['topics_per_page']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Posts_per_page']; ?>: </td>
|
||||
<td class="row2"><input type="text" name="posts_per_page" size="3" maxlength="4" value="<?php echo $new['posts_per_page']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Hot_threshold']; ?>: </td>
|
||||
<td class="row2"><input type="text" name="hot_threshold" size="3" maxlength="4" value="<?php echo $new['hot_threshold']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Max_poll_options']; ?>: </td>
|
||||
<td class="row2"><input type="text" name="max_poll_options" size="4" maxlength="4" value="<?php echo $new['max_poll_options']; ?>" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
break;
|
||||
|
||||
case 'email':
|
||||
|
||||
$email_yes = ($new['email_enable']) ? 'checked="checked"' : '';
|
||||
$email_no = (!$new['email_enable']) ? 'checked="checked"' : '';
|
||||
|
||||
$board_email_form_yes = ($new['board_email_form']) ? 'checked="checked"' : '';
|
||||
$board_email_form_no = (!$new['board_email_form']) ? 'checked="checked"' : '';
|
||||
|
||||
$smtp_yes = ($new['smtp_delivery']) ? 'checked="checked"' : '';
|
||||
$smtp_no = (!$new['smtp_delivery']) ? 'checked="checked"' : '';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Enable_email']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Enable_email_explain']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="email_enable" value="1" <?php echo $email_yes; ?> /> <?php echo $user->lang['ENABLED']; ?> <input type="radio" name="email_enable" value="0" <?php echo $email_no; ?> /> <?php echo $user->lang['DISABLED']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Board_email_form']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Board_email_form_explain']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="board_email_form" value="1" <?php echo $board_email_form_yes; ?> /> <?php echo $user->lang['ENABLED']; ?> <input type="radio" name="board_email_form" value="0" <?php echo $board_email_form_no; ?> /> <?php echo $user->lang['DISABLED']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" width="50%"><?php echo $user->lang['Admin_email']; ?>: </td>
|
||||
<td class="row2"><input type="text" size="25" maxlength="100" name="board_email" value="<?php echo $new['board_email']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Email_sig']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Email_sig_explain']; ?></span></td>
|
||||
<td class="row2"><textarea name="board_email_sig" rows="5" cols="30"><?php echo $new['board_email_sig']; ?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Use_SMTP']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Use_SMTP_explain']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="smtp_delivery" value="1" <?php echo $smtp_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="smtp_delivery" value="0" <?php echo $smtp_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['SMTP_server']; ?>: </td>
|
||||
<td class="row2"><input type="text" name="smtp_host" value="<?php echo $new['smtp_host']; ?>" size="25" maxlength="50" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['SMTP_PORT']; ?>: <br /><span class="gensmall"><?php echo $user->lang['SMTP_PORT_EXPLAIN']; ?></span></td>
|
||||
<td class="row2"><input type="text" name="smtp_port" value="<?php echo $new['smtp_port']; ?>" size="4" maxlength="5" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['SMTP_username']; ?>: <br /><span class="gensmall"><?php echo $user->lang['SMTP_username_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" name="smtp_username" value="<?php echo $new['smtp_username']; ?>" size="25" maxlength="255" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['SMTP_password']; ?>: <br /><span class="gensmall"><?php echo $user->lang['SMTP_password_explain']; ?></span></td>
|
||||
<td class="row2"><input type="password" name="smtp_password" value="<?php echo $new['smtp_password']; ?>" size="25" maxlength="255" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
break;
|
||||
|
||||
case 'server':
|
||||
|
||||
$ip_all = ($new['ip_check'] == 4) ? 'checked="checked"' : '';
|
||||
$ip_classc = ($new['ip_check'] == 3) ? 'checked="checked"' : '';
|
||||
$ip_classb = ($new['ip_check'] == 2) ? 'checked="checked"' : '';
|
||||
$ip_none = ($new['ip_check'] == 0) ? 'checked="checked"' : '';
|
||||
|
||||
$gzip_yes = ($new['gzip_compress']) ? 'checked="checked"' : '';
|
||||
$gzip_no = (!$new['gzip_compress']) ? 'checked="checked"' : '';
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Server_name']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Server_name_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" maxlength="255" size="40" name="server_name" value="<?php echo $new['server_name']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Server_port']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Server_port_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" maxlength="5" size="5" name="server_port" value="<?php echo $new['server_port']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Script_path']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Script_path_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" maxlength="255" name="script_path" value="<?php echo $new['script_path']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['IP_valid']; ?>: <br /><span class="gensmall"><?php echo $user->lang['IP_valid_explain']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="ip_check" value="4" <?php echo $ip_all; ?> /> <?php echo $user->lang['All']; ?> <input type="radio" name="ip_check" value="3" <?php echo $ip_classc; ?> /> <?php echo $user->lang['Class_C']; ?> <input type="radio" name="ip_check" value="2" <?php echo $ip_classb; ?> /> <?php echo $user->lang['Class_B']; ?> <input type="radio" name="ip_check" value="0" <?php echo $ip_none; ?> /> <?php echo $user->lang['NONE']; ?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Limit_load']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Limit_load_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" size="4" maxlength="4" name="limit_load" value="<?php echo $new['limit_load']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Session_length']; ?>: </td>
|
||||
<td class="row2"><input type="text" maxlength="5" size="5" name="session_length" value="<?php echo $new['session_length']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Limit_sessions']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Limit_sessions_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" size="4" maxlength="4" name="active_sessions" value="<?php echo $new['active_sessions']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Enable_gzip']; ?>: </td>
|
||||
<td class="row2"><input type="radio" name="gzip_compress" value="1" <?php echo $gzip_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="gzip_compress" value="0" <?php echo $gzip_no; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Smilies_path']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Smilies_path_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" size="20" maxlength="255" name="smilies_path" value="<?php echo $new['smilies_path']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Icons_path']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Icons_path_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" size="20" maxlength="255" name="icons_path" value="<?php echo $new['icons_path']; ?>" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
break;
|
||||
|
||||
case 'auth':
|
||||
|
||||
$auth_plugins = array();
|
||||
|
||||
$dp = opendir($phpbb_root_path . 'includes/auth');
|
||||
while ($file = readdir($dp))
|
||||
{
|
||||
if (preg_match('#^auth_(.*?)\.' . $phpEx . '$#', $file))
|
||||
{
|
||||
$auth_plugins[] = preg_replace('#^auth_(.*?)\.' . $phpEx . '$#', '\1', $file);
|
||||
}
|
||||
}
|
||||
|
||||
sort($auth_plugins);
|
||||
|
||||
$auth_select = '';
|
||||
foreach ($auth_plugins as $method)
|
||||
{
|
||||
$selected = ($config['auth_method'] == $method) ? ' selected="selected"' : '';
|
||||
$auth_select .= '<option value="' . $method . '"' . $selected . '>' . ucfirst($method) . '</option>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1" width="50%"><?php echo $user->lang['Auth_method']; ?>:</td>
|
||||
<td class="row2"><select name="auth_method"><?php echo $auth_select; ?></select></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
foreach ($auth_plugins as $method)
|
||||
{
|
||||
if ($method && file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
|
||||
|
||||
$method = 'admin_' . $method;
|
||||
if (function_exists($method))
|
||||
{
|
||||
if ($config_fields = $method($new))
|
||||
{
|
||||
//
|
||||
// Check if we need to create config fields for this plugin
|
||||
//
|
||||
foreach($config_fields as $field)
|
||||
{
|
||||
if (!isset($config[$field]))
|
||||
{
|
||||
set_config($field, '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($config_fields);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><input type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" class="mainoption" /> <input type="reset" value="<?php echo $user->lang['RESET']; ?>" class="liteoption" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
?>
|
|
@ -1,165 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* admin_disallow.php
|
||||
* -------------------
|
||||
* begin : Tuesday, Oct 05, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if (!empty($setmodules))
|
||||
{
|
||||
if (!$auth->acl_get('a_names'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$module['USER']['DISALLOW'] = basename(__FILE__) . $SID;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
// Include files
|
||||
$phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
// Check permissions
|
||||
if (!$auth->acl_get('a_names'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
if (isset($_POST['disallow']))
|
||||
{
|
||||
$disallowed_user = (isset($_REQUEST['disallowed_user'])) ? $_REQUEST['disallowed_user'] : '';
|
||||
$disallowed_user = str_replace('*', '%', $disallowed_user);
|
||||
|
||||
if (validate_username($disallowed_user))
|
||||
{
|
||||
$message = $user->lang['Disallowed_already'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "INSERT INTO " . DISALLOW_TABLE . " (disallow_username)
|
||||
VALUES('" . str_replace("\'", "''", $disallowed_user) . "')";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$message = $user->lang['Disallow_successful'];
|
||||
}
|
||||
|
||||
add_log('admin', 'log_disallow_add', str_replace('%', '*', $disallowed_user));
|
||||
|
||||
trigger_error($message);
|
||||
}
|
||||
else if (isset($_POST['allow']))
|
||||
{
|
||||
$disallowed_id = (isset($_REQUEST['disallowed_id'])) ? intval($_REQUEST['disallowed_id']) : '';
|
||||
|
||||
if (empty($disallowed_id))
|
||||
{
|
||||
trigger_error($user->lang['No_user_selected']);
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM " . DISALLOW_TABLE . "
|
||||
WHERE disallow_id = $disallowed_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
add_log('admin', 'log_disallow_delete');
|
||||
|
||||
trigger_error($user->lang['Disallowed_deleted']);
|
||||
}
|
||||
|
||||
// Grab the current list of disallowed usernames...
|
||||
$sql = "SELECT *
|
||||
FROM " . DISALLOW_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$disallow_select = '';
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$disallow_select .= '<option value="' . $row['disallow_id'] . '">' . str_replace('%', '*', $row['disallow_username']) . '</option>';
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
|
||||
// Output page
|
||||
page_header($user->lang['DISALLOW']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['DISALLOW']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['Disallow_explain']; ?></p>
|
||||
|
||||
<form method="post" action="<?php echo "admin_disallow.$phpEx$SID"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $user->lang['Add_disallow_title']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['USERNAME']; ?><br /><span class="gensmall"><?php echo $user->lang['Add_disallow_explain']; ?></span></td>
|
||||
<td class="row2"><input type="text" name="disallowed_user" size="30" /> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><input class="mainoption" type="submit" name="disallow" value="<?php echo $user->lang['SUBMIT']; ?>" /> <input class="liteoption" type="reset" value="<?php echo $user->lang['RESET']; ?>" />
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h1><?php echo $user->lang['Delete_disallow_title']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['Delete_disallow_explain']; ?></p>
|
||||
|
||||
<table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $user->lang['Delete_disallow_title']; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
if ($disallow_select != '')
|
||||
{
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['USERNAME']; ?></td>
|
||||
<td class="row2"><select name="disallowed_id"><?php echo $disallow_select; ?></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><input class="mainoption" type="submit" name="allow" value="<?php echo $user->lang['SUBMIT']; ?>" /> <input class="liteoption" type="reset" value="<?php echo $user->lang['RESET']; ?>" />
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1" colspan="2" align="center"><?php echo $user->lang['No_disallowed']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
?>
|
|
@ -1,186 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* admin_email.php
|
||||
* -------------------
|
||||
* begin : Thu May 31, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if (!empty($setmodules))
|
||||
{
|
||||
if (!$auth->acl_get('a_email'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$module['GENERAL']['MASS_EMAIL'] = basename(__FILE__) . $SID;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
// Include files
|
||||
$phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
// Check permissions
|
||||
if (!$auth->acl_get('a_email'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
//
|
||||
// Set some vars
|
||||
//
|
||||
$message = '';
|
||||
$subject = '';
|
||||
|
||||
//
|
||||
// Do the job ...
|
||||
//
|
||||
if (isset($_POST['submit']))
|
||||
{
|
||||
//
|
||||
// Increase maximum execution time in case of a lot of users, but don't complain about it if it isn't
|
||||
// allowed.
|
||||
//
|
||||
@set_time_limit(1200);
|
||||
|
||||
$group_id = intval($_POST['g']);
|
||||
|
||||
$sql = ($group_id != -1) ? "SELECT u.user_email FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug WHERE ug.group_id = $group_id AND ug.user_pending <> " . TRUE . " AND u.user_id = ug.user_id" : "SELECT user_email FROM " . USERS_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if (!($email_list = $db->sql_fetchrowset($g_result)))
|
||||
{
|
||||
//
|
||||
// Output a relevant GENERAL_MESSAGE about users/group
|
||||
// not existing
|
||||
//
|
||||
}
|
||||
|
||||
$subject = stripslashes($_POST['subject']);
|
||||
$message = stripslashes($_POST['message']);
|
||||
|
||||
//
|
||||
// Error checking needs to go here ... if no subject and/or
|
||||
// no message then skip over the send and return to the form
|
||||
//
|
||||
$error = FALSE;
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
|
||||
//
|
||||
// Let's do some checking to make sure that mass mail functions
|
||||
// are working in win32 versions of php.
|
||||
//
|
||||
if (preg_match('/[c-z]:\\\.*/i', getenv('PATH')) && !$config['smtp_delivery'])
|
||||
{
|
||||
// We are running on windows, force delivery to use
|
||||
// our smtp functions since php's are broken by default
|
||||
$config['smtp_delivery'] = 1;
|
||||
$config['smtp_host'] = get_cfg_var('SMTP');
|
||||
}
|
||||
$emailer = new emailer($config['smtp_delivery']);
|
||||
|
||||
$email_headers = 'From: ' . $config['board_email'] . "\n";
|
||||
|
||||
$bcc_list = '';
|
||||
for($i = 0; $i < count($email_list); $i++)
|
||||
{
|
||||
$bcc_list .= (($bcc_list != '') ? ', ' : '') . $email_list[$i]['user_email'];
|
||||
}
|
||||
$email_headers .= "Bcc: $bcc_list\n";
|
||||
|
||||
$email_headers .= 'Return-Path: ' . $userdata['board_email'] . "\n";
|
||||
$email_headers .= 'X-AntiAbuse: Board servername - ' . $server_name . "\n";
|
||||
$email_headers .= 'X-AntiAbuse: User_id - ' . $userdata['user_id'] . "\n";
|
||||
$email_headers .= 'X-AntiAbuse: Username - ' . $userdata['username'] . "\n";
|
||||
$email_headers .= 'X-AntiAbuse: User IP - ' . $user_ip . "\n";
|
||||
|
||||
$emailer->use_template('admin_send_email');
|
||||
$emailer->email_address($config['board_email']);
|
||||
$emailer->set_subject($subject);
|
||||
$emailer->extra_headers($email_headers);
|
||||
|
||||
$emailer->assign_vars(array(
|
||||
'SITENAME' => $config['sitename'],
|
||||
'BOARD_EMAIL' => $config['board_email'],
|
||||
'MESSAGE' => $message)
|
||||
);
|
||||
|
||||
$emailer->send();
|
||||
$emailer->reset();
|
||||
|
||||
message_die(MESSAGE, $user->lang['Email_sent']);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Initial selection
|
||||
//
|
||||
|
||||
$sql = "SELECT group_id, group_name
|
||||
FROM ".GROUPS_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$select_list = '<select name = "g"><option value = "-1">' . $user->lang['All_users'] . '</option>';
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$select_list .= '<option value = "' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
$select_list .= '</select>';
|
||||
|
||||
page_header($user->lang['Mass_Email']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['Mass_Email']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['Mass_email_explain']; ?></p>
|
||||
|
||||
<form method="post" action="admin_mass_email.<?php echo $phpEx.$SID; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1">
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $user->lang['Compose']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" align="right"><b><?php echo $user->lang['Recipients']; ?></b></td>
|
||||
<td class="row2" align="left"><?php echo $select_list; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" align="right"><b><?php echo $user->lang['Subject']; ?></b></td>
|
||||
<td class="row2"><span class="gen"><input type="text" name="subject" size="45" maxlength="100" tabindex="2" class="post" value="<?php echo $subject; ?>" /></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" align="right" valign="top"><span class="gen"><b><?php echo $user->lang['Message']; ?></b></span>
|
||||
<td class="row2"><textarea class="post" name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3"><?php echo $message; ?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><input type="submit" value="<?php echo $user->lang['Email']; ?>" name="submit" class="mainoption" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
?>
|
|
@ -1,894 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* admin_groups.php
|
||||
* -------------------
|
||||
* begin : Saturday, Feb 13, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if (!empty($setmodules) )
|
||||
{
|
||||
if (!$auth->acl_get('a_group') )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$module['GROUP']['MANAGE'] = basename(__FILE__) . "$SID";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
// Include files
|
||||
$phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
// Do we have general permissions?
|
||||
if (!$auth->acl_get('a_group') )
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
|
||||
// Check and set some common vars
|
||||
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : '';
|
||||
if (isset($_POST['addgroup']))
|
||||
{
|
||||
$action = 'addgroup';
|
||||
}
|
||||
else if (isset($_POST['delete']))
|
||||
{
|
||||
$action = 'delete';
|
||||
}
|
||||
else if (isset($_POST['add']))
|
||||
{
|
||||
$action = 'add';
|
||||
}
|
||||
else
|
||||
{
|
||||
$action = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : '';
|
||||
}
|
||||
$group_id = (isset($_REQUEST['g'])) ? intval($_REQUEST['g']) : '';
|
||||
|
||||
$start = (isset($_GET['start']) && $mode == 'member') ? intval($_GET['start']) : 0;
|
||||
$start_mod = (isset($_GET['start']) && $mode == 'mod') ? intval($_GET['start']) : 0;
|
||||
$start_pend = (isset($_GET['start']) && $mode == 'pend') ? intval($_GET['start']) : 0;
|
||||
|
||||
// Grab basic data for group, if group_id is set since it's used
|
||||
// in several places below
|
||||
if (!empty($group_id))
|
||||
{
|
||||
$sql = "SELECT *
|
||||
FROM " . GROUPS_TABLE . "
|
||||
WHERE group_id = $group_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if (!extract($db->sql_fetchrow($result)))
|
||||
{
|
||||
trigger_error($user->lang['NO_GROUP']);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
// Page header
|
||||
page_header($user->lang['MANAGE']);
|
||||
|
||||
// Which page?
|
||||
switch ($action)
|
||||
{
|
||||
case 'edit':
|
||||
case 'addgroup':
|
||||
|
||||
$error = '';
|
||||
|
||||
// Did we submit?
|
||||
if (isset($_POST['submit']) || isset($_POST['submitprefs']))
|
||||
{
|
||||
if (isset($_POST['submit']))
|
||||
{
|
||||
if ($group_type != GROUP_SPECIAL)
|
||||
{
|
||||
$group_name = (!empty($_POST['group_name'])) ? htmlspecialchars($_POST['group_name']) : '';
|
||||
$group_type = (!empty($_POST['group_type'])) ? intval($_POST['group_type']) : '';
|
||||
}
|
||||
$group_description = (!empty($_POST['group_description'])) ? htmlspecialchars($_POST['group_description']) : '';
|
||||
$group_colour = (!empty($_POST['group_colour'])) ? htmlspecialchars($_POST['group_colour']) : '';
|
||||
$group_rank = (isset($_POST['group_rank'])) ? intval($_POST['group_rank']) : '';
|
||||
$group_avatar = (!empty($_POST['group_avatar'])) ? htmlspecialchars($_POST['group_avatar']) : '';
|
||||
|
||||
// Check data
|
||||
if ($group_name == '' || strlen($group_name) > 40)
|
||||
{
|
||||
$error .= (($error != '') ? '<br />' : '') . (($group_name == '') ? $user->lang['GROUP_ERR_USERNAME'] : $user->lang['GROUP_ERR_USER_LONG']);
|
||||
}
|
||||
if (strlen($group_description) > 255)
|
||||
{
|
||||
$error .= (($error != '') ? '<br />' : '') . $user->lang['GROUP_ERR_DESC_LONG'];
|
||||
}
|
||||
if ($group_type < GROUP_OPEN || $group_type > GROUP_FREE)
|
||||
{
|
||||
$error .= (($error != '') ? '<br />' : '') . $user->lang['GROUP_ERR_TYPE'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$user_lang = (!empty($_POST['user_lang'])) ? htmlspecialchars($_POST['user_lang']) : '';
|
||||
$user_tz = (isset($_POST['user_tz'])) ? doubleval($_POST['user_tz']) : '';
|
||||
$user_dst = (isset($_POST['user_dst'])) ? intval($_POST['user_dst']) : '';
|
||||
}
|
||||
|
||||
// Update DB
|
||||
if (!$error)
|
||||
{
|
||||
// Update group preferences
|
||||
$sql = "UPDATE " . GROUPS_TABLE . "
|
||||
SET group_name = '$group_name', group_description = '$group_description', group_type = $group_type, group_rank = $group_rank, group_colour = '$group_colour'
|
||||
WHERE group_id = $group_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$user_sql = '';
|
||||
$user_sql .= (isset($_POST['submit'])) ? ((($user_sql != '') ? ', ' : '') . "user_colour = '$group_colour'") : '';
|
||||
$user_sql .= (isset($_POST['submit']) && $group_rank != -1) ? ((($user_sql != '') ? ', ' : '') . "user_rank = $group_rank") : '';
|
||||
$user_sql .= (isset($_POST['submitprefs']) && $user_lang != -1) ? ((($user_sql != '') ? ', ' : '') . "user_lang = '$user_lang'") : '';
|
||||
$user_sql .= (isset($_POST['submitprefs']) && $user_tz != -14) ? ((($user_sql != '') ? ', ' : '') . "user_timezone = $user_tz") : '';
|
||||
$user_sql .= (isset($_POST['submitprefs']) && $user_dst != -1) ? ((($user_sql != '') ? ', ' : '') . "user_dst = $user_dst") : '';
|
||||
|
||||
// Update group members preferences
|
||||
switch (SQL_LAYER)
|
||||
{
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
// batchwise? 500 at a time or so maybe? try to reduce memory useage
|
||||
$more = true;
|
||||
$start = 0;
|
||||
do
|
||||
{
|
||||
$sql = "SELECT user_id
|
||||
FROM " . USER_GROUP_TABLE . "
|
||||
WHERE group_id = $group_id
|
||||
LIMIT $start, 500";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$user_count = 0;
|
||||
$user_id_sql = '';
|
||||
do
|
||||
{
|
||||
$user_id_sql .= (($user_id_sql != '') ? ', ' : '') . $row['user_id'];
|
||||
$user_count++;
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
$sql = "UPDATE " . USERS_TABLE . "
|
||||
SET $user_sql
|
||||
WHERE user_id IN ($user_id_sql)";
|
||||
$db->sql_query($sql);
|
||||
|
||||
if ($user_count == 500)
|
||||
{
|
||||
$start += 500;
|
||||
}
|
||||
else
|
||||
{
|
||||
$more = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$more = false;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
unset($user_id_sql);
|
||||
}
|
||||
while ($more);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
$sql = "UPDATE " . USERS_TABLE . "
|
||||
SET $user_sql
|
||||
WHERE user_id IN (
|
||||
SELECT user_id
|
||||
FROM " . USER_GROUP_TABLE . "
|
||||
WHERE group_id = $group_id)";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
trigger_error($user->lang['GROUP_UPDATED']);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['MANAGE'] . ' : <i>' . $group_name . '</i>'; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['GROUP_EDIT_EXPLAIN']; ?></p>
|
||||
|
||||
<?php
|
||||
|
||||
$sql = "SELECT *
|
||||
FROM " . RANKS_TABLE . "
|
||||
WHERE rank_special = 1
|
||||
ORDER BY rank_title";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$rank_options = '<option value="-1"' . ((empty($group_rank)) ? 'selected="selected" ' : '') . '>' . $user->lang['USER_DEFAULT'] . '</option>';
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$selected = (!empty($group_rank) && $row['rank_id'] == $group_rank) ? ' selected="selected"' : '';
|
||||
$rank_options .= '<option value="' . $row['rank_id'] . '"' . $selected . '>' . $row['rank_title'] . '</option>';
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$type_open = ($group_type == GROUP_OPEN) ? ' checked="checked"' : '';
|
||||
$type_closed = ($group_type == GROUP_CLOSED) ? ' checked="checked"' : '';
|
||||
$type_hidden = ($group_type == GROUP_HIDDEN) ? ' checked="checked"' : '';
|
||||
$type_free = ($group_type == GROUP_FREE) ? ' checked="checked"' : '';
|
||||
|
||||
?>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
<!--
|
||||
|
||||
function swatch()
|
||||
{
|
||||
window.open('./swatch.php?form=settings&name=group_colour', '_swatch', 'HEIGHT=115,resizable=yes,scrollbars=no,WIDTH=636');
|
||||
return false;
|
||||
}
|
||||
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<form name="settings" method="post" action="admin_groups.<?php echo "$phpEx$SID&action=$action&g=$group_id"; ?>"><table class="bg" width="90%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $user->lang['GROUP_DETAILS']; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
if ($error != '')
|
||||
{
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1" colspan="2" align="center"><span style="color:red"><?php echo $error; ?></span></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row2"><?php echo $user->lang['GROUP_NAME']; ?>:</td>
|
||||
<td class="row1"><?php
|
||||
|
||||
if ($group_type != GROUP_SPECIAL)
|
||||
{
|
||||
|
||||
?><input type="text" name="group_name" value="<?php echo (!empty($group_name)) ? $group_name : ''; ?>" size="40" maxlength="40" /><?php
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
?><b><?php echo (!empty($user->lang['G_' . $group_name])) ? $user->lang['G_' . $group_name] : $group_name; ?></b><?php
|
||||
|
||||
}
|
||||
|
||||
?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2"><?php echo $user->lang['GROUP_DESC']; ?>:</td>
|
||||
<td class="row1"><input type="text" name="group_description" value="<?php echo (!empty($group_description)) ? $group_description : ''; ?>" size="40" maxlength="255" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
if ($group_type != GROUP_SPECIAL)
|
||||
{
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row2"><?php echo $user->lang['GROUP_TYPE']; ?>:<br /><span class="gensmall"><?php echo $user->lang['GROUP_TYPE_EXPLAIN']; ?></span></td>
|
||||
<td class="row1" nowrap="nowrap"><input type="radio" name="group_type" value="<?php echo GROUP_FREE . '"' . $type_free; ?> /> <?php echo $user->lang['GROUP_OPEN']; ?> <input type="radio" name="group_type" value="<?php echo GROUP_OPEN . '"' . $type_open; ?> /> <?php echo $user->lang['GROUP_REQUEST']; ?> <input type="radio" name="group_type" value="<?php echo GROUP_CLOSED . '"' . $type_closed; ?> /> <?php echo $user->lang['GROUP_CLOSED']; ?> <input type="radio" name="group_type" value="<?php echo GROUP_HIDDEN . '"' . $type_hidden; ?> /> <?php echo $user->lang['GROUP_HIDDEN']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $user->lang['GROUP_SETTINGS_SAVE']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2"><?php echo $user->lang['GROUP_COLOR']; ?>:<br /><span class="gensmall"><?php echo sprintf($user->lang['GROUP_COLOR_EXPLAIN'], '<a href="swatch.html" onclick="swatch();return false" target="_swatch">', '</a>'); ?></span></td>
|
||||
<td class="row1" nowrap="nowrap"><input type="text" name="group_colour" value="<?php echo (!empty($group_colour)) ? $group_colour : ''; ?>" size="6" maxlength="6" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2"><?php echo $user->lang['GROUP_RANK']; ?>:</td>
|
||||
<td class="row1"><select name="group_rank"><?php echo $rank_options; ?></select></td>
|
||||
</tr>
|
||||
<!-- tr>
|
||||
<td class="row2"><?php echo $user->lang['GROUP_AVATAR']; ?>:<br /><span class="gensmall"><?php echo $user->lang['GROUP_AVATAR_EXPLAIN']; ?></span></td>
|
||||
<td class="row1"> </td>
|
||||
</tr -->
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><input class="mainoption" type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" /> <input class="liteoption" type="reset" value="<?php echo $user->lang['RESET']; ?>" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
if ($action != 'addgroup')
|
||||
{
|
||||
|
||||
?>
|
||||
<h1><?php echo $user->lang['GROUP_SETTINGS']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['GROUP_SETTINGS_EXPLAIN']; ?></p>
|
||||
|
||||
<form method="post" action="admin_groups.<?php echo "$phpEx$SID&action=edit&g=$group_id"; ?>"><table class="bg" width="90%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $user->lang['GROUP_SETTINGS']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2"><?php echo $user->lang['GROUP_LANG']; ?>:</td>
|
||||
<td class="row1"><select name="user_lang"><?php echo '<option value="-1" selected="selected">' . $user->lang['USER_DEFAULT'] . '</option>' . language_select(); ?></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2"><?php echo $user->lang['GROUP_TIMEZONE']; ?>:</td>
|
||||
<td class="row1"><select name="user_tz"><?php echo '<option value="-14" selected="selected">' . $user->lang['USER_DEFAULT'] . '</option>' . tz_select(); ?></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2"><?php echo $user->lang['GROUP_DST']; ?>:</td>
|
||||
<td class="row1" nowrap="nowrap"><input type="radio" name="user_dst" value="0" /> <?php echo $user->lang['DISABLED']; ?> <input type="radio" name="user_dst" value="1" /> <?php echo $user->lang['ENABLED']; ?> <input type="radio" name="user_dst" value="-1" checked="checked" /> <?php echo $user->lang['USER_DEFAULT']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><input class="mainoption" type="submit" name="submitprefs" value="<?php echo $user->lang['SUBMIT']; ?>" /> <input class="liteoption" type="reset" value="<?php echo $user->lang['RESET']; ?>" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'deletegroup':
|
||||
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
|
||||
if (empty($_POST['usernames']))
|
||||
{
|
||||
trigger_error($user->lang['NO_USERS']);
|
||||
}
|
||||
$users = explode("\n", $_POST['usernames']);
|
||||
|
||||
$table_sql = ($mode == 'mod' ) ? GROUPS_MODERATOR_TABLE : USER_GROUP_TABLE;
|
||||
|
||||
// Grab the user ids
|
||||
$sql = "SELECT user_id
|
||||
FROM " . USERS_TABLE . "
|
||||
WHERE username IN (" . implode(', ', preg_replace('#^[\s]*?(.*?)[\s]*?$#', "'\\1'", $users)) . ")";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if (!($row = $db->sql_fetchrow($result)))
|
||||
{
|
||||
trigger_error($user->lang['NO_USERS']);
|
||||
}
|
||||
|
||||
$user_id_ary = array();
|
||||
do
|
||||
{
|
||||
$user_id_ary[] = $row['user_id'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Remove users who are already members of this group
|
||||
$sql = "SELECT user_id
|
||||
FROM $table_sql
|
||||
WHERE user_id IN (" . implode(', ', $user_id_ary) . ")
|
||||
AND group_id = $group_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$old_user_id_ary = array();
|
||||
do
|
||||
{
|
||||
$old_user_id_ary[] = $row['user_id'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
$user_id_ary = array_diff($user_id_ary, $old_user_id_ary);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Insert the new users
|
||||
switch (SQL_LAYER)
|
||||
{
|
||||
case 'postgresql':
|
||||
case 'msaccess':
|
||||
case 'mssql-odbc':
|
||||
case 'oracle':
|
||||
case 'db2':
|
||||
foreach ($user_id_ary as $user_id)
|
||||
{
|
||||
$sql = "INSERT INTO $table_sql (user_id, group_id)
|
||||
VALUES ($user_id, $group_id)";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
$sql = "INSERT INTO $table_sql (user_id, group_id)
|
||||
VALUES " . implode(', ', preg_replace('#^([0-9]+)$#', "(\\1, $group_id)", $user_id_ary));
|
||||
$db->sql_query($sql);
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
$sql = "INSERT INTO $table_sql (user_id, group_id)
|
||||
VALUES " . implode(' UNION ALL ', preg_replace('#^([0-9]+)$#', "(\\1, $group_id)", $user_id_ary));
|
||||
$db->sql_query($sql);
|
||||
break;
|
||||
}
|
||||
|
||||
// Update user settings (color, rank) if applicable
|
||||
if (!empty($_POST['settings']))
|
||||
{
|
||||
$sql = "UPDATE " . USERS_TABLE ."
|
||||
SET user_colour = '$group_colour', user_rank = " . intval($group_rank) . "
|
||||
WHERE user_id IN (" . implode(', ', $user_id_ary) . ")";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
// add_log();
|
||||
|
||||
$message = ($mode == 'mod') ? 'GROUP_MODS_ADDED' : 'GROUP_USERS_ADDED';
|
||||
trigger_error($user->lang[$message]);
|
||||
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
break;
|
||||
|
||||
case 'approve':
|
||||
|
||||
break;
|
||||
|
||||
case 'list':
|
||||
|
||||
$sql = "SELECT *
|
||||
FROM " . GROUPS_TABLE . "
|
||||
WHERE group_id = $group_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if (!extract($db->sql_fetchrow($result)))
|
||||
{
|
||||
trigger_error($user->lang['NO_GROUP']);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['GROUP_MEMBERS']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['GROUP_MEMBERS_EXPLAIN']; ?></p>
|
||||
|
||||
<?php
|
||||
|
||||
if ($group_type != GROUP_SPECIAL)
|
||||
{
|
||||
|
||||
?>
|
||||
<h1><?php echo $user->lang['GROUP_MODS']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['GROUP_MODS_EXPLAIN']; ?></p>
|
||||
|
||||
<form name="mod" method="post" action="admin_groups.<?php echo "$phpEx$SID&g=$group_id"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th><?php echo $user->lang['USERNAME']; ?></th>
|
||||
<th><?php echo $user->lang['JOINED']; ?></th>
|
||||
<th><?php echo $user->lang['POSTS']; ?></th>
|
||||
<th width="2%"><?php echo $user->lang['MARK']; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
// Group moderators
|
||||
$sql = "SELECT COUNT(user_id) AS total_members
|
||||
FROM " . GROUPS_MODERATOR_TABLE . "
|
||||
WHERE group_id = $group_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$total_members = $row['total_members'];
|
||||
|
||||
$sql = "SELECT u.user_id, u.username, u.user_regdate, u.user_posts
|
||||
FROM " . USERS_TABLE . " u, " . GROUPS_MODERATOR_TABLE . " gm
|
||||
WHERE gm.group_id = $group_id
|
||||
AND u.user_id = gm.user_id
|
||||
ORDER BY u.username
|
||||
LIMIT $start_mod, " . $config['topics_per_page'];
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result) )
|
||||
{
|
||||
do
|
||||
{
|
||||
|
||||
$row_class = ($row_class == 'row1') ? 'row2' : 'row1';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>"><a href="../ucp.<?php echo "$phpEx$SID&mode=viewprofile&u=" . $row['user_id']; ?>" target="_profile"><?php echo $row['username']; ?></a></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $user->format_date($row['user_regdate'], $user->lang['DATE_FORMAT']); ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $row['user_posts']; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><input type="checkbox" name="mark[<?php echo $row['user_id']; ?>]" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result) );
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row3" colspan="4" align="center"><?php echo $user->lang['GROUPS_NO_MODS']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="cat" colspan="4" align="right"><input type="hidden" name="mode" value="mod" /><input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['DELETE_MARKED']; ?>" /> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="4"><?php echo $user->lang['ADD_USERS']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" colspan="4" align="center"><textarea name="usernames" cols="40" rows="5"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="4" align="center"><input class="mainoption" type="submit" name="add" value="<?php echo $user->lang['SUBMIT']; ?>" /> <input class="liteoption" type="submit" value="<?php echo $user->lang['FIND_USERNAME']; ?>" onclick="window.open('<?php echo "../memberlist.$phpEx$SID"; ?>&mode=searchuser&form=mod&field=usernames', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=740');return false;" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width="80%" cellspacing="1" cellpadding="0" border="0" align="center">
|
||||
<tr>
|
||||
<td valign="top"><?php echo on_page($total_members, $config['topics_per_page'], $start_mod); ?></td>
|
||||
<td align="right"><b><span class="gensmall"><a href="javascript:marklist('mod', true);" class="gensmall"><?php echo $user->lang['MARK_ALL']; ?></a> :: <a href="javascript:marklist('mod', false);" class="gensmall"><?php echo $user->lang['UNMARK_ALL']; ?></a></span></b> <br /><span class="nav"><?php echo generate_pagination("admin_groups.$phpEx$SID&action=list&mode=mod&g=$group_id", $total_members, $config['topics_per_page'], $start); ?></span></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
// Pending users
|
||||
$sql = "SELECT COUNT(user_id) AS total_members
|
||||
FROM " . USER_GROUP_TABLE . "
|
||||
WHERE group_id = $group_id
|
||||
AND user_pending = 1";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$total_members = $row['total_members'];
|
||||
|
||||
$sql = "SELECT u.user_id, u.username, u.user_regdate, u.user_posts
|
||||
FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug
|
||||
WHERE ug.group_id = $group_id
|
||||
AND ug.user_pending = 1
|
||||
AND u.user_id = ug.user_id
|
||||
ORDER BY u.username
|
||||
LIMIT $start_pend, " . $config['topics_per_page'];
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result) )
|
||||
{
|
||||
|
||||
?>
|
||||
<h1><?php echo $user->lang['GROUP_PENDING']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['GROUP_PENDING_EXPLAIN']; ?></p>
|
||||
|
||||
<form name="pend" method="post" action="admin_groups.<?php echo "$phpEx$SID&g=$group_id"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th><?php echo $user->lang['USERNAME']; ?></th>
|
||||
<th><?php echo $user->lang['JOINED']; ?></th>
|
||||
<th><?php echo $user->lang['POSTS']; ?></th>
|
||||
<th width="2%"><?php echo $user->lang['MARK']; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
$row_class = ($row_class == 'row1') ? 'row2' : 'row1';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>"><a href="../ucp.<?php echo "$phpEx$SID&mode=viewprofile&u=" . $row['user_id']; ?>" target="_profile"><?php echo $row['username']; ?></a></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $user->format_date($row['user_regdate'], $user->lang['DATE_FORMAT']); ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $row['user_posts']; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><input type="checkbox" name="mark[<?php echo $row['user_id']; ?>]" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result) );
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="cat" colspan="4" align="right"><input type="hidden" name="mode" value="pend" /><input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['DELETE_MARKED']; ?>" /> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="4"><?php echo $user->lang['ADD_USERS']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" colspan="4" align="center"><textarea name="usernames" cols="40" rows="5"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="4" align="center"><input class="mainoption" type="submit" name="add" value="<?php echo $user->lang['SUBMIT']; ?>" /> <input class="liteoption" type="submit" value="<?php echo $user->lang['FIND_USERNAME']; ?>" onclick="window.open('<?php echo "../memberlist.$phpEx$SID"; ?>&mode=searchuser&form=pend&field=usernames', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=740');return false;" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width="80%" cellspacing="1" cellpadding="0" border="0" align="center">
|
||||
<tr>
|
||||
<td valign="top"><?php echo on_page($total_members, $config['topics_per_page'], $start_mod); ?></td>
|
||||
<td align="right"><b><span class="gensmall"><a href="javascript:marklist('pend', true);" class="gensmall"><?php echo $user->lang['MARK_ALL']; ?></a> :: <a href="javascript:marklist('pend', false);" class="gensmall"><?php echo $user->lang['UNMARK_ALL']; ?></a></span></b> <br /><span class="nav"><?php echo generate_pagination("admin_groups.$phpEx$SID&action=list&mode=pend&g=$group_id", $total_members, $config['topics_per_page'], $start); ?></span></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
// Existing members
|
||||
$sql = "SELECT COUNT(user_id) AS total_members
|
||||
FROM " . USER_GROUP_TABLE . "
|
||||
WHERE group_id = $group_id
|
||||
AND user_pending = 0";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$total_members = $row['total_members'];
|
||||
|
||||
$sql = "SELECT u.user_id, u.username, u.user_regdate, u.user_posts
|
||||
FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug
|
||||
WHERE ug.group_id = $group_id
|
||||
AND ug.user_pending = 0
|
||||
AND u.user_id = ug.user_id
|
||||
ORDER BY u.username
|
||||
LIMIT $start, " . $config['topics_per_page'];
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result) )
|
||||
{
|
||||
|
||||
?>
|
||||
<h1><?php echo $user->lang['GROUP_LIST']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['GROUP_LIST_EXPLAIN']; ?></p>
|
||||
|
||||
<?php
|
||||
|
||||
?>
|
||||
<form name="list" method="post" action="admin_groups.<?php echo "$phpEx$SID&g=$group_id"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th><?php echo $user->lang['USERNAME']; ?></th>
|
||||
<th><?php echo $user->lang['JOINED']; ?></th>
|
||||
<th><?php echo $user->lang['POSTS']; ?></th>
|
||||
<th width="2%"><?php echo $user->lang['MARK']; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
$row_class = ($row_class == 'row1') ? 'row2' : 'row1';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>"><a href="../ucp.<?php echo "$phpEx$SID&mode=viewprofile&u=" . $row['user_id']; ?>" target="_profile"><?php echo $row['username']; ?></a></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $user->format_date($row['user_regdate'], $user->lang['DATE_FORMAT']); ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $row['user_posts']; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><input type="checkbox" name="mark[<?php echo $row['user_id']; ?>]" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="cat" colspan="4" align="right"><input type="hidden" name="mode" value="members" /><input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['DELETE_MARKED']; ?>" /> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="4"><?php echo $user->lang['ADD_USERS']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" colspan="4" align="center"><textarea name="usernames" cols="40" rows="5"></textarea><br /><?php echo $user->lang['USER_GETS_GROUP_SET']; ?> <input type="radio" name="settings" value="1" checked="checked" /> <?php echo $user->lang['YES']; ?> <input type="radio" name="settings" value="0" /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="4" align="center"><input class="mainoption" type="submit" name="add" value="<?php echo $user->lang['SUBMIT']; ?>" /> <input class="liteoption" type="submit" value="<?php echo $user->lang['FIND_USERNAME']; ?>" onclick="window.open('<?php echo "../memberlist.$phpEx$SID"; ?>&mode=searchuser&form=list&field=usernames', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=740');return false;" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width="80%" cellspacing="1" cellpadding="0" border="0" align="center">
|
||||
<tr>
|
||||
<td valign="top"><?php echo on_page($total_members, $config['topics_per_page'], $start); ?></td>
|
||||
<td align="right"><b><span class="gensmall"><a href="javascript:marklist('list', true);" class="gensmall"><?php echo $user->lang['MARK_ALL']; ?></a> :: <a href="javascript:marklist('list', false);" class="gensmall"><?php echo $user->lang['UNMARK_ALL']; ?></a></span></b> <br /><span class="nav"><?php echo generate_pagination("admin_groups.$phpEx$SID&action=list&mode=member&g=$group_id", $total_members, $config['topics_per_page'], $start); ?></span></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
// Default mangement page
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['MANAGE']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['GROUP_MANAGE_EXPLAIN']; ?></p>
|
||||
|
||||
<h1><?php echo $user->lang['USER_DEF_GROUPS']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['USER_DEF_GROUPS_EXPLAIN']; ?></p>
|
||||
|
||||
<form method="post" action="admin_groups.<?php echo "$phpEx$SID"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th width="95%"><?php echo $user->lang['MANAGE']; ?></th>
|
||||
<th><?php echo $user->lang['ACTION']; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
$sql = "SELECT group_id, group_name, group_type
|
||||
FROM " . GROUPS_TABLE . "
|
||||
ORDER BY group_type ASC, group_name";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$special_toggle = false;
|
||||
if ($row = $db->sql_fetchrow($result) )
|
||||
{
|
||||
do
|
||||
{
|
||||
|
||||
if ($row['group_type'] == GROUP_SPECIAL && !$special_toggle)
|
||||
{
|
||||
$special_toggle = true;
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><input class="mainoption" type="submit" name="addgroup" value="<?php echo $user->lang['ADD_NEW_GROUP']; ?>" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h1><?php echo $user->lang['SPECIAL_GROUPS']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['SPECIAL_GROUPS_EXPLAIN']; ?></p>
|
||||
|
||||
<table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th width="95%"><?php echo $user->lang['MANAGE']; ?></th>
|
||||
<th><?php echo $user->lang['ACTION']; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
$row_class = ($row_class != 'row1') ? 'row1' : 'row2';
|
||||
|
||||
$group_id = $row['group_id'];
|
||||
$group_name = (!empty($user->lang['G_' . $row['group_name']]))? $user->lang['G_' . $row['group_name']] : $row['group_name'];
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>"><a href="admin_groups.<?php echo "$phpEx$SID&action=list&g=$group_id"; ?>"><?php echo $group_name;?></a></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center" nowrap="nowrap"> <a href="admin_groups.<?php echo "$phpEx$SID&action=add&g=$group_id"; ?>"><?php echo $user->lang['ADD']; ?></a> | <a href="admin_groups.<?php echo "$phpEx$SID&action=edit&g=$group_id"; ?>"><?php echo $user->lang['EDIT']; ?></a><?php
|
||||
|
||||
if (!$special_toggle)
|
||||
{
|
||||
|
||||
?> | <a href="admin_groups.<?php echo "$phpEx$SID&action=delete&g=$group_id"; ?>"><?php echo $user->lang['DELETE']; ?></a><?php
|
||||
|
||||
}
|
||||
|
||||
?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
if (is_array($pending[$group_id]) )
|
||||
{
|
||||
foreach ($pending[$group_id] as $pending_ary )
|
||||
{
|
||||
$row_class = ($row_class != 'row1') ? 'row1' : 'row2';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>"><?php echo $pending_ary['username'];?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><input class="liteoption" type="submit" name="approve[<?php echo $pending_ary['user_id']; ?>]" value="<?php echo $user->lang['Approve_selected'];?>" /> <input class="liteoption" type="submit" name="decline[<?php echo $pending_ary['user_id']; ?>]" value="<?php echo $user->lang['Deny_selected'];?>" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result) );
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="cat" colspan="2"> </td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script language="Javascript" type="text/javascript">
|
||||
<!--
|
||||
function marklist(match, status)
|
||||
{
|
||||
len = eval('document.' + match + '.length');
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
eval('document.' + match + '.elements[i].checked = ' + status);
|
||||
}
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
?>
|
|
@ -1,757 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* admin_icons.php
|
||||
* -------------------
|
||||
* begin : Thu May 31, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if (!empty($setmodules))
|
||||
{
|
||||
if (!$auth->acl_get('a_icons'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$filename = basename(__FILE__);
|
||||
$module['POST']['SMILE'] = $filename . $SID . '&mode=emoticons';
|
||||
$module['POST']['ICONS'] = $filename . $SID . '&mode=icons';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
// Include files
|
||||
$phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
// Do we have general permissions?
|
||||
if (!$auth->acl_get('a_icons'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
// Grab some basic parameters
|
||||
$mode = (!empty($_REQUEST['mode'])) ? $_REQUEST['mode'] : '';
|
||||
$action = (!empty($_REQUEST['action'])) ? $_REQUEST['action'] : ((isset($_POST['add'])) ? 'add' : '');
|
||||
$id = (isset($_GET['id'])) ? intval($_GET['id']) : false;
|
||||
|
||||
// What are we working on?
|
||||
switch ($mode)
|
||||
{
|
||||
case 'emoticons':
|
||||
$table = SMILIES_TABLE;
|
||||
$lang = 'SMILE';
|
||||
$fields = 'smile';
|
||||
$img_path = $config['smilies_path'];
|
||||
break;
|
||||
|
||||
case 'icons':
|
||||
$table = ICONS_TABLE;
|
||||
$lang = 'ICONS';
|
||||
$fields = 'icons';
|
||||
$img_path = $config['icons_path'];
|
||||
break;
|
||||
}
|
||||
|
||||
// Clear some arrays
|
||||
$_images = $_paks = array();
|
||||
|
||||
|
||||
|
||||
// Grab file list of paks and images
|
||||
if ($action == 'edit' || $action == 'add' || $action == 'import')
|
||||
{
|
||||
$dir = @opendir($phpbb_root_path . $img_path);
|
||||
while ($file = @readdir($dir))
|
||||
{
|
||||
if (is_file($phpbb_root_path . $img_path . '/' . $file))
|
||||
{
|
||||
$img_size = @getimagesize($phpbb_root_path . $img_path . '/' . $file);
|
||||
|
||||
if (preg_match('#\.(gif|png|jpg)$#i', $file) || (!empty($img_size[0]) && !empty($img_size[1])))
|
||||
{
|
||||
$_images[] = $file;
|
||||
}
|
||||
elseif (preg_match('#\.pak$#i', $file))
|
||||
{
|
||||
$_paks[] = $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
@closedir($dir);
|
||||
}
|
||||
|
||||
|
||||
// What shall we do today? Oops, I believe that's trademarked ...
|
||||
switch ($action)
|
||||
{
|
||||
case 'delete':
|
||||
|
||||
$db->sql_query('DELETE FROM ' . $table . '
|
||||
WHERE ' . $fields . '_id = ' . intval($_GET['id']));
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
case 'emoticons':
|
||||
break;
|
||||
|
||||
case 'icons':
|
||||
// Reset appropriate icon_ids
|
||||
$db->sql_query('UPDATE ' . TOPICS_TABLE . '
|
||||
SET icon_id = 0
|
||||
WHERE icon_id = ' . intval($_GET['id']));
|
||||
$db->sql_query('UPDATE ' . POSTS_TABLE . '
|
||||
SET icon_id = 0
|
||||
WHERE icon_id = ' . intval($_GET['id']));
|
||||
break;
|
||||
}
|
||||
|
||||
trigger_error($user->lang[$lang . '_DELETED']);
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
case 'add':
|
||||
|
||||
$order_list = '';
|
||||
$existing_imgs = array();
|
||||
$result = $db->sql_query('SELECT *
|
||||
FROM ' . $table . '
|
||||
ORDER BY ' . $fields . '_order DESC');
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$existing_imgs[] = $row[$fields . '_url'];
|
||||
|
||||
if ($row[$fields . '_id'] == $id)
|
||||
{
|
||||
$after = TRUE;
|
||||
$data = $row;
|
||||
}
|
||||
else
|
||||
{
|
||||
$selected = '';
|
||||
if (!empty($after))
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
$after = FALSE;
|
||||
}
|
||||
|
||||
$after_txt = ($mode == 'emoticons') ? $row['code'] : $row['icons_url'];
|
||||
$order_list = '<option value="' . ($row[$fields . '_order']) . '"' . $selected . '>' . sprintf($user->lang['AFTER_' . $lang], ' -> ' . htmlspecialchars($after_txt)) . '</option>' . $order_list;
|
||||
}
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$order_list = '<option value="1"' . ((!isset($after)) ? ' selected="selected"' : '') . '>' . $user->lang['FIRST'] . '</option>' . $order_list;
|
||||
|
||||
$imglist = filelist($phpbb_root_path . $img_path, '');
|
||||
|
||||
$filename_list = '';
|
||||
foreach ($imglist as $img)
|
||||
{
|
||||
$img = substr($img['path'], 1) . (($img['path'] != '') ? '/' : '') . $img['file'];
|
||||
|
||||
if (!in_array($img, $existing_imgs) || $action == 'edit')
|
||||
{
|
||||
if ((isset($data) && $img == $data[$fields . '_url']) ||
|
||||
(!isset($data) && !isset($edit_img)))
|
||||
{
|
||||
$selected = ' selected="selected"';
|
||||
$edit_img = $img;
|
||||
}
|
||||
else
|
||||
{
|
||||
$selected = '';
|
||||
}
|
||||
|
||||
$filename_list .= '<option value="' . $img . '"' . htmlspecialchars($img) . $selected . '>' . $img . '</option>';
|
||||
}
|
||||
}
|
||||
unset($existing_imgs);
|
||||
unset($imglist);
|
||||
|
||||
page_header($user->lang[$lang]);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang[$lang]; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang[$lang .'_EXPLAIN']; ?></p>
|
||||
|
||||
<script language="javascript" type="text/javascript" defer="defer">
|
||||
<!--
|
||||
|
||||
function update_image(newimage)
|
||||
{
|
||||
document.image.src = "<?php echo $phpbb_root_path . $img_path ?>/" + newimage;
|
||||
}
|
||||
|
||||
function update_image_dimensions()
|
||||
{
|
||||
if (document.image.height)
|
||||
{
|
||||
document.forms[0].height.value = document.image.height;
|
||||
document.forms[0].width.value = document.image.width;
|
||||
}
|
||||
}
|
||||
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<form method="post" action="admin_icons.<?php echo $phpEx . $SID . "&mode=$mode&action=" . (($action == 'add') ? 'create' : 'modify'); ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th class="th" colspan="2"><?php echo $user->lang[$lang . '_CONFIG'] ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang[$lang . '_URL'] ?></td>
|
||||
<td class="row1"><select name="img" onChange="update_image(this.options[selectedIndex].value);"><?php echo $filename_list ?></select> <img src="<?php echo $phpbb_root_path . $img_path . '/' . $edit_img ?>" name="image" border="0" alt="" title="" onload="update_image_dimensions()" /> </td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
if ($mode == 'emoticons')
|
||||
{
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row2"><?php echo $user->lang[$lang . '_CODE'] ?></td>
|
||||
<td class="row2"><input type="text" name="code" value="<?php echo (!empty($data['code'])) ? $data['code'] : '' ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2"><?php echo $user->lang[$lang . '_EMOTION'] ?></td>
|
||||
<td class="row2"><input type="text" name="emotion" value="<?php echo (!empty($data['emoticon'])) ? $data['emoticon'] : '' ?>" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang[$lang . '_WIDTH'] ?></td>
|
||||
<td class="row1"><input type="text" size="3" name="width" value="<?php echo (!empty($data[$fields .'_width'])) ? $data[$fields .'_width'] : '' ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2"><?php echo $user->lang[$lang . '_HEIGHT'] ?></td>
|
||||
<td class="row2"><input type="text" size="3" name="height" value="<?php echo (!empty($data[$fields .'_height'])) ? $data[$fields .'_height'] : '' ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['DISPLAY_ON_POSTING'] ?></td>
|
||||
<td class="row1"><input type="checkbox" name="display_on_posting" <?php echo (!empty($data['display_on_posting']) || !isset($data)) ? ' checked="checked"' : '' ?>/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2"><?php echo $user->lang[$lang . '_ORDER'] ?></td>
|
||||
<td class="row2"><select name="order"><?php echo $order_list ?></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><?php
|
||||
|
||||
if (!empty($data))
|
||||
{
|
||||
|
||||
?><input type="hidden" name="id" value="<?php echo $data[$fields . '_id'] ?>" /><?php
|
||||
|
||||
}
|
||||
|
||||
?><input class="mainoption" type="submit" value="<?php echo $user->lang['SUBMIT'] ?>" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
break;
|
||||
|
||||
case 'create':
|
||||
case 'modify':
|
||||
|
||||
$image_id = intval($_POST['id']);
|
||||
$img = stripslashes($_POST['img']);
|
||||
$image_order = intval($_POST['order']);
|
||||
$image_width = intval($_POST['width']);
|
||||
$image_height = intval($_POST['height']);
|
||||
|
||||
if ($image_width == 0 || $image_height == 0)
|
||||
{
|
||||
$img_size = @getimagesize($phpbb_root_path . $img_path . '/' . $img);
|
||||
$smile_width = $img_size[0];
|
||||
$smile_height = $img_size[1];
|
||||
}
|
||||
|
||||
$img_sql = array(
|
||||
$fields . '_url' => $img,
|
||||
$fields . '_width' => $image_width,
|
||||
$fields . '_height' => $image_height,
|
||||
$fields . '_order' => $image_order,
|
||||
'display_on_posting'=> (!empty($_POST['display_on_posting'])) ? 1 : 0
|
||||
);
|
||||
if ($mode == 'emoticons')
|
||||
{
|
||||
$img_sql = array_merge($sql, array(
|
||||
'emoticon' => stripslashes($_POST['emotion']),
|
||||
'code' => htmlspecialchars(stripslashes($_POST['code']))
|
||||
));
|
||||
}
|
||||
|
||||
if ($action == 'modify')
|
||||
{
|
||||
$result = $db->sql_query('SELECT ' . $fields . '_order
|
||||
FROM ' . $table . '
|
||||
WHERE ' . $fields . "_id = $image_id");
|
||||
$order_old = $db->sql_fetchfield($fields . '_order', 0, $result);
|
||||
|
||||
if ($order_old == $smile_order)
|
||||
{
|
||||
$no_update = TRUE;
|
||||
}
|
||||
|
||||
if ($order_old > $smile_order)
|
||||
{
|
||||
$sign = '+';
|
||||
$where = $fields . "_order >= $image_order AND " . $fields . "_order < $order_old";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sign = '-';
|
||||
$where = $fields . "_order > $order_old AND " . $fields . "_order < $image_order";
|
||||
$sql[$fields . '_order'] = $smile_order - 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sign = '+';
|
||||
$where = $fields . "_order > $image_order";
|
||||
}
|
||||
|
||||
if (empty($no_update))
|
||||
{
|
||||
$sql = 'UPDATE ' . $table . '
|
||||
SET ' . $fields . '_order = ' . $fields . "_order $sign 1
|
||||
WHERE $where";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
if ($action == 'modify')
|
||||
{
|
||||
$db->sql_query('UPDATE ' . $table . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $img_sql) . "
|
||||
WHERE " . $fields . "_id = $image_id");
|
||||
$cache->destroy('icons');
|
||||
|
||||
trigger_error($user->lang[$lang . '_EDITED']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->sql_query('INSERT INTO ' . $table . ' ' . $db->sql_build_array('INSERT', $img_sql));
|
||||
$cache->destroy('icons');
|
||||
|
||||
trigger_error($user->lang[$lang . '_ADDED']);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'import':
|
||||
|
||||
if (!empty($_POST['pak']))
|
||||
{
|
||||
$order = 0;
|
||||
|
||||
// The user has already selected a smilies_pak file
|
||||
if ($_POST['current'] == 'delete')
|
||||
{
|
||||
$db->sql_query('TRUNCATE ' . $table);
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
case 'emoticons':
|
||||
break;
|
||||
|
||||
case 'icons':
|
||||
// Reset all icon_ids
|
||||
$db->sql_query('UPDATE ' . TOPICS_TABLE . '
|
||||
SET icon_id = 0');
|
||||
$db->sql_query('UPDATE ' . POSTS_TABLE . '
|
||||
SET icon_id = 0');
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$cur_img = array();
|
||||
|
||||
$field_sql = ($mode == 'emoticons') ? 'code' : 'icons_url';
|
||||
$result = $db->sql_query('SELECT ' . $field_sql . '
|
||||
FROM ' . $table);
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
++$order;
|
||||
$cur_img[$row[$field_sql]] = 1;
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
if (!($pak_ary = @file($phpbb_root_path . $img_path . '/'. stripslashes($_POST['pak']))))
|
||||
{
|
||||
trigger_error('Could not read smiley pak file', E_USER_ERROR);
|
||||
}
|
||||
|
||||
foreach ($pak_ary as $pak_entry)
|
||||
{
|
||||
$data = array();
|
||||
if (preg_match_all("#'(.*?)', #", $pak_entry, $data))
|
||||
{
|
||||
if ((sizeof($data[1]) == 5 && $mode == 'icons') ||
|
||||
(sizeof($data[1]) != 5 && $mode == 'emoticons'))
|
||||
{
|
||||
trigger_error($user->lang['WRONG_PAK_TYPE']);
|
||||
}
|
||||
|
||||
$img = stripslashes($data[1][0]);
|
||||
$width = stripslashes($data[1][1]);
|
||||
$height = stripslashes($data[1][2]);
|
||||
if (isset($data[1][3]) && isset($data[1][4]))
|
||||
{
|
||||
$emotion = stripslashes($data[1][3]);
|
||||
$code = htmlentities(stripslashes($data[1][4]));
|
||||
}
|
||||
|
||||
if ($_POST['current'] == 'replace' &&
|
||||
(($mode == 'emoticons' && !empty($cur_img[$code])) ||
|
||||
($mode == 'icons' && !empty($cur_img[$img]))))
|
||||
{
|
||||
$replace_sql = ($mode == 'emoticons') ? $code : $img;
|
||||
$sql = array(
|
||||
$fields . '_url' => $img,
|
||||
$fields . '_height' => intval($height),
|
||||
$fields . '_width' => intval($width),
|
||||
);
|
||||
if ($mode == 'emoticons')
|
||||
{
|
||||
$sql = array_merge($sql, array(
|
||||
'emoticon' => $emotion
|
||||
));
|
||||
}
|
||||
|
||||
$db->sql_query("UPDATE $table SET " . $db->sql_build_array('UPDATE', $sql) . "
|
||||
WHERE $field_sql = '" . $db->sql_escape($replace_sql) . "'");
|
||||
}
|
||||
else
|
||||
{
|
||||
++$order;
|
||||
|
||||
$sql = array(
|
||||
$fields . '_url' => $img,
|
||||
$fields . '_height' => intval($height),
|
||||
$fields . '_width' => intval($width),
|
||||
$fields . '_order' => intval($order),
|
||||
);
|
||||
if ($mode == 'emoticons')
|
||||
{
|
||||
$sql = array_merge($sql, array(
|
||||
'code' => $code,
|
||||
'emoticon' => $emotion
|
||||
));
|
||||
}
|
||||
$db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $sql));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$cache->destroy('icons');
|
||||
|
||||
trigger_error($user->lang[$lang . '_IMPORT_SUCCESS']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$paklist = filelist($phpbb_root_path . $img_path, '', 'pak');
|
||||
|
||||
$pak_options = '';
|
||||
if (count($paklist))
|
||||
{
|
||||
foreach ($paklist as $pak)
|
||||
{
|
||||
$pak = substr($pak['path'], 1) . (($pak['path'] != '') ? '/' : '') . $pak['file'];
|
||||
|
||||
$pak_options .= '<option>' . htmlspecialchars($pak) . '</option>';
|
||||
}
|
||||
}
|
||||
|
||||
page_header($user->lang[$lang]);
|
||||
|
||||
?>
|
||||
<h1><?php echo $user->lang[$lang] ?></h1>
|
||||
|
||||
<p><?php echo $user->lang[$lang .'_EXPLAIN'] ?></p>
|
||||
|
||||
<form method="post" action="admin_icons.<?php echo $phpEx . $SID . '&mode=' . $mode . '&action=import'; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $user->lang[$lang . '_IMPORT'] ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
if ($pak_options == '')
|
||||
{
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1" colspan="2"><?php echo $user->lang['NO_' . $lang . '_PAK']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row2"><?php echo $user->lang['SELECT_PACKAGE'] ?></td>
|
||||
<td class="row1"><select name="pak"><?php echo $pak_options ?></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2"><?php echo $user->lang['CURRENT_' . $lang] ?><br /><span class="gensmall"><?php echo $user->lang['CURRENT_' . $lang . '_EXPLAIN'] ?></span></td>
|
||||
<td class="row1"><input type="radio" name="current" value="keep" checked="checked" /> <?php echo $user->lang['KEEP_ALL'] ?> <input type="radio" name="current" value="replace" /> <?php echo $user->lang['REPLACE_MATCHES'] ?> <input type="radio" name="current" value="delete" /> <?php echo $user->lang['DELETE_ALL'] ?> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><input class="mainoption" name="import" type="submit" value="<?php echo $user->lang['IMPORT_' . $lang] ?>" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
</table></form>
|
||||
<?php
|
||||
page_footer();
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case 'export':
|
||||
|
||||
page_header($user->lang['EXPORT_' . $lang]);
|
||||
trigger_error(sprintf($user->lang['EXPORT_' . $lang . '_EXPLAIN'], '<a href="admin_icons.' . $phpEx . $SID . '&mode=' . $mode . '&action=send">', '</a>'));
|
||||
break;
|
||||
|
||||
case 'send':
|
||||
|
||||
$result = $db->sql_query('SELECT *
|
||||
FROM ' . $table . "
|
||||
ORDER BY {$fields}_order");
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$pak .= "'" . addslashes($row[$fields . '_url']) . "', ";
|
||||
$pak .= "'" . addslashes($row[$fields . '_height']) . "', ";
|
||||
$pak .= "'" . addslashes($row[$fields . '_width']) . "', ";
|
||||
if ($mode == 'emoticons')
|
||||
{
|
||||
$pak .= "'" . addslashes($row['emoticon']) . "', ";
|
||||
$pak .= "'" . addslashes($row['code']) . "', ";
|
||||
}
|
||||
$pak .= "\n";
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if ($pak != '')
|
||||
{
|
||||
$db->sql_close();
|
||||
|
||||
header('Content-Type: text/x-delimtext; name="' . $fields . '.pak"');
|
||||
header('Content-disposition: attachment; filename=' . $fields . '.pak"');
|
||||
echo $pak;
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error($user->lang['NO_' . $fields . '_EXPORT']);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'move_up':
|
||||
case 'move_down':
|
||||
$image_order = intval($_GET['order']);
|
||||
$order_total = $image_order * 2 + (($action == 'move_up') ? -1 : 1);
|
||||
|
||||
$sql = 'UPDATE ' . $table . '
|
||||
SET ' . $fields . "_order = $order_total - " . $fields . '_order
|
||||
WHERE ' . $fields . "_order IN ($image_order, " . (($action == 'move_up') ? $image_order - 1 : $image_order + 1) . ')';
|
||||
$db->sql_query($sql);
|
||||
|
||||
$cache->destroy('icons');
|
||||
|
||||
// No break; here, display the smilies admin back
|
||||
|
||||
default:
|
||||
|
||||
// By default, check that smile_order is valid and fix it if necessary
|
||||
$result = $db->sql_query('SELECT * FROM ' . $table . ' ORDER BY ' . $fields . '_order');
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$order = 0;
|
||||
do
|
||||
{
|
||||
++$order;
|
||||
if ($row[$fields . '_order'] != $order)
|
||||
{
|
||||
$db->sql_query('UPDATE ' . $table . '
|
||||
SET ' . $fields . '_order = ' . $order . '
|
||||
WHERE ' . $fields . '_id = ' . $row[$fields . '_id']);
|
||||
}
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Output the page
|
||||
page_header($user->lang[$lang]);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang[$lang]; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang[$lang .'_EXPLAIN']; ?></p>
|
||||
|
||||
<form method="post" action="admin_icons.<?php echo $phpEx . $SID . '&mode=' . $mode ?>"><table cellspacing="1" cellpadding="0" border="0" align="center">
|
||||
<tr>
|
||||
<td align="right"> <a href="admin_icons.<?php echo $phpEx . $SID . '&mode=' . $mode . '&action=import'; ?>"><?php echo $user->lang['IMPORT_' . $lang]; ?></a> | <a href="admin_icons.<?php echo $phpEx . $SID . '&mode=' . $mode . '&action=export'; ?>"><?php echo $user->lang['EXPORT_' . $lang]; ?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th><?php echo $user->lang[$lang]; ?></th>
|
||||
<?php
|
||||
|
||||
if ($mode == 'emoticons')
|
||||
{
|
||||
|
||||
?>
|
||||
<th><?php echo $user->lang['CODE']; ?></th>
|
||||
<th><?php echo $user->lang['EMOTION']; ?></th>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<th><?php echo $user->lang['ACTION']; ?></th>
|
||||
<th><?php echo $user->lang['REORDER']; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
$spacer = FALSE;
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . $table . '
|
||||
ORDER BY display_on_posting DESC, ' . $fields . '_order ASC';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if (!$spacer && !$row['display_on_posting'])
|
||||
{
|
||||
$spacer = TRUE;
|
||||
?>
|
||||
<tr>
|
||||
<td class="row3" colspan="<?php echo ($mode == 'emoticons') ? 5 : 3; ?>" align="center"><?php echo $user->lang[$lang . '_NOT_DISPLAYED'] ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
|
||||
$row_class = ($row_class != 'row1') ? 'row1' : 'row2';
|
||||
|
||||
$alt_text = ($mode == 'emoticon') ? htmlspecialchars($row['code']) : '';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><img src="<?php echo './../' . $img_path . '/' . $row[$fields . '_url']; ?>" width="<?php echo $row[$fields . '_width']; ?>" height="<?php echo $row[$fields . '_height']; ?>" alt="<?php echo $alt_text; ?>" title="<?php echo $alt_text; ?>" /></td>
|
||||
<?php
|
||||
|
||||
if ($mode == 'emoticons')
|
||||
{
|
||||
|
||||
?>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo htmlspecialchars($row['code']); ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $row['emoticon']; ?></td>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><a href="<?php echo "admin_icons.$phpEx$SID&mode=$mode&action=edit&id=" . $row[$fields . '_id']; ?>"><?php echo $user->lang['EDIT']; ?></a> | <a href="<?php echo "admin_icons.$phpEx$SID&mode=$mode&action=delete&id=" . $row[$fields . '_id']; ?>"><?php echo $user->lang['DELETE']; ?></a></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><a href="<?php echo "admin_icons.$phpEx$SID&mode=$mode&action=move_up&order=" . $row[$fields . '_order']; ?>"><?php echo $user->lang['MOVE_UP']; ?></a> <br /> <a href="<?php echo "admin_icons.$phpEx$SID&mode=$mode&action=move_down&order=" . $row[$fields . '_order']; ?>"><?php echo $user->lang['MOVE_DOWN']; ?></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="cat" colspan="<?php echo ($mode == 'emoticons') ? 5 : 3; ?>" align="center"><input type="submit" name="add" value="<?php echo $user->lang['ADD_' . $lang]; ?>" class="mainoption" /></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// ---------
|
||||
// FUNCTIONS
|
||||
//
|
||||
function filelist($rootdir, $dir = '', $type = 'gif|jpg|png')
|
||||
{
|
||||
static $images = array();
|
||||
|
||||
$dh = opendir($rootdir . $dir);
|
||||
|
||||
while ($fname = readdir($dh))
|
||||
{
|
||||
if (is_file($rootdir . $dir . '/' . $fname) &&
|
||||
preg_match('#\.' . $type . '$#i', $fname) &&
|
||||
filesize($rootdir . $dir . '/' . $fname))
|
||||
{
|
||||
$images[] = array('path' => $dir, 'file' => $fname);
|
||||
}
|
||||
else if ($fname != '.' && $fname != '..' &&
|
||||
!is_file($rootdir . $dir . '/' . $fname) &&
|
||||
!is_link($rootdir . $dir . '/' . $fname))
|
||||
{
|
||||
filelist($rootdir, $dir . '/'. $fname, $type);
|
||||
}
|
||||
}
|
||||
|
||||
closedir($dh);
|
||||
|
||||
return $images;
|
||||
}
|
||||
//
|
||||
// FUNCTIONS
|
||||
// ---------
|
||||
|
||||
?>
|
|
@ -1,962 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* admin_permissions.php
|
||||
* -------------------
|
||||
* begin : Saturday, Feb 13, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if (!empty($setmodules))
|
||||
{
|
||||
$filename = basename(__FILE__);
|
||||
$module['FORUM']['PERMISSIONS'] = ($auth->acl_get('a_auth')) ? $filename . $SID . '&mode=forums' : '';
|
||||
$module['FORUM']['MODERATORS'] = ($auth->acl_get('a_authmods')) ? $filename . $SID . '&mode=moderators' : '';
|
||||
$module['FORUM']['SUPER_MODERATORS'] = ($auth->acl_get('a_authmods')) ? $filename . $SID . '&mode=supermoderators' : '';
|
||||
$module['GENERAL']['ADMINISTRATORS'] = ($auth->acl_get('a_authadmins')) ? $filename . $SID . '&mode=administrators' : '';
|
||||
$module['USER']['PERMISSIONS'] = ($auth->acl_get('a_authusers')) ? $filename . $SID . '&mode=users' : '';
|
||||
$module['GROUP']['PERMISSIONS'] = ($auth->acl_get('a_authgroups')) ? $filename . $SID . '&mode=groups' : '';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
|
||||
// Include files
|
||||
$phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
// Define some vars
|
||||
$forum_id = 0;
|
||||
$forum_sql = '';
|
||||
if (isset($_REQUEST['f']))
|
||||
{
|
||||
$forum_id = intval($_REQUEST['f']);
|
||||
$forum_sql = " WHERE forum_id = $forum_id";
|
||||
}
|
||||
|
||||
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : '';
|
||||
$username = (isset($_REQUEST['username'])) ? $_REQUEST['username'] : '';
|
||||
$group_id = (isset($_REQUEST['g'])) ? intval($_REQUEST['g']) : '';
|
||||
$entries = (isset($_POST['entries'])) ? $_POST['entries'] : '';
|
||||
|
||||
|
||||
|
||||
// Start program proper
|
||||
switch ($mode)
|
||||
{
|
||||
case 'forums':
|
||||
$l_title = $user->lang['PERMISSIONS'];
|
||||
$l_title_explain = $user->lang['PERMISSIONS_EXPLAIN'];
|
||||
$which_acl = 'a_auth';
|
||||
$type_sql = 'f';
|
||||
break;
|
||||
|
||||
case 'moderators':
|
||||
$l_title = $user->lang['MODERATORS'];
|
||||
$l_title_explain = $user->lang['MODERATORS_EXPLAIN'];
|
||||
$which_acl = 'a_authmods';
|
||||
$type_sql = 'm';
|
||||
break;
|
||||
|
||||
case 'supermoderators':
|
||||
$l_title = $user->lang['SUPER_MODERATORS'];
|
||||
$l_title_explain = $user->lang['SUPER_MODERATORS_EXPLAIN'];
|
||||
$which_acl = 'a_authmods';
|
||||
$type_sql = 'm';
|
||||
break;
|
||||
|
||||
case 'administrators':
|
||||
$l_title = $user->lang['ADMINISTRATORS'];
|
||||
$l_title_explain = $user->lang['ADMINISTRATORS_EXPLAIN'];
|
||||
$which_acl = 'a_authadmins';
|
||||
$type_sql = 'a';
|
||||
break;
|
||||
|
||||
case 'users':
|
||||
$l_title = $user->lang['USER_PERMISSIONS'];
|
||||
$l_title_explain = $user->lang['USER_PERMISSIONS_EXPLAIN'];
|
||||
$which_acl = 'a_authusers';
|
||||
$type_sql = 'u';
|
||||
break;
|
||||
|
||||
case 'groups':
|
||||
$l_title = $user->lang['GROUP_PERMISSIONS'];
|
||||
$l_title_explain = $user->lang['GROUP_PERMISSIONS_EXPLAIN'];
|
||||
$which_acl = 'a_authgroups';
|
||||
$type_sql = 'u';
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
// Permission check
|
||||
if (!$auth->acl_get($which_acl))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Call update or delete, both can take multiple user/group
|
||||
// ids. Additionally inheritance is handled (by the auth API)
|
||||
switch ($_POST['runas'])
|
||||
{
|
||||
case 'now':
|
||||
if (isset($_POST['update']))
|
||||
{
|
||||
$auth_admin = new auth_admin();
|
||||
|
||||
// Admin wants subforums to inherit permissions ... so handle this
|
||||
if (!empty($_POST['inherit']))
|
||||
{
|
||||
array_push($_POST['inherit'], $forum_id);
|
||||
$forum_id = $_POST['inherit'];
|
||||
}
|
||||
|
||||
foreach ($_POST['entries'] as $id)
|
||||
{
|
||||
$auth_admin->acl_set($_POST['type'], $forum_id, $id, $_POST['option']);
|
||||
}
|
||||
|
||||
cache_moderators();
|
||||
|
||||
trigger_error('Permissions updated successfully');
|
||||
}
|
||||
else if (isset($_POST['delete']))
|
||||
{
|
||||
$auth_admin = new auth_admin();
|
||||
|
||||
$option_ids = false;
|
||||
if (!empty($_POST['option']))
|
||||
{
|
||||
$sql = "SELECT auth_option_id
|
||||
FROM " . ACL_OPTIONS_TABLE . "
|
||||
WHERE auth_value LIKE '" . $_POST['option'] . "_%'";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$option_ids = array();
|
||||
do
|
||||
{
|
||||
$option_ids[] = $row['auth_option_id'];
|
||||
}
|
||||
while($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
foreach ($_POST['entries'] as $id)
|
||||
{
|
||||
$auth_admin->acl_delete($_POST['type'], $forum_id, $id, $option_ids);
|
||||
}
|
||||
|
||||
cache_moderators();
|
||||
|
||||
trigger_error('Permissions updated successfully');
|
||||
}
|
||||
else if (isset($_POST['presetsave']))
|
||||
{
|
||||
$holding_ary = array();
|
||||
foreach ($_POST['option'] as $acl_option => $allow_deny)
|
||||
{
|
||||
switch ($allow_deny)
|
||||
{
|
||||
case ACL_ALLOW:
|
||||
$holding_ary['allow'][] = $acl_option;
|
||||
break;
|
||||
case ACL_DENY:
|
||||
$holding_ary['deny'][] = $acl_option;
|
||||
break;
|
||||
case ACL_INHERIT:
|
||||
$holding_ary['inherit'][] = $acl_option;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$sql = array(
|
||||
'preset_user_id' => $user->data['user_id'],
|
||||
'preset_type' => $type_sql,
|
||||
'preset_data' => $db->sql_escape(serialize($holding_ary))
|
||||
);
|
||||
|
||||
if (!empty($_POST['presetname']))
|
||||
{
|
||||
$sql['preset_name'] = $db->sql_escape($_POST['presetname']);
|
||||
}
|
||||
|
||||
if (!empty($_POST['presetname']) || $_POST['presetoption'] != -1)
|
||||
{
|
||||
$sql = ($_POST['presetoption'] == -1) ? 'INSERT INTO ' . ACL_PRESETS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql) : 'UPDATE ' . ACL_PRESETS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql) . ' WHERE preset_id =' . $_POST['presetoption'];
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
else if (isset($_POST['presetdel']))
|
||||
{
|
||||
if (!empty($_POST['presetoption']))
|
||||
{
|
||||
$sql = "DELETE FROM " . ACL_PRESETS_TABLE . "
|
||||
WHERE preset_id = " . intval($_POST['presetoption']);
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'evt':
|
||||
if (isset($_POST['submit']))
|
||||
{
|
||||
// user_ids are returned in user_id_ary, a simple array
|
||||
$evt_code = "\$auth_admin = new auth_admin(); if (!empty(\$evt_inherit)){ array_push(\$evt_inherit, intval(\$evt_f)); } foreach (\$user_id_ary as \$id) { \$auth_admin->acl_set('user', \$evt_inherit, intval(\$id), \$evt_option); } cache_moderators();";
|
||||
|
||||
// event_code, type (user or group), id's (of users/groups), ... other data ...
|
||||
event_create($evt_code, $_POST['type'], $_POST['entries'], array('mode' => $_POST['mode']), array('f' => $_POST['forum_id']), array('entries' => $_POST['entries']), array('inherit' => $_POST['inherit']), array('type' => $_POST['type']), array('option' => $_POST['option']));
|
||||
}
|
||||
|
||||
// form submit page, ... associative data ...
|
||||
event_define('admin_permissions', array('mode' => $mode), array('forum_id' => $forum_id), array('inherit' => $_POST['inherit']), array('entries' => $_POST['entries']), array('type' => $_POST['type']), array('option' => $_POST['option']));
|
||||
break;
|
||||
|
||||
case 'crn':
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Get required information, either all forums if no id was
|
||||
// specified or just the requsted if it was
|
||||
if (!empty($forum_id) || !empty($group_id) || !empty($username) ||
|
||||
$mode == 'administrators' || $mode == 'supermoderators')
|
||||
{
|
||||
// Clear some vars, grab some info if relevant ...
|
||||
$s_hidden_fields = '';
|
||||
|
||||
|
||||
if (!empty($forum_id))
|
||||
{
|
||||
$sql = "SELECT forum_name, parent_id
|
||||
FROM " . FORUMS_TABLE . "
|
||||
WHERE forum_id = $forum_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$forum_info = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$l_title .= ' : <i>' . $forum_info['forum_name'] . '</i>';
|
||||
}
|
||||
else if (!empty($username))
|
||||
{
|
||||
$sql = "SELECT user_id
|
||||
FROM " . USERS_TABLE . "
|
||||
WHERE username IN ('$username')";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if (!($row = $db->sql_fetchrow($result)))
|
||||
{
|
||||
trigger_error($user->lang['No_such_user']);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$entries = array($row['user_id']);
|
||||
$l_title .= ' : <i>' . $username . '</i>';
|
||||
}
|
||||
else if (!empty($group_id))
|
||||
{
|
||||
$sql = "SELECT group_name
|
||||
FROM " . GROUPS_TABLE . "
|
||||
WHERE group_id IN ($group_id)";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if (!($row = $db->sql_fetchrow($result)))
|
||||
{
|
||||
trigger_error($user->lang['No_such_group']);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$entries = array($group_id);
|
||||
$l_title .= ' : <i>' . $row['group_name'] . '</i>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Generate header
|
||||
page_header($l_title);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $l_title; ?></h1>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
case 'forums':
|
||||
case 'moderators':
|
||||
$forum_sql = "AND a.forum_id = $forum_id";
|
||||
break;
|
||||
|
||||
case 'supermoderators':
|
||||
case 'administrators':
|
||||
case 'users':
|
||||
case 'groups':
|
||||
$forum_sql = 'AND a.forum_id = 0';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (!empty($entries))
|
||||
{
|
||||
|
||||
|
||||
|
||||
// Founder only operations ... these operations can
|
||||
// only be altered by someone with founder status
|
||||
$founder_sql = (!$userdata['user_founder']) ? ' AND founder_only <> 1' : '';
|
||||
|
||||
$sql = "SELECT auth_option_id, auth_value
|
||||
FROM " . ACL_OPTIONS_TABLE . "
|
||||
WHERE auth_value LIKE '" . $type_sql . "_%'
|
||||
AND auth_value <> '" . $type_sql . "_'
|
||||
$founder_sql";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$auth_options = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$auth_options[] = $row;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if ($_POST['type'] == 'user' && !empty($_POST['new']))
|
||||
{
|
||||
$entries = explode("\n", $entries);
|
||||
}
|
||||
|
||||
$where_sql = '';
|
||||
foreach ($entries as $value)
|
||||
{
|
||||
$where_sql .= (($where_sql != '') ? ', ' : '') . (($_POST['type'] == 'user' && !empty($_POST['new'])) ? '\'' . $value . '\'' : intval($value));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$ug = '';;
|
||||
$ug_hidden = '';
|
||||
$auth_values = array();
|
||||
|
||||
switch ($_POST['type'])
|
||||
{
|
||||
case 'group':
|
||||
$l_type = 'Group';
|
||||
|
||||
$sql = "SELECT g.group_id AS id, g.group_name AS name, o.auth_value, a.auth_allow_deny FROM " . GROUPS_TABLE . " g, " . ACL_GROUPS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o WHERE o.auth_value LIKE '" . $type_sql . "_%' AND a.auth_option_id = o.auth_option_id $forum_sql AND g.group_id = a.group_id AND g.group_id IN ($where_sql) ORDER BY g.group_name ASC";
|
||||
break;
|
||||
|
||||
case 'user':
|
||||
$l_type = 'User';
|
||||
|
||||
$sql = "SELECT u.user_id AS id, u.username AS name, u.user_founder, o.auth_value, a.auth_allow_deny FROM " . USERS_TABLE . " u, " . ACL_USERS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o WHERE o.auth_value LIKE '" . $type_sql . "_%' AND a.auth_option_id = o.auth_option_id $forum_sql AND u.user_id = a.user_id AND u.user_id IN ($where_sql) ORDER BY u.username, u.user_regdate ASC"; break;
|
||||
}
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$ug_test = (!empty($user->lang[$row['name']])) ? $user->lang[$row['name']] : $row['name'];
|
||||
$ug .= (!strstr($ug, $ug_test)) ? $ug_test . "\n" : '';
|
||||
|
||||
$ug_test = '<input type="hidden" name="entries[]" value="' . $row['id'] . '" />';
|
||||
$ug_hidden .= (!strstr($ug_hidden, $ug_test)) ? $ug_test : '';
|
||||
|
||||
$auth_values[$row['auth_value']] = (isset($auth_group[$row['auth_value']])) ? min($auth_group[$row['auth_value']], $row['auth_allow_deny']) : $row['auth_allow_deny'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = ($_POST['type'] == 'group') ? "SELECT group_id AS id, group_name AS name, group_type FROM " . GROUPS_TABLE . " WHERE group_id IN ($where_sql) ORDER BY group_name ASC" : "SELECT user_id AS id, username AS name, user_founder FROM " . USERS_TABLE . " WHERE username IN ($where_sql) ORDER BY username, user_regdate ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
|
||||
do
|
||||
{
|
||||
$ug_test = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang[$row['name']] : $row['name'];
|
||||
$ug .= (!strstr($ug, $ug_test)) ? $ug_test . "\n" : '';
|
||||
|
||||
$ug_test = '<input type="hidden" name="entries[]" value="' . $row['id'] . '" />';
|
||||
$ug_hidden .= (!strstr($ug_hidden, $ug_test)) ? $ug_test : '';
|
||||
|
||||
$auth_values[$row['auth_value']] = (isset($auth_group[$row['auth_value']])) ? min($auth_group[$row['auth_value']], $row['auth_allow_deny']) : $row['auth_allow_deny'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Now we'll build a list of preset options ...
|
||||
$preset_options = $preset_js = $preset_update_options = '';
|
||||
$holding = array();
|
||||
|
||||
// Do we have a parent forum? If so offer option
|
||||
// to inherit from that
|
||||
if ($forum_info['parent_id'] != 0)
|
||||
{
|
||||
switch ($_POST['type'])
|
||||
{
|
||||
case 'group':
|
||||
$sql = "SELECT o.auth_value, a.auth_allow_deny FROM " . ACL_GROUPS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o WHERE o.auth_value LIKE '" . $type_sql . "_%' AND a.auth_option_id = o.auth_option_id AND a.forum_id = " . $forum_info['parent_id'] . " AND a.group_id IN ($where_sql)";
|
||||
break;
|
||||
|
||||
case 'user':
|
||||
$sql = "SELECT o.auth_value, a.auth_allow_deny FROM " . ACL_USERS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o WHERE o.auth_value LIKE '" . $type_sql . "_%' AND a.auth_option_id = o.auth_option_id AND a.forum_id = " . $forum_info['parent_id'] . " AND a.user_id IN ($where_sql)";
|
||||
break;
|
||||
}
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
switch ($row['auth_allow_deny'])
|
||||
{
|
||||
case ACL_ALLOW:
|
||||
$holding['allow'] .= $row['auth_value'] . ', ';
|
||||
break;
|
||||
|
||||
case ACL_DENY:
|
||||
$holding['deny'] .= $row['auth_value'] . ', ';
|
||||
break;
|
||||
|
||||
case ACL_INHERIT:
|
||||
$holding['inherit'] .= $row['auth_value'] . ', ';
|
||||
break;
|
||||
}
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
$preset_options .= '<option value="preset_0">' . $user->lang['INHERIT_PARENT'] . '</option>';
|
||||
$preset_js .= "\tpresets['preset_0'] = new Array();" . "\n";
|
||||
$preset_js .= "\tpresets['preset_0'] = new preset_obj('" . $holding['allow'] . "', '" . $holding['deny'] . "', '" . $holding['inherit'] . "');\n";
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
// Look for custom presets
|
||||
$sql = "SELECT preset_id, preset_name, preset_data
|
||||
FROM " . ACL_PRESETS_TABLE . "
|
||||
WHERE preset_type = '$type_sql'
|
||||
ORDER BY preset_id ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$preset_update_options .= '<option value="' . $row['preset_id'] . '">' . $row['preset_name'] . '</option>';
|
||||
$preset_options .= '<option value="preset_' . $row['preset_id'] . '">' . $row['preset_name'] . '</option>';
|
||||
|
||||
$preset_data = unserialize($row['preset_data']);
|
||||
|
||||
foreach ($preset_data as $preset_type => $preset_type_ary)
|
||||
{
|
||||
$holding[$preset_type] = '';
|
||||
foreach ($preset_type_ary as $preset_option)
|
||||
{
|
||||
$holding[$preset_type] .= "$preset_option, ";
|
||||
}
|
||||
}
|
||||
|
||||
$preset_js .= "\tpresets['preset_" . $row['preset_id'] . "'] = new Array();" . "\n";
|
||||
$preset_js .= "\tpresets['preset_" . $row['preset_id'] . "'] = new preset_obj('" . $holding['allow'] . "', '" . $holding['deny'] . "', '" . $holding['inherit'] . "');\n";
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
unset($holding);
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<script language="Javascript" type="text/javascript">
|
||||
<!--
|
||||
|
||||
var presets = new Array();
|
||||
<?php
|
||||
|
||||
echo $preset_js;
|
||||
|
||||
?>
|
||||
|
||||
function preset_obj(allow, deny, inherit)
|
||||
{
|
||||
this.allow = allow;
|
||||
this.deny = deny;
|
||||
this.inherit = inherit;
|
||||
}
|
||||
|
||||
function use_preset(option)
|
||||
{
|
||||
if (option)
|
||||
{
|
||||
document.acl.set.selectedIndex = 0;
|
||||
var expr = new RegExp(/\d+/);
|
||||
for (i = 0; i < document.acl.length; i++)
|
||||
{
|
||||
var elem = document.acl.elements[i];
|
||||
if (elem.name.indexOf('option') == 0)
|
||||
{
|
||||
switch (option)
|
||||
{
|
||||
case 'all_allow':
|
||||
if (elem.value == <?php echo ACL_ALLOW; ?>)
|
||||
elem.checked = true;
|
||||
break;
|
||||
case 'all_deny':
|
||||
if (elem.value == <?php echo ACL_DENY; ?>)
|
||||
elem.checked = true;
|
||||
break;
|
||||
case 'all_inherit':
|
||||
if (elem.value == <?php echo ACL_INHERIT; ?>)
|
||||
elem.checked = true;
|
||||
break;
|
||||
default:
|
||||
option_name = elem.name.substr(7, elem.name.length - 8);
|
||||
|
||||
if (presets[option].allow.indexOf(option_name + ',') != -1 && elem.value == <?php echo ACL_ALLOW; ?>)
|
||||
elem.checked = true;
|
||||
else if (presets[option].deny.indexOf(option_name + ',') != -1 && elem.value == <?php echo ACL_DENY; ?>)
|
||||
elem.checked = true;
|
||||
else if (presets[option].inherit.indexOf(option_name + ',') != -1 && elem.value == <?php echo ACL_INHERIT; ?>)
|
||||
elem.checked = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function marklist(match, status)
|
||||
{
|
||||
for (i = 0; i < document.acl.length; i++)
|
||||
{
|
||||
if (document.acl.elements[i].name.indexOf(match) == 0)
|
||||
document.acl.elements[i].checked = status;
|
||||
}
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<p><?php echo $user->lang['ACL_EXPLAIN']; ?></p>
|
||||
|
||||
<form method="post" name="acl" action="<?php echo "admin_permissions.$phpEx$SID&mode=$mode"; ?>"><table cellspacing="2" cellpadding="0" border="0" align="center">
|
||||
<tr>
|
||||
<td align="right"><?php echo $user->lang['PRESETS']; ?>: <select name="set" onchange="use_preset(this.options[this.selectedIndex].value);"><option class="sep"><?php echo $user->lang['SELECT'] . ' ->'; ?></option><option value="all_allow"><?php echo $user->lang['ALL_ALLOW']; ?></option><option value="all_deny"><?php echo $user->lang['ALL_DENY']; ?></option><option value="all_inherit"><?php echo $user->lang['ALL_INHERIT']; ?></option><?php
|
||||
|
||||
echo ($preset_options) ? '<option class="sep">' . $user->lang['USER_PRESETS'] . ' ->' . '</option>' . $preset_options : '';
|
||||
|
||||
?></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th> <?php echo $user->lang['Option']; ?> </th>
|
||||
<th> <?php echo $user->lang['Allow']; ?> </th>
|
||||
<th> <?php echo $user->lang['Deny']; ?> </th>
|
||||
<th> <?php echo $user->lang['Inherit']; ?> </th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
for($i = 0; $i < sizeof($auth_options); $i++)
|
||||
{
|
||||
$row_class = ($row_class == 'row1') ? 'row2' : 'row1';
|
||||
|
||||
$l_can_cell = (!empty($user->lang['acl_' . $auth_options[$i]['auth_value']])) ? $user->lang['acl_' . $auth_options[$i]['auth_value']] : ucfirst(preg_replace('#.*?_#', '', $auth_options[$i]['auth_value']));
|
||||
|
||||
if (!empty($_POST['presetsave']) || !empty($_POST['presetdel']))
|
||||
{
|
||||
$allow_type = ($_POST['option'][$auth_options[$i]['auth_value']] == ACL_ALLOW) ? ' checked="checked"' : '';
|
||||
$deny_type = ($_POST['option'][$auth_options[$i]['auth_value']] == ACL_DENY) ? ' checked="checked"' : '';
|
||||
$inherit_type = ($_POST['option'][$auth_options[$i]['auth_value']] == ACL_INHERIT) ? ' checked="checked"' : '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$allow_type = ($auth_values[$auth_options[$i]['auth_value']] == ACL_ALLOW) ? ' checked="checked"' : '';
|
||||
$deny_type = ($auth_values[$auth_options[$i]['auth_value']] == ACL_DENY) ? ' checked="checked"' : '';
|
||||
$inherit_type = ($auth_values[$auth_options[$i]['auth_value']] == ACL_INHERIT) ? ' checked="checked"' : '';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>"><?php echo $l_can_cell; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_value']; ?>]" value="<?php echo ACL_ALLOW; ?>"<?php echo $allow_type; ?> /></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_value']; ?>]" value="<?php echo ACL_DENY; ?>"<?php echo $deny_type; ?> /></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_value']; ?>]" value="<?php echo ACL_INHERIT; ?>"<?php echo $inherit_type; ?> /></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
if ($type_sql == 'f' || $type_sql == 'm')
|
||||
{
|
||||
$children = get_forum_branch($forum_id, 'children', 'descending', false);
|
||||
|
||||
if (!empty($children))
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<th colspan="4"><?php echo $user->lang['Inheritance']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" colspan="4"><table width="100%" cellspacing="1" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td colspan="4" height="16"><span class="gensmall"><?php echo $user->lang['Inheritance_explain']; ?></span></td>
|
||||
</tr>
|
||||
<?php
|
||||
foreach ($children as $row)
|
||||
{
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="inherit[]" value="<?php echo $row['forum_id']; ?>" /> <?php echo $row['forum_name']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td height="16" align="center"><a class="gensmall" href="javascript:marklist('inherit', true);"><?php echo $user->lang['MARK_ALL']; ?></a> :: <a href="javascript:marklist('inherit', false);" class="gensmall"><?php echo $user->lang['UNMARK_ALL']; ?></a></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ($auth->acl_gets('a_events', 'a_cron'))
|
||||
{
|
||||
$row_class = ($row_class == 'row1') ? 'row2' : 'row1';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th colspan="4"><?php echo $user->lang['RUN_HOW']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>" colspan="4" align="center"><input type="radio" name="runas" value="now" checked="checked" /> <?php echo $user->lang['RUN_AS_NOW']; ?><?php
|
||||
|
||||
if ($auth->acl_get('a_events'))
|
||||
{
|
||||
|
||||
?> <input type="radio" name="runas" value="evt" /> <?php
|
||||
|
||||
echo $user->lang['RUN_AS_EVT'];
|
||||
}
|
||||
if ($auth->acl_get('a_cron'))
|
||||
{
|
||||
|
||||
?> <input type="radio" name="runas" value="crn" /> <?php
|
||||
|
||||
echo $user->lang['RUN_AS_CRN'];
|
||||
|
||||
}
|
||||
|
||||
?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="cat" colspan="4" align="center"><input class="mainoption" type="submit" name="update" value="<?php echo $user->lang['Update']; ?>" /> <input class="liteoption" type="submit" name="cancel" value="<?php echo $user->lang['CANCEL']; ?>" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="type" value="<?php echo $_POST['type']; ?>" /><?php echo $ug_hidden; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br clear="all" />
|
||||
|
||||
<table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th colspan="4"><?php echo $user->lang['PRESETS']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" colspan="4"><table width="100%" cellspacing="1" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td colspan="2" height="16"><span class="gensmall"><?php echo $user->lang['PRESETS_EXPLAIN']; ?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap"><?php echo $user->lang['SELECT_PRESET']; ?>: </td>
|
||||
<td><select name="presetoption"><option class="sep" value="-1"><?php echo $user->lang['SELECT'] . ' ->'; ?></option><?php
|
||||
|
||||
echo $preset_update_options;
|
||||
|
||||
?></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap"><?php echo $user->lang['PRESET_NAME']; ?>: </td>
|
||||
<td><input type="text" name="presetname" maxlength="25" /> </td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="4" align="center"><input class="liteoption" type="submit" name="presetsave" value="<?php echo $user->lang['SAVE']; ?>" /> <input class="liteoption" type="submit" name="presetdel" value="<?php echo $user->lang['DELETE']; ?>" /><input type="hidden" name="advanced" value="true" /></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<p><?php echo $l_title_explain; ?></p>
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td align="center"><h1><?php echo $user->lang['Users']; ?></h1></td>
|
||||
<td align="center"><h1><?php echo $user->lang['Groups']; ?></h1></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td><form method="post" action="<?php echo "admin_permissions.$phpEx$SID&mode=$mode"; ?>"><table width="90%" class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<?php
|
||||
|
||||
$sql = "SELECT DISTINCT u.user_id, u.username
|
||||
FROM " . USERS_TABLE . " u, " . ACL_USERS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o
|
||||
WHERE o.auth_value LIKE '" . $type_sql . "_%'
|
||||
AND a.auth_option_id = o.auth_option_id
|
||||
$forum_sql
|
||||
AND u.user_id = a.user_id
|
||||
ORDER BY u.username, u.user_regdate ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$users = '';
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$users .= '<option value="' . $row['user_id'] . '">' . $row['username'] . '</option>';
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo $user->lang['Manage_users']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" align="center"><select style="width:280px" name="entries[]" multiple="multiple" size="5"><?php echo $users; ?></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" align="center"><input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['Remove_selected']; ?>" /> <input class="liteoption" type="submit" name="advanced" value="<?php echo $user->lang['Advanced']; ?>" /><input type="hidden" name="type" value="user" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="option" value="<?php echo $type_sql; ?>" /></td>
|
||||
</tr>
|
||||
</table></form></td>
|
||||
|
||||
<td align="center"><form method="post" name="admingroups" action="<?php echo "admin_permissions.$phpEx$SID&mode=$mode"; ?>"><table width="90%" class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<?php
|
||||
|
||||
$sql = "SELECT DISTINCT g.group_id, g.group_name
|
||||
FROM " . GROUPS_TABLE . " g, " . ACL_GROUPS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o
|
||||
WHERE o.auth_value LIKE '" . $type_sql . "_%'
|
||||
$forum_sql
|
||||
AND a.auth_option_id = o.auth_option_id
|
||||
AND g.group_id = a.group_id
|
||||
ORDER BY g.group_type DESC, g.group_name ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$groups = '';
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$groups .= '<option value="' . $row['group_id'] . '">' . ((!empty($user->lang['G_' . $row['group_name']])) ? '* ' . $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = "SELECT group_id, group_name
|
||||
FROM " . GROUPS_TABLE . "
|
||||
ORDER BY group_type DESC, group_name";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$group_list = '';
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$group_list .= '<option value="' . $row['group_id'] . '">' . ((!empty($user->lang['G_' . $row['group_name']])) ? '* ' . $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th><?php echo $user->lang['Manage_groups']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" align="center"><select style="width:280px" name="entries[]" multiple="multiple" size="5"><?php echo $groups; ?></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" align="center"><input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['Remove_selected']; ?>" /> <input class="liteoption" type="submit" name="advanced" value="<?php echo $user->lang['Advanced']; ?>" /><input type="hidden" name="type" value="group" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="option" value="<?php echo $type_sql; ?>" /></td>
|
||||
</tr>
|
||||
</table></form></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<td><form method="post" action="<?php echo "admin_permissions.$phpEx$SID&mode=$mode"; ?>"><table class="bg" width="90%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th><?php echo $user->lang['Add_users']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" align="center"><textarea cols="40" rows="4" name="entries"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" align="center"> <input type="submit" name="add" value="<?php echo $user->lang['SUBMIT']; ?>" class="mainoption" /> <input type="reset" value="<?php echo $user->lang['RESET']; ?>" class="liteoption" /> <input type="submit" name="usersubmit" value="<?php echo $user->lang['FIND_USERNAME']; ?>" class="liteoption" onclick="window.open('<?php echo "../memberlist.$phpEx$SID"; ?>&mode=searchuser&form=2&field=entries', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=740');return false;" /><input type="hidden" name="type" value="user" /><input type="hidden" name="advanced" value="1" /><input type="hidden" name="new" value="1" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /></td>
|
||||
</tr>
|
||||
</table></form></td>
|
||||
|
||||
<td><form method="post" action="<?php echo "admin_permissions.$phpEx$SID&mode=$mode"; ?>"><table width="90%" class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th><?php echo $user->lang['Add_groups']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" align="center"><select name="entries[]" multiple="multiple" size="4"><?php echo $group_list; ?></select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" align="center"> <input type="submit" name="add" value="<?php echo $user->lang['SUBMIT']; ?>" class="mainoption" /> <input type="reset" value="<?php echo $user->lang['RESET']; ?>" class="liteoption" /><input type="hidden" name="type" value="group" /><input type="hidden" name="advanced" value="1" /><input type="hidden" name="new" value="1" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /></td>
|
||||
</tr>
|
||||
</table></form></td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Output appropriate front end page; forums, user or group selector
|
||||
page_header($l_title);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $l_title; ?></h1>
|
||||
|
||||
<p><?php echo $l_title_explain ?></p>
|
||||
|
||||
<form method="post" action="<?php echo "admin_permissions.$phpEx$SID&mode=$mode"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<?php
|
||||
|
||||
// Mode specific markup
|
||||
switch ($mode)
|
||||
{
|
||||
case 'forums':
|
||||
case 'moderators':
|
||||
$select_list = make_forum_select(false, false, false);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th align="center"><?php echo $user->lang['LOOK_UP_FORUM']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" align="center"> <select name="f"><?php echo $select_list; ?></select> <input type="submit" value="<?php echo $user->lang['LOOK_UP_FORUM']; ?>" class="mainoption" /> </td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
break;
|
||||
|
||||
case 'users':
|
||||
?>
|
||||
<tr>
|
||||
<th align="center"><?php echo $user->lang['Select_a_User']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" align="center"><input type="text" class="post" name="username" maxlength="50" size="20" /> <input type="submit" name="submituser" value="<?php echo $user->lang['Look_up_user']; ?>" class="mainoption" /> <input type="submit" name="usersubmit" value="<?php echo $user->lang['FIND_USERNAME']; ?>" class="liteoption" onClick="window.open('<?php echo "../memberlist.$phpEx$SID&mode=searchuser&field=username"; ?>', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=740');return false;" /><input type="hidden" name="type" value="user" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'groups':
|
||||
// Generate list of groups
|
||||
$sql = "SELECT group_id, group_name
|
||||
FROM " . GROUPS_TABLE . "
|
||||
ORDER BY group_type DESC";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$group_options = '';
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$group_options .= (($group_options != '') ? ', ' : '') . '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th align="center"><?php echo $user->lang['SELECT_A_GROUP']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" align="center"> <select name="g"><?php echo $group_options; ?></select> <input type="submit" value="<?php echo $user->lang['LOOK_UP_GROUP']; ?>" class="mainoption" /><input type="hidden" name="type" value="group" /> </td>
|
||||
</tr>
|
||||
<?php
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
?>
|
|
@ -1,203 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* admin_prune.php
|
||||
* -------------------
|
||||
* begin : Mon Jul 31, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if (!empty($setmodules))
|
||||
{
|
||||
if (!$auth->acl_get('a_prune'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$module['FORUM']['PRUNE'] = basename(__FILE__) . $SID . '&mode=forums';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
// Include files
|
||||
$phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
// Do we have permission?
|
||||
if (!$auth->acl_get('a_prune'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
// Get the forum ID for pruning
|
||||
if (isset($_REQUEST['f']))
|
||||
{
|
||||
$forum_id = intval($_REQUEST['f']);
|
||||
$forum_sql = ($forum_id == -1) ? '' : "AND forum_id = $forum_id";
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_id = '';
|
||||
$forum_sql = '';
|
||||
}
|
||||
|
||||
|
||||
// Check for submit to be equal to Prune. If so then proceed with the pruning.
|
||||
if (isset($_POST['doprune']))
|
||||
{
|
||||
$prunedays = (isset($_POST['prunedays'])) ? intval($_POST['prunedays']) : 0;
|
||||
|
||||
// Convert days to seconds for timestamp functions...
|
||||
$prunedate = time() - ($prunedays * 86400);
|
||||
|
||||
page_header($user->lang['PRUNE']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['PRUNE']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['PRUNE_SUCCESS']; ?></p>
|
||||
|
||||
<table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th><?php echo $user->lang['FORUM']; ?></th>
|
||||
<th><?php echo $user->lang['TOPICS_PRUNED']; ?></th>
|
||||
<th><?php echo $user->lang['POSTS_PRUNED']; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
// Get a list of forum's or the data for the forum that we are pruning.
|
||||
$sql = "SELECT forum_id, forum_name
|
||||
FROM " . FORUMS_TABLE . "
|
||||
ORDER BY left_id ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$log_data = '';
|
||||
do
|
||||
{
|
||||
$p_result = prune($forum_rows[$i]['forum_id'], $prunedate);
|
||||
sync('forum', $forum_rows[$i]['forum_id']);
|
||||
|
||||
$row_class = ($row_class == 'row1') ? 'row2' : 'row1';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $row['forum_name']; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $p_result['topics']; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $p_result['posts']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
$log_data .= (($log_data != '') ? ', ' : '') . $forum_rows[$i]['forum_name'];
|
||||
}
|
||||
while($row = $db->sql_fetchrow($result));
|
||||
|
||||
add_log('admin', 'log_prune', $log_data);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1" align="center"><?php echo $user->lang['NO_PRUNE']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
?>
|
||||
</table>
|
||||
|
||||
<br clear="all" />
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
}
|
||||
|
||||
page_header($user->lang['PRUNE']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['PRUNE']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['FORUM_PRUNE_EXPLAIN']; ?></p>
|
||||
|
||||
<?php
|
||||
|
||||
// If they haven't selected a forum for pruning yet then
|
||||
// display a select box to use for pruning.
|
||||
if (empty($forum_id))
|
||||
{
|
||||
|
||||
// Output a selection table if no forum id has been specified.
|
||||
$select_list = '<option value="-1">' . $user->lang['ALL_FORUMS'] . '</option>' . make_forum_select(false, false, false);
|
||||
|
||||
?>
|
||||
|
||||
<form method="post" action="admin_prune.<?php echo $phpEx . $SID; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th align="center"><?php echo $user->lang['SELECT_FORUM']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" align="center"> <select name="f"><?php echo $select_list; ?></select> <input type="submit" value="<?php echo $user->lang['LOOK_UP_FORUM']; ?>" class="mainoption" /> </td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT forum_name
|
||||
FROM " . FORUMS_TABLE . "
|
||||
WHERE forum_id = $forum_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$forum_name = ($forum_id == -1) ? $user->lang['ALL_FORUMS'] : $row['forum_name'];
|
||||
|
||||
?>
|
||||
|
||||
<h2><?php echo $user->lang['FORUM'] . ': <i>' . $forum_name; ?></i></h2>
|
||||
|
||||
<form method="post" action="admin_prune.<?php echo $phpEx . $SID; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th class="th"><?php echo $user->lang['FORUM_PRUNE']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo sprintf($user->lang['PRUNE_NOT_POSTED'], '<input type="text" name="prunedays" size="4" />'); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" align="center"><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="submit" name="doprune" value="<?php echo $user->lang['DO_PRUNE']; ?>" class="mainoption"></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
page_footer();
|
||||
|
||||
?>
|
|
@ -1,260 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* admin_prune_users.php
|
||||
* -------------------
|
||||
* begin : Saturday, Feb 13, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if (!empty($setmodules))
|
||||
{
|
||||
if (!$auth->acl_get('a_userdel'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$module['USER']['PRUNE_USERS'] = basename(__FILE__) . $SID;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
// Include files
|
||||
$phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
// Do we have forum admin permissions?
|
||||
if (!$auth->acl_get('a_userdel'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
// Set mode
|
||||
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : '';
|
||||
|
||||
// Do prune
|
||||
if (isset($_POST['prune']))
|
||||
{
|
||||
if (empty($_POST['confirm']))
|
||||
{
|
||||
$values = array('prune', 'deactivate', 'delete', 'users', 'username', 'email', 'joined_select', 'active_select', 'count_select', 'joined', 'active', 'count', 'deleteposts');
|
||||
|
||||
$l_message = '<form method="post" action="admin_prune_users.' . $phpEx . $SID . '">' . $user->lang['Confirm_prune_users'] . '<br /><br /><input class="liteoption" type="submit" name="confirm" value="' . $user->lang['Yes'] . '" /> <input class="liteoption" type="submit" name="cancel" value="' . $user->lang['No'] . '" />';
|
||||
|
||||
foreach ($values as $field)
|
||||
{
|
||||
$l_message .= (!empty($_POST[$field])) ? '<input type="hidden" name="' . $field . '" value="' . urlencode($_POST[$field]) . '" />' : '';
|
||||
}
|
||||
|
||||
$l_message .= '</form>';
|
||||
|
||||
page_header($user->lang['Prune_users']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['PRUNE_USERS']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['PRUNE_USERS_EXPLAIN']; ?></p>
|
||||
|
||||
<?php
|
||||
|
||||
page_message($user->lang['CONFIRM'], $l_message, false);
|
||||
page_footer();
|
||||
|
||||
}
|
||||
else if (isset($_POST['confirm']))
|
||||
{
|
||||
if (!empty($_POST['users']))
|
||||
{
|
||||
$users = explode("\n", urldecode($_POST['users']));
|
||||
|
||||
$where_sql = '';
|
||||
foreach ($users as $username)
|
||||
{
|
||||
$where_sql .= (($where_sql != '') ? ', ' : '') . '\'' . trim($username) . '\'';
|
||||
}
|
||||
$where_sql = " AND username IN ($where_sql)";
|
||||
}
|
||||
else
|
||||
{
|
||||
$username = (!empty($_POST['username'])) ? urldecode($_POST['username']) : '';
|
||||
$email = (!empty($_POST['email'])) ? urldecode($_POST['email']) : '';
|
||||
|
||||
$joined_select = (!empty($_POST['joined_select'])) ? $_POST['joined_select'] : 'lt';
|
||||
$active_select = (!empty($_POST['active_select'])) ? $_POST['active_select'] :'lt';
|
||||
$count_select = (!empty($_POST['count_select'])) ? $_POST['count_select'] : 'eq';
|
||||
$joined = (!empty($_POST['joined'])) ? explode('-', $_POST['joined']) : array();
|
||||
$active = (!empty($_POST['active'])) ? explode('-', $_POST['active']) :array();
|
||||
$count = (!empty($_POST['count'])) ? intval($_POST['count']) : '';
|
||||
|
||||
$key_match = array('lt' => '<', 'gt' => '>', 'eq' => '=');
|
||||
$sort_by_types = array('username', 'user_email', 'user_posts', 'user_regdate', 'user_lastvisit');
|
||||
|
||||
$where_sql = '';
|
||||
$where_sql .= ($username) ? " AND username LIKE '" . str_replace('*', '%', $username) ."'" : '';
|
||||
$where_sql .= ($email) ? " AND user_email LIKE '" . str_replace('*', '%', $email) ."' " : '';
|
||||
$where_sql .= ($joined) ? " AND user_regdate " . $key_match[$joined_select] . " " . gmmktime(0, 0, 0, intval($joined[1]), intval($joined[2]), intval($joined[0])) : '';
|
||||
$where_sql .= ($count) ? " AND user_posts " . $key_match[$count_select] . " $count " : '';
|
||||
$where_sql .= ($active) ? " AND user_lastvisit " . $key_match[$active_select] . " " . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : '';
|
||||
}
|
||||
|
||||
$sql = "SELECT username, user_id FROM " . USERS_TABLE . "
|
||||
WHERE user_id <> " . ANONYMOUS . "
|
||||
$where_sql";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$where_sql = '';
|
||||
$user_ids = array();
|
||||
$usernames = array();
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$where_sql .= (($where_sql != '') ? ', ' : '') . $row['user_id'];
|
||||
$user_ids[] = $row['user_id'];
|
||||
$usernames[] = $row['username'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
$where_sql = " AND user_id IN ($where_sql)";
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if ($where_sql != '')
|
||||
{
|
||||
$sql = '';
|
||||
if (!empty($_POST['delete']))
|
||||
{
|
||||
if (!empty($_POST['deleteposts']))
|
||||
{
|
||||
$l_admin_log = 'log_prune_user_del_del';
|
||||
|
||||
//
|
||||
// Call unified post deletion routine?
|
||||
//
|
||||
}
|
||||
else
|
||||
{
|
||||
$l_admin_log = 'log_prune_user_del_anon';
|
||||
|
||||
for($i = 0; $i < sizeof($user_ids); $i++)
|
||||
{
|
||||
$sql = "UPDATE " . POSTS_TABLE . "
|
||||
SET poster_id = " . ANONYMOUS . ", post_username = '" . $usernames[$i] . "'
|
||||
WHERE user_id = " . $userids[$i];
|
||||
// $db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM " . USERS_TABLE;
|
||||
}
|
||||
else if (!empty($_POST['deactivate']))
|
||||
{
|
||||
$l_admin_log = 'log_prune_user_deac';
|
||||
|
||||
$sql = "UPDATE " . USERS_TABLE . " SET user_active = 0";
|
||||
}
|
||||
$sql .= " WHERE user_id <> " . ANONYMOUS . "
|
||||
$where_sql";
|
||||
// $db->sql_query($sql);
|
||||
|
||||
add_log('admin', $l_admin_log, implode(', ', $usernames));
|
||||
|
||||
unset($user_ids);
|
||||
unset($usernames);
|
||||
}
|
||||
|
||||
message_die(MESSAGE, $user->lang['Success_user_prune']);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
$find_count = array('lt' => $user->lang['Less_than'], 'eq' => $user->lang['Equal_to'], 'gt' => $user->lang['More_than']);
|
||||
$s_find_count = '';
|
||||
foreach ($find_count as $key => $value)
|
||||
{
|
||||
$selected = ($key == 'eq') ? ' selected="selected"' : '';
|
||||
$s_find_count .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
|
||||
}
|
||||
|
||||
$find_time = array('lt' => $user->lang['Before'], 'gt' => $user->lang['After']);
|
||||
$s_find_join_time = '';
|
||||
foreach ($find_time as $key => $value)
|
||||
{
|
||||
$s_find_join_time .= '<option value="' . $key . '">' . $value . '</option>';
|
||||
}
|
||||
$s_find_active_time = '';
|
||||
foreach ($find_time as $key => $value)
|
||||
{
|
||||
$s_find_active_time .= '<option value="' . $key . '">' . $value . '</option>';
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
page_header($user->lang['Prune_users']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['Prune_users']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['Prune_users_explain']; ?></p>
|
||||
|
||||
<form method="post" name="post" action="<?php echo "admin_prune_users.$phpEx$SID"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $user->lang['Prune_users']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['USERNAME']; ?>: </td>
|
||||
<td class="row2"><input class="post" type="text" name="username" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Email']; ?>: </td>
|
||||
<td class="row2"><input class="post" type="text" name="email" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Joined']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Joined_explain']; ?></span></td>
|
||||
<td class="row2"><select name="joined_select"><?php echo $s_find_join_time; ?></select> <input class="post" type="text" name="joined" maxlength="10" size="10" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Last_active']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Last_active_explain']; ?></span></td>
|
||||
<td class="row2"><select name="active_select"><?php echo $s_find_active_time; ?></select> <input class="post" type="text" name="active" maxlength="10" size="10" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Posts']; ?>: </td>
|
||||
<td class="row2"><select name="count_select"><?php echo $s_find_count; ?></select> <input class="post" type="text" name="count" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Prune_users']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Select_users_explain']; ?></span></td>
|
||||
<td class="row2"><textarea name="users" cols="40" rows="5"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['Delete_user_posts']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Delete_user_posts_explain']; ?></span></td>
|
||||
<td class="row2"><input type="radio" name="deleteposts" value="1" /> <?php echo $user->lang['Yes']; ?> <input type="radio" name="deleteposts" value="0" checked="checked" /> <?php echo $user->lang['No']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['Prune_users']; ?>" /> <input class="liteoption" type="submit" name="deactivate" value="<?php echo $user->lang['Deactivate']; ?>" /> <input type="submit" name="usersubmit" value="<?php echo $user->lang['Find_username']; ?>" class="liteoption" onClick="window.open('<?php echo "../search.$phpEx$SID&mode=searchuser&field=users"; ?>', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=650');return false;" /><input type="hidden" name="prune" value="1" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
?>
|
|
@ -1,270 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* admin_ranks.php
|
||||
* -------------------
|
||||
* begin : Thursday, Jul 12, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if (!empty($setmodules))
|
||||
{
|
||||
if (!$auth->acl_get('a_ranks'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$module['USER']['RANKS'] = basename(__FILE__) . $SID;
|
||||
return;
|
||||
}
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
// Let's set the root dir for phpBB
|
||||
$phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
// Do we have permission?
|
||||
if (!$auth->acl_get('a_ranks'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
// Check mode
|
||||
if (isset($_REQUEST['mode']))
|
||||
{
|
||||
$mode = $_REQUEST['mode'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// These could be entered via a form button
|
||||
if (isset($_POST['add']))
|
||||
{
|
||||
$mode = 'add';
|
||||
}
|
||||
else if (isset($_POST['save']))
|
||||
{
|
||||
$mode = 'save';
|
||||
}
|
||||
else
|
||||
{
|
||||
$mode = '';
|
||||
}
|
||||
}
|
||||
|
||||
// Process mode
|
||||
if ($mode != '')
|
||||
{
|
||||
if ($mode == 'edit' || $mode == 'add')
|
||||
{
|
||||
//
|
||||
// They want to add a new rank, show the form.
|
||||
//
|
||||
$rank_id = (isset($_GET['id'])) ? intval($_GET['id']) : 0;
|
||||
|
||||
$s_hidden_fields = '<input type="hidden" name="mode" value="save" />';
|
||||
|
||||
if ($mode == 'edit')
|
||||
{
|
||||
if (empty($rank_id))
|
||||
{
|
||||
trigger_error($user->lang['Must_select_rank']);
|
||||
}
|
||||
|
||||
$sql = "SELECT * FROM " . RANKS_TABLE . "
|
||||
WHERE rank_id = $rank_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$rank_info = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$s_hidden_fields .= '<input type="hidden" name="id" value="' . $rank_id . '" />';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$rank_info['rank_special'] = 0;
|
||||
}
|
||||
|
||||
page_header($user->lang['RANKS']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['RANKS']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['RANKS_EXPLAIN']; ?></p>
|
||||
|
||||
<form method="post" action="<?php echo "admin_ranks.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $user->lang['RANKS']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" width="40%" nowrap="nowrap"><?php echo $user->lang['RANK_TITLE']; ?>: </td>
|
||||
<td class="row2"><input type="text" name="title" size="35" maxlength="40" value="<?php echo $rank_info['rank_title']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" width="40%" nowrap="nowrap"><?php echo $user->lang['RANK_SPECIAL']; ?>: </td>
|
||||
<td class="row2"><input type="radio" name="special_rank" value="1"<?php echo ($rank_info['rank_special']) ? ' checked="checked"' : ''; ?> /><?php echo $user->lang['YES']; ?> <input type="radio" name="special_rank" value="0"<?php echo (!$rank_info['rank_special']) ? ' checked="checked"' : ''; ?> /> <?php echo $user->lang['NO']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" width="40%" nowrap="nowrap"><?php echo $user->lang['RANK_MINIMUM']; ?>: </td>
|
||||
<td class="row2"><input type="text" name="min_posts" size="5" maxlength="10" value="<?php echo ($rank_info['rank_special']) ? '' : $rank_info['rank_min']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" width="40%"><?php echo $user->lang['RANK_IMAGE']; ?>: <br /><span class="gensmall"><?php echo $user->lang['RANK_IMAGE_EXPLAIN']; ?></span></td>
|
||||
<td class="row2" valign="middle"><input type="text" name="rank_image" size="40" maxlength="255" value="<?php echo ($rank_info['rank_image'] != '') ? $rank_info['rank_image'] : ''; ?>" /> <?php echo ($rank_info['rank_image'] != '') ? '<img src="../' . $rank_info['rank_image'] . '" />' : ''; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><?php echo $s_hidden_fields; ?><input type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" class="mainoption" /> <input type="reset" value="<?php echo $user->lang['RESET']; ?>" class="liteoption" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
}
|
||||
else if ($mode == 'save')
|
||||
{
|
||||
//
|
||||
// Ok, they sent us our info, let's update it.
|
||||
//
|
||||
|
||||
$rank_id = (isset($_POST['id'])) ? intval($_POST['id']) : 0;
|
||||
$rank_title = (isset($_POST['title'])) ? trim($_POST['title']) : '';
|
||||
$special_rank = (!empty($_POST['special_rank'])) ? 1 : 0;
|
||||
$min_posts = (isset($_POST['min_posts'])) ? intval($_POST['min_posts']) : -1;
|
||||
$rank_image = (isset($_POST['rank_image'])) ? trim($_POST['rank_image']) : '';
|
||||
|
||||
if ($rank_title == '')
|
||||
{
|
||||
trigger_error($user->lang['MUST_SELECT_RANK']);
|
||||
}
|
||||
|
||||
if ($special_rank == 1)
|
||||
{
|
||||
$min_posts = -1;
|
||||
}
|
||||
|
||||
//
|
||||
// The rank image has to be a jpg, gif or png
|
||||
//
|
||||
if ($rank_image != '')
|
||||
{
|
||||
if (!preg_match('#(\.gif|\.png|\.jpg|\.jpeg)$#is', $rank_image))
|
||||
{
|
||||
$rank_image = '';
|
||||
}
|
||||
}
|
||||
|
||||
if ($rank_id)
|
||||
{
|
||||
$sql = "UPDATE " . RANKS_TABLE . "
|
||||
SET rank_title = '" . $db->sql_escape($rank_title) . "', rank_special = $special_rank, rank_min = $min_posts, rank_image = '" . $db->sql_escape($rank_image) . "'
|
||||
WHERE rank_id = $rank_id";
|
||||
|
||||
$message = $user->lang['RANK_UPDATED'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "INSERT INTO " . RANKS_TABLE . " (rank_title, rank_special, rank_min, rank_image)
|
||||
VALUES ('" . $db->sql_escape($rank_title) . "', $special_rank, $min_posts, '" . $db->sql_escape($rank_image) . "')";
|
||||
|
||||
$message = $user->lang['RANK_ADDED'];
|
||||
}
|
||||
$db->sql_query($sql);
|
||||
|
||||
trigger_error($message);
|
||||
|
||||
}
|
||||
else if ($mode == 'delete')
|
||||
{
|
||||
// Ok, they want to delete their rank
|
||||
$rank_id = (isset($_REQUEST['id'])) ? intval($_REQUEST['id']) : 0;
|
||||
|
||||
if ($rank_id)
|
||||
{
|
||||
$sql = "DELETE FROM " . RANKS_TABLE . "
|
||||
WHERE rank_id = $rank_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = "UPDATE " . USERS_TABLE . "
|
||||
SET user_rank = 0
|
||||
WHERE user_rank = $rank_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
trigger_error($user->lang['RANK_REMOVED']);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error($user->lang['MUST_SELECT_RANK']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
page_header($user->lang['RANKS']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['RANKS']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['RANKS_EXPLAIN']; ?></p>
|
||||
|
||||
<form method="post" action="<?php echo "admin_ranks.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th><?php echo $user->lang['RANK_IMAGE']; ?></th>
|
||||
<th><?php echo $user->lang['RANK_TITLE']; ?></th>
|
||||
<th><?php echo $user->lang['RANK_MINIMUM']; ?></th>
|
||||
<th><?php echo $user->lang['ACTION']; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
//
|
||||
// Show the default page
|
||||
//
|
||||
$sql = "SELECT * FROM " . RANKS_TABLE . "
|
||||
ORDER BY rank_min ASC, rank_special ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$row_class = ($row_class != 'row1') ? 'row1' : 'row2';
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><img src="../<?php echo $row['rank_image']; ?>"" border="0" alt="<?php echo $row['rank_title']; ?>" title="<?php echo $row['rank_title']; ?>" /></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $row['rank_title']; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo ($row['rank_special']) ? '-' : $row['rank_min']; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"> <a href="<?php echo "admin_ranks.$phpEx$SID&mode=edit&id=" . $row['rank_id']; ?>"><?php echo $user->lang['EDIT']; ?></a> | <a href="<?php echo "admin_ranks.$phpEx$SID&mode=delete&id=" . $row['rank_id']; ?>"><?php echo $user->lang['DELETE']; ?></a> </td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="cat" colspan="5" align="center"><input type="submit" class="mainoption" name="add" value="<?php echo $user->lang['ADD_RANK']; ?>" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
?>
|
|
@ -1,327 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* admin_search.php
|
||||
* -------------------
|
||||
* begin : Saturday, Feb 13, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if (!empty($setmodules))
|
||||
{
|
||||
if (!$auth->acl_get('a_search'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$module['DB']['SEARCH_INDEX'] = basename(__FILE__) . $SID;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
// Include files
|
||||
$phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
|
||||
|
||||
// Check permissions
|
||||
if (!$auth->acl_get('a_search'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
// Start indexing
|
||||
if (isset($_POST['start']) || isset($_GET['batchstart']))
|
||||
{
|
||||
$batchsize = 200; // Process this many posts per batch
|
||||
$batchstart = (!isset($_GET['batchstart'])) ? $row['min_post_id'] : $_GET['batchstart'];
|
||||
$batchcount = (!isset($_GET['batchcount'])) ? 1 : $_GET['batchcount'];
|
||||
$loopcount = 0;
|
||||
$batchend = $batchstart + $batchsize;
|
||||
|
||||
// Search re-indexing is tough on the server ... so we'll check the load
|
||||
// each loop and if we're on a 1min load of 3 or more we'll re-load the page
|
||||
// and try again. No idea how well this will work in practice so we'll see ...
|
||||
if (file_exists('/proc/loadavg'))
|
||||
{
|
||||
if ($load = @file('/proc/loadavg'))
|
||||
{
|
||||
list($load) = explode(' ', $load[0]);
|
||||
|
||||
if ($load > 3)
|
||||
{
|
||||
redirect("admin_search.$phpEx$SID&batchstart=$batchstart&batchcount=$batch_count");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Try and load stopword and synonym files
|
||||
$stopword_array = array();
|
||||
$synonym_array = array();
|
||||
|
||||
$dir = opendir($phpbb_root_path . 'language/');
|
||||
while ($file = readdir($dir))
|
||||
{
|
||||
if (preg_match('#^lang_#', $file) && !is_file($phpbb_root_path . 'language/' . $file) && !is_link($phpbb_root_path . 'language/' . $file))
|
||||
{
|
||||
unset($tmp_array);
|
||||
$tmp_array = @file($phpbb_root_path . 'language/' . $file . '/search_stopwords.txt');
|
||||
if (is_array($tmp_array))
|
||||
{
|
||||
$stopword_array = array_unique(array_merge($stopword_array, $tmp_array));
|
||||
}
|
||||
|
||||
unset($tmp_array);
|
||||
$tmp_array = @file($phpbb_root_path . 'language/' . $file . '/search_synonyms.txt');
|
||||
if (is_array($tmp_array))
|
||||
{
|
||||
$synonym_array = array_unique(array_merge($synonym_array, $tmp_array));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closedir($dir);
|
||||
|
||||
if (!isset($_GET['batchstart']))
|
||||
{
|
||||
// Take board offline
|
||||
set_config('board_disable', 1);
|
||||
|
||||
// Empty existing tables
|
||||
$db->sql_query("TRUNCATE " . SEARCH_TABLE);
|
||||
$db->sql_query("TRUNCATE " . SEARCH_WORD_TABLE);
|
||||
$db->sql_query("TRUNCATE " . SEARCH_MATCH_TABLE);
|
||||
}
|
||||
|
||||
// Fetch a batch of posts_text entries
|
||||
$sql = "SELECT COUNT(*) AS total, MAX(post_id) AS max_post_id, MIN(post_id) AS min_post_id
|
||||
FROM " . POSTS_TEXT_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$totalposts = $row['total'];
|
||||
$max_post_id = $row['max_post_id'];
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = "SELECT *
|
||||
FROM " . POSTS_TEXT_TABLE . "
|
||||
WHERE post_id
|
||||
BETWEEN $batchstart
|
||||
AND $batchend";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$post_id = $row['post_id'];
|
||||
|
||||
$search_raw_words = array();
|
||||
$search_raw_words['text'] = split_words(clean_words('post', $row['post_text'], $stopword_array, $synonym_array));
|
||||
$search_raw_words['title'] = split_words(clean_words('post', $row['post_subject'], $stopword_array, $synonym_array));
|
||||
|
||||
$word = array();
|
||||
$word_insert_sql = array();
|
||||
foreach ($search_raw_words as $word_in => $search_matches)
|
||||
{
|
||||
$word_insert_sql[$word_in] = '';
|
||||
if (!empty($search_matches))
|
||||
{
|
||||
for ($i = 0; $i < count($search_matches); $i++)
|
||||
{
|
||||
$search_matches[$i] = trim($search_matches[$i]);
|
||||
|
||||
if ($search_matches[$i] != '')
|
||||
{
|
||||
$word[] = $search_matches[$i];
|
||||
$word_insert_sql[$word_in] .= ($word_insert_sql[$word_in] != '') ? ", '" . $search_matches[$i] . "'" : "'" . $search_matches[$i] . "'";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($word))
|
||||
{
|
||||
$word_text_sql = '';
|
||||
$word = array_unique($word);
|
||||
|
||||
for($i = 0; $i < count($word); $i++)
|
||||
{
|
||||
$word_text_sql .= (($word_text_sql != '') ? ', ' : '') . "'" . $word[$i] . "'";
|
||||
}
|
||||
|
||||
$check_words = array();
|
||||
switch(SQL_LAYER)
|
||||
{
|
||||
case 'postgresql':
|
||||
case 'msaccess':
|
||||
case 'mssql-odbc':
|
||||
case 'oracle':
|
||||
case 'db2':
|
||||
$sql = "SELECT word_id, word_text
|
||||
FROM " . SEARCH_WORD_TABLE . "
|
||||
WHERE word_text IN ($word_text_sql)";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$check_words[$row['word_text']] = $row['word_id'];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
$value_sql = '';
|
||||
$match_word = array();
|
||||
for ($i = 0; $i < count($word); $i++)
|
||||
{
|
||||
$new_match = true;
|
||||
if (isset($check_words[$word[$i]]))
|
||||
{
|
||||
$new_match = false;
|
||||
}
|
||||
|
||||
if ($new_match)
|
||||
{
|
||||
switch(SQL_LAYER)
|
||||
{
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
$value_sql .= (($value_sql != '') ? ', ' : '') . '(\'' . $word[$i] . '\')';
|
||||
break;
|
||||
case 'mssql':
|
||||
$value_sql .= (($value_sql != '') ? ' UNION ALL ' : '') . "SELECT '" . $word[$i] . "'";
|
||||
break;
|
||||
default:
|
||||
$sql = "INSERT INTO " . SEARCH_WORD_TABLE . " (word_text)
|
||||
VALUES ('" . $word[$i] . "')";
|
||||
$db->sql_query($sql);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($value_sql != '')
|
||||
{
|
||||
switch (SQL_LAYER)
|
||||
{
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
$sql = "INSERT IGNORE INTO " . SEARCH_WORD_TABLE . " (word_text)
|
||||
VALUES $value_sql";
|
||||
break;
|
||||
case 'mssql':
|
||||
$sql = "INSERT INTO " . SEARCH_WORD_TABLE . " (word_text)
|
||||
$value_sql";
|
||||
break;
|
||||
}
|
||||
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($word_insert_sql as $word_in => $match_sql)
|
||||
{
|
||||
$title_match = ($word_in == 'title') ? 1 : 0;
|
||||
|
||||
if ($match_sql != '')
|
||||
{
|
||||
$sql = "INSERT INTO " . SEARCH_MATCH_TABLE . " (post_id, word_id, title_match)
|
||||
SELECT $post_id, word_id, $title_match
|
||||
FROM " . SEARCH_WORD_TABLE . "
|
||||
WHERE word_text IN ($match_sql)";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Remove common words after the first 2 batches and after every 4th batch after that.
|
||||
if ($batchcount % 4 == 3)
|
||||
{
|
||||
// remove_common('global', $config['common_search']);
|
||||
}
|
||||
|
||||
$batchcount++;
|
||||
|
||||
if (($batchstart + $batchsize) < $max_post_id)
|
||||
{
|
||||
redirect("Location: admin_search.$phpEx$SID&batchstart=" . ($batchstart + $batchsize) . "&batchcount=$batch_count");
|
||||
}
|
||||
else
|
||||
{
|
||||
set_config('board_disable', 0);
|
||||
page_header($user->lang['SEARCH_INDEX']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['SEARCH_INDEX']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['SEARCH_INDEX_COMPLETE']; ?></p>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
}
|
||||
else if (isset($_POST['cancel']))
|
||||
{
|
||||
set_config('board_disable', 0);
|
||||
page_header($user->lang['SEARCH_INDEX']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['SEARCH_INDEX']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['SEARCH_INDEX_CANCEL']; ?></p>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
page_header($user->lang['Search_index']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['SEARCH_INDEX']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['SEARCH_INDEX_EXPLAIN']; ?></p>
|
||||
|
||||
<form method="post" action="<?php echo "admin_search.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1">
|
||||
<tr>
|
||||
<td class="cat" height="28" align="center"> <input type="submit" name="start" value="<?php echo $user->lang['START']; ?>" class="mainoption" /> <input type="submit" name="cancel" value="<?php echo $user->lang['CANCEL']; ?>" class="mainoption" /> </td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,361 +0,0 @@
|
|||
<?php
|
||||
|
||||
if ( !empty($setmodules) )
|
||||
{
|
||||
if ( !$auth->acl_get('a_styles') )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$filename = basename(__FILE__);
|
||||
$module['STYLE']['EDIT_STYLE'] = $filename . "$SID&mode=newstyle";
|
||||
$module['STYLE']['EDIT_TEMPLATE'] = $filename . "$SID&mode=edittemplate";
|
||||
$module['STYLE']['EDIT_THEME'] = $filename . "$SID&mode=edittheme";
|
||||
$module['STYLE']['EDIT_IMAGESET'] = $filename . "$SID&mode=editimageset";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
// Include files
|
||||
$phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
// Do we have styles admin permissions?
|
||||
if (!$auth->acl_get('a_styles'))
|
||||
{
|
||||
trigger_error($user->lang['No_admin']);
|
||||
}
|
||||
|
||||
/*
|
||||
$dp = opendir($phpbb_root_path . 'templates/cache/');
|
||||
while ($file = readdir($dp))
|
||||
{
|
||||
if (!is_file($phpbb_root_path . 'templates/cache/' . $file) && !is_link($phpbb_root_path . 'templates/cache/' . $file) && $file != '.' && $file != '..')
|
||||
{
|
||||
$selected = ($tplroot == $file) ? ' selected="selected"' : '';
|
||||
$tplroot_options .= '<option name="' . $file . '"' . $selected . '>' . $file . '</option>';
|
||||
}
|
||||
}
|
||||
closedir($dp);
|
||||
*/
|
||||
|
||||
//
|
||||
$mode = (isset($_GET['mode'])) ? $_GET['mode'] : $_POST['mode'];
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
case 'editimageset':
|
||||
$imgroot = (isset($_POST['imgroot'])) ? $_POST['imgroot'] : $config['default_style'];
|
||||
|
||||
if (isset($_POST['img_addconfig']))
|
||||
{
|
||||
}
|
||||
else if (isset($_POST['img_addlocal']))
|
||||
{
|
||||
}
|
||||
|
||||
$imageset = array('imageset_path', 'post_new', 'post_locked', 'post_pm', 'reply_new', 'reply_pm', 'reply_locked', 'icon_profile', 'icon_pm', 'icon_delete', 'icon_ip', 'icon_quote', 'icon_search', 'icon_edit', 'icon_email', 'icon_www', 'icon_icq', 'icon_aim', 'icon_yim', 'icon_msnm', 'icon_no_email', 'icon_no_www', 'icon_no_icq', 'icon_no_aim', 'icon_no_yim', 'icon_no_msnm', 'goto_post', 'goto_post_new', 'goto_post_latest', 'goto_post_newest', 'forum', 'forum_new', 'forum_locked', 'sub_forum', 'sub_forum_new', 'folder', 'folder_new', 'folder_hot', 'folder_hot_new', 'folder_locked', 'folder_locked_new', 'folder_sticky', 'folder_sticky_new', 'folder_announce', 'folder_announce_new', 'topic_watch', 'topic_unwatch', 'poll_left', 'poll_center', 'poll_right', 'rating');
|
||||
|
||||
$sql = "SELECT imageset_name, imageset_path
|
||||
FROM " . STYLES_IMAGE_TABLE . "
|
||||
ORDER BY imageset_name";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$imgroot_options = '';
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$selected = ($imgroot == $row['imageset_path']) ? ' selected="selected"' : '';
|
||||
$imgroot_options .= '<option name="' . $row['imageset_path'] . '"' . $selected . '>' . $row['imageset_path'] . '</option>';
|
||||
}
|
||||
|
||||
$imgname_options = '';
|
||||
$dp = opendir($phpbb_root_path . 'imagesets/' . $imgroot . '/');
|
||||
while ($file = readdir($dp))
|
||||
{
|
||||
if (preg_match('#\.(gif|png|jpg|jpeg)$#', $file) && is_file($phpbb_root_path . 'imagesets/' . $imgroot . '/' . $file))
|
||||
{
|
||||
$selected = ($imgname == $file) ? ' selected="selected"' : '';
|
||||
$imgname_options .= '<option value="' . $file . '"' . $selected . '>' . $file . '</option>';
|
||||
}
|
||||
}
|
||||
closedir($dp);
|
||||
|
||||
// Output page
|
||||
page_header($user->lang['Edit_Imageset']);
|
||||
|
||||
?>
|
||||
|
||||
<form method="post" action="admin_styles.<?php echo $phpEx . $SID; ?>&mode=editimageset">
|
||||
|
||||
<h2>Edit Imageset</h2>
|
||||
|
||||
<p>Template set: <select name="imgroot"><?php echo $imgroot_options; ?></select> <input class="liteoption" type="submit" name="img_root" value="Select set" /> <input class="liteoption" type="submit" name="create" value="Create new set" /></p>
|
||||
|
||||
<p>Here you can create, edit, delete and download imagesets.</p>
|
||||
|
||||
<?php
|
||||
|
||||
if (isset($_POST['img_root']))
|
||||
{
|
||||
$sql = "SELECT *
|
||||
FROM " . STYLES_IMAGE_TABLE . "
|
||||
WHERE imageset_path LIKE '" . $_POST['imgroot'] . "'";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$images = $db->sql_fetchrow($result);
|
||||
|
||||
?>
|
||||
<table class="bg" cellspacing="1" cellpadding="2" border="0" align="center">
|
||||
<tr>
|
||||
<th height="25">Image</th><th>Graphic</th><th> </th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
for($i = 1; $i < count($imageset); $i++)
|
||||
{
|
||||
$row_class = (!($i%2)) ? 'row1' : 'row2';
|
||||
|
||||
$img = (!empty($images[$imageset[$i]])) ? '<img src=' . $images[$imageset[$i]] . ' />' : '';
|
||||
$img = str_replace('"imagesets/', '"../imagesets/', $img);
|
||||
$img = str_replace('{LANG}', $user->img_lang, $img);
|
||||
$img = str_replace('{RATE}', 3, $img);
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>" height="25"><span class="gen"><?php echo ucfirst(str_replace('_', ' ', $imageset[$i])); ?></span></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $img; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"> <input class="liteoption" type="submit" value="Edit" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="cat" colspan="3" height="28" align="center"> <input class="liteoption" type="submit" name="download" value="Download set" <input class="liteoption" type="submit" name="img_delete" value="Delete set" /> </td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
page_footer();
|
||||
|
||||
break;
|
||||
|
||||
case 'edittemplate':
|
||||
|
||||
$tplcols = (isset($_POST['tplcols'])) ? max(60, intval($_POST['tplcols'])) : 90;
|
||||
$tplrows = (isset($_POST['tplrows'])) ? max(4, intval($_POST['tplrows'])) : 30;
|
||||
$tplname = (isset($_POST['tplname'])) ? $_POST['tplname'] : '';
|
||||
$tplroot = (isset($_POST['tplroot'])) ? $_POST['tplroot'] : 'subSilver';
|
||||
|
||||
$str = '';
|
||||
if (isset($_POST['tpl_compile']) && !empty($_POST['decompile']))
|
||||
{
|
||||
$str = "<?php\n" . $template->compile(stripslashes($_POST['decompile'])) . "\n?".">";
|
||||
|
||||
$fp = fopen($phpbb_root_path . 'templates/cache/' . $tplroot . '/' . $tplname . '.html.' . $phpEx, 'w+');
|
||||
fwrite ($fp, $str);
|
||||
fclose($fp);
|
||||
|
||||
@chmod($phpbb_root_path . 'templates/cache/' . $tplroot . '/' . $tplname . '.html.' . $phpEx, 0644);
|
||||
|
||||
add_log('admin', 'log_template_edit', $tplname, $tplroot);
|
||||
|
||||
exit;
|
||||
}
|
||||
else if (!empty($tplname) && isset($_POST['tpl_name']))
|
||||
{
|
||||
$fp = fopen($phpbb_root_path . 'templates/cache/' . $tplroot . '/' . $tplname . '.html.' . $phpEx, 'r');
|
||||
while (!feof($fp))
|
||||
{
|
||||
$str .= fread($fp, 4096);
|
||||
}
|
||||
@fclose($fp);
|
||||
|
||||
$template->decompile($str);
|
||||
}
|
||||
else
|
||||
{
|
||||
$str = (!empty($_POST['decompile'])) ? stripslashes($_POST['decompile']) : '';
|
||||
}
|
||||
|
||||
if (isset($_POST['tpl_download']))
|
||||
{
|
||||
header("Content-Type: text/html; name=\"" . $tplname . ".html\"");
|
||||
header("Content-disposition: attachment; filename=" . $tplname . ".html");
|
||||
echo $str;
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
$tplroot_options = get_templates($tplroot);
|
||||
|
||||
$tplname_options = '';
|
||||
$dp = @opendir($phpbb_root_path . 'templates/cache/' . $tplroot . '/');
|
||||
while ($file = readdir($dp))
|
||||
{
|
||||
if (strstr($file, '.html.' . $phpEx) && is_file($phpbb_root_path . 'templates/cache/' . $tplroot . '/' . $file))
|
||||
{
|
||||
$tpl = substr($file, 0, strpos($file, '.'));
|
||||
$selected = ($tplname == $tpl) ? ' selected="selected"' : '';
|
||||
$tplname_options .= '<option value="' . $tpl . '"' . $selected . '>' . $tpl . '</option>';
|
||||
}
|
||||
}
|
||||
closedir($dp);
|
||||
|
||||
//
|
||||
page_header($user->lang['Edit_template']);
|
||||
|
||||
?>
|
||||
|
||||
<h2><?php echo $user->lang['Edit_template']; ?></h2>
|
||||
|
||||
<p><?php echo $user->lang['Edit_template_explain']; ?></p>
|
||||
|
||||
<form method="post" action="<?php echo "admin_styles.$phpEx$SID&mode=edittemplate"; ?>">
|
||||
|
||||
<p><?php echo $user->lang['Select_template']; ?>: <select name="tplroot"><?php echo $tplroot_options; ?></select> <input class="liteoption" type="submit" name="tpl_root" value="Select" /></p>
|
||||
|
||||
<table class="bg" width="95%" cellspacing="1" cellpadding="0" border="0" align="center">
|
||||
<tr>
|
||||
<td class="cat"><table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td> Template: <select name="tplname"><?php echo $tplname_options; ?></select> <input class="liteoption" type="submit" name="tpl_name" value="Select" /></td>
|
||||
|
||||
<td align="right">Columns: <input type="text" name="tplcols" size="3" maxlength="3" value="<?php echo $tplcols; ?>" /> Rows: <input type="text" name="tplrows" size="3" maxlength="3" value="<?php echo $tplrows; ?>" /> <input class="liteoption" type="submit" name="tpl_layout" value="Update" /> </td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center"><textarea class="edit" style="background-color:#DEE3E7" cols="<?php echo $tplcols; ?>" rows="<?php echo $tplrows; ?>" name="decompile"><?php echo htmlentities($str); ?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" height="28" align="center"><input class="liteoption" type="submit" name="tpl_compile" value="Recompile" /> <input class="liteoption" type="submit" name="tpl_download" value="Download" /> <input class="liteoption" type="reset" value="Undo" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
break;
|
||||
|
||||
case 'edittheme':
|
||||
|
||||
$theme_id = (isset($_POST['themeroot'])) ? $_POST['themeroot'] : '';
|
||||
|
||||
if (isset($_POST['update']))
|
||||
{
|
||||
$sql = "SELECT theme_id, theme_name
|
||||
FROM " . STYLES_CSS_TABLE . "
|
||||
WHERE theme_id = $theme_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$theme_name = $row['theme_name'];
|
||||
|
||||
$css_data = (!empty($_POST['css_data'])) ? htmlentities($_POST['css_data']) : '';
|
||||
$css_external = (!empty($_POST['css_data'])) ? $_POST['css_data'] : '';
|
||||
|
||||
$sql = "UPDATE " > STYLES_CSS_TABLE . "
|
||||
SET css_data = '$css_data', css_external = '$css_external'
|
||||
WHERE theme_id = $theme_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
add_log('admin', 'log_theme_edit', $theme_name);
|
||||
|
||||
message_die(MESSAGE, $user->lang['Success_theme_update']);
|
||||
}
|
||||
}
|
||||
|
||||
page_header($user->lang['Edit_theme']);
|
||||
|
||||
$sql = "SELECT theme_id, theme_name
|
||||
FROM " . STYLES_CSS_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$theme_options = '';
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$theme_options .= (($theme_options != '') ? ', ' : '') . '<option value="' . $row['theme_id'] . '">' . $row['theme_name'] . '</option>';
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$css_data = '';
|
||||
$css_external = '';
|
||||
if ($theme_id)
|
||||
{
|
||||
$sql = "SELECT css_data, css_external
|
||||
FROM " . STYLES_CSS_TABLE . "
|
||||
WHERE theme_id = $theme_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$css_data = preg_replace('/\t{1,}/i', ' ', $row['css_data']);
|
||||
$css_external = $row['css_external'];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<form method="post" action="<?php echo "admin_styles.$phpEx$SID&mode=$mode"; ?>">
|
||||
|
||||
<h2><?php echo $user->lang['Edit_theme']; ?></h2>
|
||||
|
||||
<p><?php echo $user->lang['Edit_theme_explain']; ?></p>
|
||||
|
||||
<table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><?php echo $user->lang['Select_theme']; ?>: <select name="themeroot"><?php echo $theme_options; ?></select> <input class="liteoption" type="submit" name="tpl_root" value="<?php echo $user->lang['Select']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['CSS_data']; ?>: <br /><span class="gensmall"><?php echo $user->lang['CSS_data_explain']; ?></td>
|
||||
<td class="row2"><textarea class="edit" cols="65" rows="15" name="css_data"><?php echo htmlentities($css_data); ?></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['CSS_sheet']; ?>: </td>
|
||||
<td class="row2"><input type="text" name="css_external" maxlength="60" size="60" value="<?php echo $css_external; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><input class="liteoption" type="submit" name="update" value="<?php echo $user->lang['Update']; ?>" /> <input class="liteoption" type="reset" value="<?php echo $user->lang['Reset']; ?>" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
function get_templates($tplroot = '')
|
||||
{
|
||||
global $db;
|
||||
|
||||
$sql = "SELECT template_name, template_path
|
||||
FROM " . STYLES_TPL_TABLE . "
|
||||
ORDER BY template_name";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$tplroot_options = '';
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$selected = ($tplroot == $row['template_path']) ? ' selected="selected"' : '';
|
||||
$tplroot_options .= '<option value="' . $row['template_path'] . '"' . $selected . '>' . $row['template_path'] . '</option>';
|
||||
}
|
||||
|
||||
return $tplroot_options;
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,361 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* admin_users.php
|
||||
* -------------------
|
||||
* begin : Saturday, Feb 13, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if (!empty($setmodules))
|
||||
{
|
||||
if (!$auth->acl_gets('a_user', 'a_useradd', 'a_userdel'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$module['USER']['MANAGE'] = basename(__FILE__) . $SID;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
// Include files
|
||||
$phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
// Set mode
|
||||
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : 'main';
|
||||
|
||||
// Begin program
|
||||
if (isset($_POST['username']) || isset($_GET['u']) || isset($_POST['u']))
|
||||
{
|
||||
// Grab relevant userdata
|
||||
if(isset($_REQUEST['u']))
|
||||
{
|
||||
$user_id = intval($_REQUEST['u']);
|
||||
|
||||
if(!($userdata = get_userdata($user_id)))
|
||||
{
|
||||
trigger_error($user->lang['No_user_id_specified']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!$userdata = get_userdata($_POST['username']))
|
||||
{
|
||||
trigger_error($user->lang['No_user_id_specified']);
|
||||
}
|
||||
}
|
||||
|
||||
// Update entry in DB
|
||||
if ($_POST['deleteuser'] && !$userdata['user_founder'])
|
||||
{
|
||||
if (!$auth->acl_get('a_userdel'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
$db->sql_transaction();
|
||||
|
||||
$sql = "UPDATE " . POSTS_TABLE . "
|
||||
SET poster_id = " . ANONYMOUS . ", post_username = '$username'
|
||||
WHERE poster_id = $user_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = "UPDATE " . TOPICS_TABLE . "
|
||||
SET topic_poster = " . ANONYMOUS . "
|
||||
WHERE topic_poster = $user_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = "DELETE FROM " . USERS_TABLE . "
|
||||
WHERE user_id = $user_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = "DELETE FROM " . USER_GROUP_TABLE . "
|
||||
WHERE user_id = $user_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "
|
||||
WHERE user_id = $user_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = "DELETE FROM " . FORUMS_WATCH_TABLE . "
|
||||
WHERE user_id = $user_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = "DELETE FROM " . ACL_USERS_TABLE . "
|
||||
WHERE user_id = $user_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$db->sql_transaction('commit');
|
||||
|
||||
trigger_error($user->lang['User_deleted']);
|
||||
}
|
||||
|
||||
|
||||
// Output relevant page
|
||||
page_header($user->lang['Manage']);
|
||||
|
||||
?>
|
||||
|
||||
<form method="post" action="admin_users.<?php echo $phpEx . $SID; ?>&mode=<?php echo $mode; ?>&u=<?php echo $userdata['user_id']; ?>"><table width="90%" cellspacing="3" cellpadding="0" border="0" align="center">
|
||||
<tr>
|
||||
<td align="right"><b>Main</b> | <a href="admin_users.<?php echo $phpEx . $SID; ?>&u=<?php echo $userdata['user_id']; ?>&mode=profile">Profile</a> | <a href="admin_users.<?php echo $phpEx . $SID; ?>&u=<?php echo $userdata['user_id']; ?>&mode=pref">Preferences</a> | <a href="admin_users.<?php echo $phpEx . $SID; ?>&u=<?php echo $userdata['user_id']; ?>&mode=avatar">Avatar</a> | <a href="admin_users.<?php echo $phpEx . $SID; ?>&u=<?php echo $userdata['user_id']; ?>&mode=permissions">Permissions</a></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
case 'main':
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0">
|
||||
<tr>
|
||||
<td class="row1">Username: <br /><span class="gensmall">Click profile to edit</span></td>
|
||||
<td class="row2"><?php echo $userdata['username']; ?> [ <a href="admin_ban.<?php echo $phpEx . $SID; ?>&mode=user&ban=<?php echo $userdata['username']; ?>&bansubmit=true">Ban</a> ]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1">Registered: </td>
|
||||
<td class="row2"><?php echo $user->format_date($userdata['user_regdate']); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1">Registered from IP: </td>
|
||||
<td class="row2"><?php if ($userdata['user_ip']) { echo $userdata['user_ip']; ?> [ <a href="admin_users.<?php echo $phpEx . $SID; ?>&u=<?php echo $userdata['user_id']; ?>&mode=main&do=iplookup">Lookup</a> | <a href="admin_ban.<?php echo $phpEx . $SID; ?>&mode=ip&ban=<?php echo $userdata['user_ip']; ?>&bansubmit=true">Ban</a> ] <?php } else { echo 'Unknown'; } ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
if (isset($_GET['do']) && $_GET['do'] == 'iplookup')
|
||||
{
|
||||
if ($userdata['user_ip'] != '' && $domain = gethostbyaddr($userdata['user_ip']))
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<th colspan="2">IP whois for <?php echo $domain; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" colspan="2"><?php
|
||||
|
||||
if ($ipwhois = ipwhois($userdata['user_ip']))
|
||||
{
|
||||
echo '<br /><pre align="left">' . trim($ipwhois) . '</pre>';
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1">Total/Average posts by this user: </td>
|
||||
<td class="row2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"></td>
|
||||
<td class="row2"></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
break;
|
||||
|
||||
case 'permissions':
|
||||
|
||||
$userauth = new auth();
|
||||
$userauth->acl($userdata);
|
||||
|
||||
foreach ($acl_options['global'] as $option_name => $option_id)
|
||||
{
|
||||
$type = substr($option_name, 0, strpos('_', $option_name) +1);
|
||||
$global[$type][$option_name] = $userauth->acl_get($option_name);
|
||||
}
|
||||
|
||||
$sql = "SELECT forum_id, forum_name
|
||||
FROM " . FORUMS_TABLE . "
|
||||
ORDER BY left_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$permissions = array();
|
||||
while($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$forum_data[$row['forum_id']] = $row['forum_name'];
|
||||
|
||||
foreach ($acl_options['local'] as $option_name => $option_id)
|
||||
{
|
||||
$local[$row['forum_id']][$option_name] = $userauth->acl_get($option_name, $row['forum_id']);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="2"><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<td class="cat" colspan="3" align="right">Select permission set: <select name="acl_type"><?php
|
||||
|
||||
$acl_types = '<option>Global Settings</option><option>---------------</option>';
|
||||
$acl_types .= '<option value="a">' . $user->lang['ADMINISTRATOR'] . '</option><option value="u">' . $user->lang['USER'] . '</option>';
|
||||
$acl_types .= '<option>Forum Settings</option><option>---------------</option>';
|
||||
$acl_types .= make_forum_select(false, false, false);
|
||||
|
||||
echo $acl_types;
|
||||
|
||||
?></select> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th> <?php echo $user->lang['Option']; ?> </th>
|
||||
<th> <?php echo $user->lang['Allow']; ?> </th>
|
||||
<th> <?php echo $user->lang['Deny']; ?> </th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
foreach ($global as $type => $auth_ary)
|
||||
{
|
||||
foreach ($auth_ary as $option => $allow)
|
||||
{
|
||||
if ($option != $type .'_')
|
||||
{
|
||||
$row_class = ($row_class == 'row1') ? 'row2' : 'row1';
|
||||
|
||||
$l_can_cell = (!empty($user->lang['acl_' . $option])) ? $user->lang['acl_' . $option] : ucfirst(preg_replace('#.*?_#', '', $option));
|
||||
|
||||
$allow_type = ($allow == ACL_ALLOW) ? ' checked="checked"' : '';
|
||||
$deny_type = ($allow == ACL_DENY) ? ' checked="checked"' : '';
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>"><?php echo $l_can_cell; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><input type="radio"<?php echo $allow_type; ?> /></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><input type="radio"<?php echo $deny_type; ?> /></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<?php
|
||||
|
||||
foreach ($local as $forum_id => $auth_ary)
|
||||
{
|
||||
|
||||
?>
|
||||
<td class="row1"><?php echo $forum_data[$forum_id]; ?></td>
|
||||
<td><table cellspacing="1" cellpadding="0" border="0">
|
||||
<?php
|
||||
|
||||
foreach ($auth_ary as $option => $allow)
|
||||
{
|
||||
echo '<tr><td>' . $user->lang['acl_' . $option] . ' => ' . (($allow) ? 'Allowed' : 'Denied') . '</td></tr>';
|
||||
}
|
||||
|
||||
?>
|
||||
</table></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
page_footer();
|
||||
|
||||
}
|
||||
|
||||
// Do we have permission?
|
||||
if (!$auth->acl_get('a_user'))
|
||||
{
|
||||
trigger_error($user->lang['No_admin']);
|
||||
}
|
||||
|
||||
page_header($user->lang['Manage']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['User_admin']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['User_admin_explain']; ?></p>
|
||||
|
||||
<form method="post" name="post" action="admin_users.<?php echo $phpEx.$SID; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th align="center"><?php echo $user->lang['Select_a_User']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" align="center"><input type="text" class="post" name="username" maxlength="50" size="20" /> <input type="submit" name="submituser" value="<?php echo $user->lang['Look_up_user']; ?>" class="mainoption" /> <input type="submit" name="usersubmit" value="<?php echo $user->lang['Find_username']; ?>" class="liteoption" onClick="window.open('<?php echo "../memberlist.$phpEx$SID&mode=searchuser&field=username"; ?>', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=740');return false;" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
page_footer();
|
||||
|
||||
// ---------
|
||||
// FUNCTIONS
|
||||
function ipwhois($ip)
|
||||
{
|
||||
$ipwhois = '';
|
||||
|
||||
$match = array(
|
||||
'#RIPE\.NET#is' => 'whois.ripe.net',
|
||||
'#whois\.apnic\.net#is' => 'whois.apnic.net',
|
||||
'#nic\.ad\.jp#is' => 'whois.nic.ad.jp',
|
||||
'#whois\.registro\.br#is' => 'whois.registro.br'
|
||||
);
|
||||
|
||||
if (($fsk = fsockopen('whois.arin.net', 43)))
|
||||
{
|
||||
@fputs($fsk, "$ip\n");
|
||||
while (!feof($fsk))
|
||||
{
|
||||
$ipwhois .= fgets($fsk, 1024);
|
||||
}
|
||||
fclose($fsk);
|
||||
}
|
||||
|
||||
foreach (array_keys($match) as $server)
|
||||
{
|
||||
if (preg_match($server, $ipwhois))
|
||||
{
|
||||
$ipwhois = '';
|
||||
if (($fsk = fsockopen($match[$server], 43)))
|
||||
{
|
||||
@fputs($fsk, "$ip\n");
|
||||
while (!feof($fsk))
|
||||
{
|
||||
$ipwhois .= fgets($fsk, 1024);
|
||||
}
|
||||
fclose($fsk);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $ipwhois;
|
||||
}
|
||||
// FUNCTIONS
|
||||
// ---------
|
||||
|
||||
?>
|
|
@ -1,254 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* admin_viewlogs.php
|
||||
* -------------------
|
||||
* begin : Friday, May 11, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if (!empty($setmodules))
|
||||
{
|
||||
if (!$auth->acl_get('a_general'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$filename = basename(__FILE__);
|
||||
$module['LOG']['ADMIN_LOGS'] = $filename . "$SID&mode=admin";
|
||||
$module['LOG']['MOD_LOGS'] = $filename . "$SID&mode=mod";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
// Include files
|
||||
$phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
// Do we have styles admin permissions?
|
||||
if (!$auth->acl_get('a_general'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
// Set some variables
|
||||
$forum_id = (isset($_REQUEST['f'])) ? intval($_REQUEST['f']) : 0;
|
||||
$start = (isset($_GET['start'])) ? intval($_GET['start']) : 0;
|
||||
$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : 'admin';
|
||||
|
||||
// Define some vars depending on which logs we're looking at
|
||||
$log_table_sql = ($mode == 'admin') ? LOG_ADMIN_TABLE : LOG_MOD_TABLE;
|
||||
$l_title = ($mode == 'admin') ? $user->lang['ADMIN_LOGS'] : $user->lang['MOD_LOGS'];
|
||||
$l_title_explain = ($mode == 'admin') ? $user->lang['ADMIN_LOGS_EXPLAIN'] : $user->lang['MOD_LOGS_EXPLAIN'];
|
||||
|
||||
// Delete entries if requested and able
|
||||
if ((isset($_POST['delmarked']) || isset($_POST['delall'])) && $auth->acl_get('a_clearlogs'))
|
||||
{
|
||||
$where_sql = '';
|
||||
if (isset($_POST['delmarked']) && isset($_POST['mark']))
|
||||
{
|
||||
foreach ($_POST['mark'] as $marked)
|
||||
{
|
||||
$where_sql .= (($where_sql != '') ? ', ' : '') . intval($marked);
|
||||
}
|
||||
$where_sql = "WHERE log_id IN ($where_sql)";
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM $table_sql
|
||||
$where_sql";
|
||||
$db->sql_query($sql);
|
||||
|
||||
add_log('admin', 'log_' . $mode . '_clear');
|
||||
}
|
||||
|
||||
// Sorting ... this could become a function
|
||||
if (isset($_POST['sort']) || $start)
|
||||
{
|
||||
if (!empty($_POST['sort_days']))
|
||||
{
|
||||
$sort_days = intval($_POST['sort_days']);
|
||||
$where_sql = time() - ($sort_days * 86400);
|
||||
}
|
||||
else
|
||||
{
|
||||
$where_sql = 0;
|
||||
}
|
||||
|
||||
$sort_key = (isset($_POST['sort_key'])) ? $_POST['sort_key'] : '';
|
||||
$sort_dir = (isset($_POST['sort_dir'])) ? $_POST['sort_dir'] : '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$where_sql = 0;
|
||||
|
||||
$sort_days = 0;
|
||||
$sort_key = 't';
|
||||
$sort_dir = 'd';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$previous_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 364 => $user->lang['1_YEAR']);
|
||||
$sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']);
|
||||
$sort_by = array('u' => 'l.user_id', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
|
||||
|
||||
$sort_day_options = '';
|
||||
foreach ($previous_days as $day => $text)
|
||||
{
|
||||
$selected = ($sort_days == $day) ? ' selected="selected"' : '';
|
||||
$sort_day_options .= '<option value="' . $day . '"' . $selected . '>' . $text . '</option>';
|
||||
}
|
||||
|
||||
$sort_key_options = '';
|
||||
foreach ($sort_by_text as $key => $text)
|
||||
{
|
||||
$selected = ($sort_key == $key) ? ' selected="selected"' : '';
|
||||
$sort_key_options .= '<option value="' . $key . '"' . $selected . '>' . $text . '</option>';
|
||||
}
|
||||
|
||||
$sort_order_options = ($sort_dir == 'a') ? '<option value="a" selected="selected">' . $user->lang['SORT_ASCENDING'] . '</option><option value="d">' . $user->lang['SORT_DESCENDING'] . '</option>' : '<option value="a">' . $user->lang['SORT_ASCENDING'] . '</option><option value="d" selected="selected">' . $user->lang['SORT_DESCENDING'] . '</option>';
|
||||
|
||||
$sort_sql = $sort_by[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
|
||||
|
||||
// Output page
|
||||
page_header($l_title);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $l_title; ?></h1>
|
||||
|
||||
<p><?php echo $l_title_explain; ?></p>
|
||||
|
||||
<form method="post" action="<?php echo "admin_viewlogs.$phpEx$SID&mode=$mode"; ?>">
|
||||
<?php
|
||||
|
||||
// Define forum list if we're looking @ mod logs
|
||||
if ($mode == 'mod')
|
||||
{
|
||||
|
||||
$forum_box = '<option value="0">' . $user->lang['ALL_FORUMS'] . '</option>' . make_forum_select($forum_id, false, false);
|
||||
|
||||
?>
|
||||
<table width="100%" cellpadding="1" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<td align="right"><?php echo $user->lang['SELECT_FORUM']; ?>: <select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ this.form.submit() }"><?php echo $forum_box; ?></select> <input class="liteoption" type="submit" value="<?php echo $user->lang['GO']; ?>" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<td class="cat" colspan="5" height="28" align="center"><span class="gensmall"><?php echo $user->lang['DISPLAY_LOG']; ?>: <select name="sort_days"><?php echo $sort_day_options; ?></select> <?php echo $user->lang['SORT_BY']; ?> <select name="sort_key"><?php echo $sort_key_options; ?></select> <select name="sort_dir"><?php echo $sort_order_options; ?></select> <input class="liteoption" type="submit" value="<?php echo $user->lang['GO']; ?>" name="sort" /></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th width="15%" height="25" nowrap="nowrap"><?php echo $user->lang['USERNAME']; ?></th>
|
||||
<th width="15%" nowrap="nowrap"><?php echo $user->lang['IP']; ?></th>
|
||||
<th width="20%" nowrap="nowrap"><?php echo $user->lang['TIME']; ?></th>
|
||||
<th width="45%" nowrap="nowrap"><?php echo $user->lang['ACTION']; ?></th>
|
||||
<th nowrap="nowrap"><?php echo $user->lang['MARK']; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
//
|
||||
// Grab log data
|
||||
//
|
||||
$log_data = array();
|
||||
$log_count = 0;
|
||||
view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, $where_sql, $sort_sql);
|
||||
|
||||
if ($log_count)
|
||||
{
|
||||
for($i = 0; $i < sizeof($log_data); $i++)
|
||||
{
|
||||
$row_class = ($row_class == 'row1') ? 'row2' : 'row1';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>" nowrap="nowrap"><?php echo $log_data[$i]['username']; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center" nowrap="nowrap"><?php echo $log_data[$i]['ip']; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center" nowrap="nowrap"><?php echo $user->format_date($log_data[$i]['time']); ?></td>
|
||||
<td class="<?php echo $row_class; ?>"><?php echo $log_data[$i]['action']; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center" nowrap="nowrap"><input type="checkbox" name="mark[]" value="<?php echo $log_data[$i]['id']; ?>" /></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
if ($auth->acl_get('a_clearlogs'))
|
||||
{
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="cat" colspan="5" height="28" align="right"><input class="liteoption" type="submit" name="delmarked" value="<?php echo $user->lang['DELETE_MARKED']; ?>" /> <input class="liteoption" type="submit" name="delall" value="<?php echo $user->lang['DELETE_ALL']; ?>" /> </td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1" colspan="5" align="center" nowrap="nowrap"><?php echo $user->lang['NO_ENTRIES']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
</table>
|
||||
|
||||
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
|
||||
<tr>
|
||||
<td align="left" valign="top"> <span class="nav"><?php echo on_page($log_count, $config['topics_per_page'], $start); ?></span></td>
|
||||
<td align="right" valign="top" nowrap="nowrap"><?php
|
||||
|
||||
if ($auth->acl_get('a_clearlogs'))
|
||||
{
|
||||
|
||||
|
||||
?><b><span class="gensmall"><a href="javascript:marklist(true);" class="gensmall"><?php echo $user->lang['MARK_ALL']; ?></a> :: <a href="javascript:marklist(false);" class="gensmall"><?php echo $user->lang['UNMARK_ALL']; ?></a></span></b> <br /><br /><?php
|
||||
|
||||
}
|
||||
|
||||
$pagination = generate_pagination("admin_viewlogs.$phpEx$SID&mode=$mode&sort_days=$sort_days&sort_key=$sort_key&sort_dir=$sort_dir", $log_count, $config['topics_per_page'], $start);
|
||||
|
||||
?><span class="nav"><?php echo $pagination; ?></span></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<script language="Javascript" type="text/javascript">
|
||||
<!--
|
||||
function marklist(status)
|
||||
{
|
||||
for (i = 0; i < document.log.length; i++)
|
||||
{
|
||||
document.log.elements[i].checked = status;
|
||||
}
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
?>
|
|
@ -1,229 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* admin_words.php
|
||||
* -------------------
|
||||
* begin : Thursday, Jul 12, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if (!empty($setmodules))
|
||||
{
|
||||
if (!$auth->acl_get('a_words'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$module['POST']['WORD_CENSOR'] = basename(__FILE__) . $SID;
|
||||
return;
|
||||
}
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
// Include files
|
||||
$phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
// Do we have forum admin permissions?
|
||||
if (!$auth->acl_get('a_words'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
// What do we want to do?
|
||||
if (isset($_REQUEST['mode']))
|
||||
{
|
||||
$mode = $_REQUEST['mode'];
|
||||
}
|
||||
else
|
||||
{
|
||||
// These could be entered via a form button
|
||||
if (isset($_POST['add']))
|
||||
{
|
||||
$mode = 'add';
|
||||
}
|
||||
else if (isset($_POST['save']))
|
||||
{
|
||||
$mode = 'save';
|
||||
}
|
||||
else
|
||||
{
|
||||
$mode = '';
|
||||
}
|
||||
}
|
||||
|
||||
if ($mode != '')
|
||||
{
|
||||
switch ($mode)
|
||||
{
|
||||
case 'edit':
|
||||
case 'add':
|
||||
$word_id = (isset($_GET['id'])) ? intval($_GET['id']) : 0;
|
||||
|
||||
$s_hidden_fields = '';
|
||||
if ($mode == 'edit')
|
||||
{
|
||||
if (!$word_id)
|
||||
{
|
||||
trigger_error($user->lang['NO_WORD']);
|
||||
}
|
||||
|
||||
$sql = "SELECT *
|
||||
FROM " . WORDS_TABLE . "
|
||||
WHERE word_id = $word_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$word_info = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$s_hidden_fields .= '<input type="hidden" name="id" value="' . $word_id . '" />';
|
||||
}
|
||||
|
||||
page_header($user->lang['WORDS_TITLE']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['WORDS_TITLE']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['WORDS_EXPLAIN']; ?></p>
|
||||
|
||||
<form method="post" action="<?php echo "admin_words.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th colspan="2"><?php echo $user->lang['EDIT_WORD']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['WORD']; ?></td>
|
||||
<td class="row2"><input type="text" name="word" value="<?php echo $word_info['word']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><?php echo $user->lang['REPLACEMENT']; ?></td>
|
||||
<td class="row2"><input type="text" name="replacement" value="<?php echo $word_info['replacement']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="cat" colspan="2" align="center"><?php echo $s_hidden_fields; ?><input class="mainoption" type="submit" name="save" value="<?php echo $user->lang['SUBMIT']; ?>" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
break;
|
||||
|
||||
case 'save':
|
||||
$word_id = (isset($_POST['id'])) ? intval($_POST['id']) : 0;
|
||||
$word = (isset($_POST['word'])) ? trim($_POST['word']) : '';
|
||||
$replacement = (isset($_POST['replacement'])) ? trim($_POST['replacement']) : '';
|
||||
|
||||
if ($word == '' || $replacement == '')
|
||||
{
|
||||
trigger_error($user->lang['ENTER_WORD']);
|
||||
}
|
||||
|
||||
$sql = ($word_id) ? "UPDATE " . WORDS_TABLE . " SET word = '" . $db->sql_escape($word) . "', replacement = '" . $db->sql_escape($replacement) . "' WHERE word_id = $word_id" : "INSERT INTO " . WORDS_TABLE . " (word, replacement) VALUES ('" . $db->sql_escape($word) . "', '" . $db->sql_escape($replacement) . "')";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$cache->destroy('word_censors');
|
||||
|
||||
$log_action = ($word_id) ? 'log_edit_word' : 'log_add_word';
|
||||
add_log('admin', $log_action, stripslashes($word));
|
||||
|
||||
$message = ($word_id) ? $user->lang['WORD_UPDATED'] : $user->lang['WORD_ADDED'];
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
|
||||
if (isset($_POST['id']) || isset($_GET['id']))
|
||||
{
|
||||
$word_id = (isset($_POST['id'])) ? intval($_POST['id']) : intval($_GET['id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error($user->lang['NO_WORD']);
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM " . WORDS_TABLE . "
|
||||
WHERE word_id = $word_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$cache->destroy('word_censors');
|
||||
|
||||
add_log('admin', 'log_delete_word');
|
||||
|
||||
$message = $user->lang['WORD_REMOVE'];
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
trigger_error($message);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
page_header($user->lang['WORDS_TITLE']);
|
||||
|
||||
?>
|
||||
|
||||
<h1><?php echo $user->lang['WORDS_TITLE']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['WORDS_EXPLAIN']; ?></p>
|
||||
|
||||
<form method="post" action="admin_words.<?php echo $phpEx . $SID; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th><?php echo $user->lang['WORD']; ?></th>
|
||||
<th><?php echo $user->lang['REPLACEMENT']; ?></th>
|
||||
<th colspan="2"><?php echo $user->lang['ACTION']; ?></th>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
$sql = "SELECT *
|
||||
FROM " . WORDS_TABLE . "
|
||||
ORDER BY word";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$row_class = ($row_class == 'row1') ? 'row2' : 'row1';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $row['word']; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $row['replacement']; ?></td>
|
||||
<td class="<?php echo $row_class; ?>"> <a href="<?php echo "admin_words.$phpEx$SID&mode=edit&id=" . $row['word_id']; ?>"><?php echo $user->lang['EDIT']; ?></a> </td>
|
||||
<td class="<?php echo $row_class; ?>"> <a href="<?php echo "admin_words.$phpEx$SID&mode=delete&id=" . $row['word_id']; ?>"><?php echo $user->lang['DELETE']; ?></a> </td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="cat" colspan="5" height="28" align="center"><?php echo $s_hidden_fields; ?><input class="mainoption" type="submit" name="add" value="<?php echo $user->lang['ADD_WORD']; ?>" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer();
|
||||
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,13 +0,0 @@
|
|||
/* Fancy form styles for IE */
|
||||
|
||||
input, textarea, select {
|
||||
border-width: 1px;
|
||||
}
|
||||
|
||||
input {
|
||||
text-indent: 2px;
|
||||
}
|
||||
|
||||
.postbody {
|
||||
line-height: 18px
|
||||
}
|
Before Width: | Height: | Size: 246 B |
Before Width: | Height: | Size: 257 B |
Before Width: | Height: | Size: 385 B |
Before Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 677 B |
Before Width: | Height: | Size: 673 B |
Before Width: | Height: | Size: 1.4 KiB |
|
@ -1,521 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* index.php [ admin/ ]
|
||||
* -------------------
|
||||
* begin : Saturday, Feb 13, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
// Define some vars
|
||||
$pane = (isset($_GET['pane'])) ? $_GET['pane'] : '';
|
||||
$update = ($pane == 'right') ? true : false;
|
||||
|
||||
define('IN_PHPBB', 1);
|
||||
// Include files
|
||||
$phpbb_root_path = '../';
|
||||
require($phpbb_root_path . 'extension.inc');
|
||||
require('pagestart.' . $phpEx);
|
||||
|
||||
// Do we have any admin permissions at all?
|
||||
if (!$auth->acl_get('a_'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
// Generate relevant output
|
||||
if (isset($_GET['pane']) && $_GET['pane'] == 'top')
|
||||
{
|
||||
page_header('', '', false);
|
||||
|
||||
?>
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td><a href="../index.<?php echo $phpEx . $SID; ?>" target="_top"><img src="images/header_left.jpg" width="200" height="60" alt="phpBB Logo" title="phpBB Logo" border="0"/></a></td>
|
||||
<td width="100%" background="images/header_bg.jpg" height="60" align="right" nowrap="nowrap"><span class="maintitle"><?php echo $user->lang['ADMIN_TITLE']; ?></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
page_footer(false);
|
||||
|
||||
}
|
||||
else if (isset($_GET['pane']) && $_GET['pane'] == 'left')
|
||||
{
|
||||
// Cheat and use the meta tag to change some stylesheet info
|
||||
page_header('', '<style type="text/css">body {background-color: #98AAB1}</style>', false);
|
||||
|
||||
// Grab module information using Bart's "neat-o-module" system (tm)
|
||||
$dir = @opendir('.');
|
||||
|
||||
$setmodules = 1;
|
||||
while ($file = @readdir($dir))
|
||||
{
|
||||
if (preg_match('#^admin_(.*?)\.' . $phpEx . '$#', $file))
|
||||
{
|
||||
include($file);
|
||||
}
|
||||
}
|
||||
|
||||
@closedir($dir);
|
||||
|
||||
unset($setmodules);
|
||||
|
||||
?>
|
||||
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td width="100%"><table width="100%" cellpadding="4" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<th class="menu" height="25">» <?php echo $user->lang['RETURN_TO']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1"><a class="genmed" href="index.<?php echo $phpEx . $SID; ?>&pane=right" target="main"><?php echo $user->lang['ADMIN_INDEX']; ?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row2"><a class="genmed" href="../index.<?php echo $phpEx . $SID; ?>" target="_top"><?php echo $user->lang['FORUM_INDEX']; ?></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
if (is_array($module))
|
||||
{
|
||||
@ksort($module);
|
||||
foreach ($module as $cat => $action_ary)
|
||||
{
|
||||
$cat = (!empty($user->lang[$cat . '_CAT'])) ? $user->lang[$cat . '_CAT'] : preg_replace('#_#', ' ', $cat);
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th class="menu" height="25">» <?php echo $cat; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
@ksort($action_ary);
|
||||
|
||||
foreach ($action_ary as $action => $file)
|
||||
{
|
||||
if (!empty($file))
|
||||
{
|
||||
$action = (!empty($user->lang[$action])) ? $user->lang[$action] : preg_replace('/_/', ' ', $action);
|
||||
|
||||
$row_class = ($row_class == 'row1') ? 'row2' : 'row1';
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>"><a class="genmed" href="<?php echo $file; ?>" target="main"><?php echo $action; ?></a></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</table></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
|
||||
// Output footer but don't include copyright info
|
||||
page_footer(false);
|
||||
|
||||
}
|
||||
elseif (isset($_GET['pane']) && $_GET['pane'] == 'right')
|
||||
{
|
||||
if ((isset($_POST['activate']) || isset($_POST['delete'])) && !empty($_POST['mark']))
|
||||
{
|
||||
if (!$auth->acl_get('a_user'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
if (is_array($_POST['mark']))
|
||||
{
|
||||
$in_sql = '';
|
||||
foreach ($_POST['mark'] as $user_id)
|
||||
{
|
||||
$in_sql .= (($in_sql != '') ? ', ' : '') . intval($user_id);
|
||||
}
|
||||
|
||||
if ($in_sql != '')
|
||||
{
|
||||
$sql = (isset($_POST['activate'])) ? "UPDATE " . USERS_TABLE . " SET user_active = 1 WHERE user_id IN ($in_sql)" : "DELETE FROM " . USERS_TABLE . " WHERE user_id IN ($in_sql)";
|
||||
$db->sql_query($sql);
|
||||
|
||||
if (isset($_POST['delete']))
|
||||
{
|
||||
$sql = "UPDATE " . CONFIG_TABLE . "
|
||||
SET config_value = config_value - " . sizeof($_POST['mark']) . "
|
||||
WHERE config_name = 'num_users'";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
$log_action = (isset($_POST['activate'])) ? 'log_index_activate' : 'log_index_delete';
|
||||
add_admin_log($log_action, sizeof($_POST['mark']));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (isset($_POST['remind']))
|
||||
{
|
||||
if (!$auth->acl_get('a_user'))
|
||||
{
|
||||
trigger_error($user->lang['NO_ADMIN']);
|
||||
}
|
||||
|
||||
}
|
||||
else if (isset($_POST['resetonline']))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Get forum statistics
|
||||
$total_posts = $config['num_posts'];
|
||||
$total_topics = $config['num_topics'];
|
||||
$total_users = $config['num_users'];
|
||||
|
||||
$start_date = $user->format_date($config['board_startdate']);
|
||||
|
||||
$boarddays = (time() - $config['board_startdate']) / 86400;
|
||||
|
||||
$posts_per_day = sprintf('%.2f', $total_posts / $boarddays);
|
||||
$topics_per_day = sprintf('%.2f', $total_topics / $boarddays);
|
||||
$users_per_day = sprintf('%.2f', $total_users / $boarddays);
|
||||
|
||||
$avatar_dir_size = 0;
|
||||
|
||||
if ($avatar_dir = @opendir($phpbb_root_path . $config['avatar_path']))
|
||||
{
|
||||
while ($file = @readdir($avatar_dir))
|
||||
{
|
||||
if ($file != '.' && $file != '..')
|
||||
{
|
||||
$avatar_dir_size += @filesize($phpbb_root_path . $config['avatar_path'] . '/' . $file);
|
||||
}
|
||||
}
|
||||
@closedir($avatar_dir);
|
||||
|
||||
// This bit of code translates the avatar directory size into human readable format
|
||||
// Borrowed the code from the PHP.net annoted manual, origanally written by:
|
||||
// Jesse (jesse@jess.on.ca)
|
||||
if ($avatar_dir_size >= 1048576)
|
||||
{
|
||||
$avatar_dir_size = round($avatar_dir_size / 1048576 * 100) / 100 . ' MB';
|
||||
}
|
||||
else if ($avatar_dir_size >= 1024)
|
||||
{
|
||||
$avatar_dir_size = round($avatar_dir_size / 1024 * 100) / 100 . ' KB';
|
||||
}
|
||||
else
|
||||
{
|
||||
$avatar_dir_size = $avatar_dir_size . ' Bytes';
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Couldn't open Avatar dir.
|
||||
$avatar_dir_size = $user->lang['Not_available'];
|
||||
}
|
||||
|
||||
if ($posts_per_day > $total_posts)
|
||||
{
|
||||
$posts_per_day = $total_posts;
|
||||
}
|
||||
|
||||
if ($topics_per_day > $total_topics)
|
||||
{
|
||||
$topics_per_day = $total_topics;
|
||||
}
|
||||
|
||||
if ($users_per_day > $total_users)
|
||||
{
|
||||
$users_per_day = $total_users;
|
||||
}
|
||||
|
||||
// DB size ... MySQL only
|
||||
// This code is heavily influenced by a similar routine
|
||||
// in phpMyAdmin 2.2.0
|
||||
if (preg_match('/^mysql/', SQL_LAYER))
|
||||
{
|
||||
$result = $db->sql_query('SELECT VERSION() AS mysql_version');
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$version = $row['mysql_version'];
|
||||
|
||||
if (preg_match('#^(3\.23|4\.)#', $version))
|
||||
{
|
||||
$db_name = (preg_match('#^(3\.23\.[6-9])|(3\.23\.[1-9][1-9])|(4\.)#', $version)) ? "`$dbname`" : $dbname;
|
||||
|
||||
$sql = "SHOW TABLE STATUS
|
||||
FROM " . $db_name;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$dbsize = 0;
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if ($row['Type'] != 'MRG_MyISAM')
|
||||
{
|
||||
if ($table_prefix != '')
|
||||
{
|
||||
if (strstr($row['Name'], $table_prefix))
|
||||
{
|
||||
$dbsize += $row['Data_length'] + $row['Index_length'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$dbsize += $row['Data_length'] + $row['Index_length'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$dbsize = $user->lang['Not_available'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$dbsize = $user->lang['Not_available'];
|
||||
}
|
||||
}
|
||||
else if (preg_match('#^mssql#', SQL_LAYER))
|
||||
{
|
||||
$sql = "SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
|
||||
FROM sysfiles";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$dbsize = ($row = $db->sql_fetchrow($result)) ? intval($row['dbsize']) : $user->lang['Not_available'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$dbsize = $user->lang['Not_available'];
|
||||
}
|
||||
|
||||
if (is_int($dbsize))
|
||||
{
|
||||
$dbsize = ($dbsize >= 1048576) ? sprintf('%.2f MB', ($dbsize / 1048576)) : (($dbsize >= 1024) ? sprintf('%.2f KB', ($dbsize / 1024)) : sprintf('%.2f Bytes', $dbsize));
|
||||
}
|
||||
|
||||
page_header($user->lang['ADMIN_INDEX']);
|
||||
|
||||
?>
|
||||
|
||||
<script language="Javascript" type="text/javascript">
|
||||
<!--
|
||||
function marklist(status)
|
||||
{
|
||||
for (i = 0; i < document.inactive.length; i++)
|
||||
{
|
||||
document.inactive.elements[i].checked = status;
|
||||
}
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<h1><?php echo $user->lang['WELCOME_PHPBB']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['ADMIN_INTRO']; ?></p>
|
||||
|
||||
<h1><?php echo $user->lang['FORUM_STATS']; ?></h1>
|
||||
|
||||
<table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<th width="25%" nowrap="nowrap" height="25"><?php echo $user->lang['STATISTIC']; ?></th>
|
||||
<th width="25%"><?php echo $user->lang['VALUE']; ?></th>
|
||||
<th width="25%" nowrap="nowrap"><?php echo $user->lang['STATISTIC']; ?></th>
|
||||
<th width="25%"><?php echo $user->lang['VALUE']; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['NUMBER_POSTS']; ?>:</td>
|
||||
<td class="row2"><b><?php echo $total_posts; ?></b></td>
|
||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['POSTS_PER_DAY']; ?>:</td>
|
||||
<td class="row2"><b><?php echo $posts_per_day; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['NUMBER_TOPICS']; ?>:</td>
|
||||
<td class="row2"><b><?php echo $total_topics; ?></b></td>
|
||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['TOPICS_PER_DAY']; ?>:</td>
|
||||
<td class="row2"><b><?php echo $topics_per_day; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['NUMBER_USERS']; ?>:</td>
|
||||
<td class="row2"><b><?php echo $total_users; ?></b></td>
|
||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['USERS_PER_DAY']; ?>:</td>
|
||||
<td class="row2"><b><?php echo $users_per_day; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['BOARD_STARTED']; ?>:</td>
|
||||
<td class="row2"><b><?php echo $start_date; ?></b></td>
|
||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['AVATAR_DIR_SIZE']; ?>:</td>
|
||||
<td class="row2"><b><?php echo $avatar_dir_size; ?></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['DATABASE_SIZE']; ?>:</td>
|
||||
<td class="row2"><b><?php echo $dbsize; ?></b></td>
|
||||
<td class="row1" nowrap="nowrap"><?php echo $user->lang['GZIP_COMPRESSION']; ?>:</td>
|
||||
<td class="row2"><b><?php echo ($config['gzip_compress']) ? $user->lang['ON'] : $user->lang['OFF']; ?></b></td>
|
||||
</tr>
|
||||
<!-- tr>
|
||||
<td class="row1" colspan="4"><?php echo sprintf($user->lang['Record_online_users'], $config['record_online_users'], $user->format_date($config['record_online_date'])); ?></td>
|
||||
</tr -->
|
||||
</table>
|
||||
|
||||
<h1><?php echo $user->lang['ADMIN_LOG']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['ADMIN_LOG_INDEX_EXPLAIN']; ?></p>
|
||||
|
||||
<table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<th width="15%" height="25" nowrap="nowrap"><?php echo $user->lang['USERNAME']; ?></th>
|
||||
<th width="15%"><?php echo $user->lang['IP']; ?></th>
|
||||
<th width="20%"><?php echo $user->lang['TIME']; ?></th>
|
||||
<th width="45%" nowrap="nowrap"><?php echo $user->lang['ACTION']; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
view_log('admin', $log_data, $log_count, 5);
|
||||
|
||||
for($i = 0; $i < sizeof($log_data); $i++)
|
||||
{
|
||||
$row_class = ($row_class == 'row1') ? 'row2' : 'row1';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>"><?php echo $log_data[$i]['username']; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $log_data[$i]['ip']; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center"><?php echo $user->format_date($log_data[$i]['time']); ?></td>
|
||||
<td class="<?php echo $row_class; ?>"><?php echo $log_data[$i]['action']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
if ($auth->acl_get('a_user'))
|
||||
{
|
||||
|
||||
?>
|
||||
</table>
|
||||
|
||||
<h1><?php echo $user->lang['INACTIVE_USERS']; ?></h1>
|
||||
|
||||
<p><?php echo $user->lang['INACTIVE_USERS_EXPLAIN']; ?></p>
|
||||
|
||||
<form method="post" name="inactive" action="<?php echo "index.$phpEx$SID&pane=right"; ?>"><table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0">
|
||||
<tr>
|
||||
<th width="45%" height="25" nowrap="nowrap"><?php echo $user->lang['USERNAME']; ?></th>
|
||||
<th width="45%"><?php echo $user->lang['JOINED']; ?></th>
|
||||
<th width="5%" nowrap="nowrap"><?php echo $user->lang['MARK']; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
$sql = "SELECT user_id, username, user_regdate
|
||||
FROM " . USERS_TABLE . "
|
||||
WHERE user_active = 0
|
||||
AND user_id <> " . ANONYMOUS . "
|
||||
ORDER BY user_regdate ASC";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
if ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
do
|
||||
{
|
||||
$row_class = ($row_class == 'row1') ? 'row2' : 'row1';
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>"><a href="<?php echo 'admin_users.' . $phpEx . $SID . '&u=' . $row['user_id']; ?>"><?php echo $row['username']; ?></a></td>
|
||||
<td class="<?php echo $row_class; ?>"><?php echo $user->format_date($row['user_regdate']); ?></td>
|
||||
<td class="<?php echo $row_class; ?>"> <input type="checkbox" name="mark[]" value="<?php echo $row['user_id']; ?>" /> </td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="cat" colspan="3" height="28" align="right"><input class="liteoption" type="submit" name="activate" value="<?php echo $user->lang['ACTIVATE']; ?>" /> <input class="liteoption" type="submit" name="remind" value="<?php echo $user->lang['REMIND']; ?>" /> <input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['DELETE']; ?>" /> </td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="row1" colspan="3" align="center"><?php echo $user->lang['NO_INACTIVE_USERS']; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
</table>
|
||||
|
||||
<table width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<td align="right" valign="top" nowrap="nowrap"><b><span class="gensmall"><a href="javascript:marklist(true);" class="gensmall"><?php echo $user->lang['MARK_ALL']; ?></a> :: <a href="javascript:marklist(false);" class="gensmall"><?php echo $user->lang['UNMARK_ALL']; ?></a></span></b></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
page_footer();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// Output the frameset ...
|
||||
//
|
||||
header("Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header("Content-type: text/html; charset=" . $user->lang['ENCODING']);
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
<title><?php echo $user->lang['Admin_title']; ?></title>
|
||||
</head>
|
||||
|
||||
<frameset rows="60, *" border="0" framespacing="0" frameborder="NO">
|
||||
<frame src="<?php echo "index.$phpEx$SID&pane=top"; ?>" name="title" noresize marginwidth="0" marginheight="0" scrolling="NO">
|
||||
<frameset cols="155,*" rows="*" border="2" framespacing="0" frameborder="yes">
|
||||
<frame src="<?php echo "index.$phpEx$SID&pane=left"; ?>" name="nav" marginwidth="3" marginheight="3" scrolling="yes">
|
||||
<frame src="<?php echo "index.$phpEx$SID&pane=right"; ?>" name="main" marginwidth="0" marginheight="0" scrolling="auto">
|
||||
</frameset>
|
||||
</frameset>
|
||||
|
||||
<noframes>
|
||||
<body bgcolor="white" text="#000000">
|
||||
<p><?php echo $user->lang['No_frames']; ?></p>
|
||||
</body>
|
||||
</noframes>
|
||||
</html>
|
||||
<?php
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
|
@ -1,181 +0,0 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* pagestart.php
|
||||
* -------------------
|
||||
* begin : Thursday, Aug 2, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
if (!defined('IN_PHPBB'))
|
||||
{
|
||||
die('Hacking attempt');
|
||||
}
|
||||
|
||||
define('IN_ADMIN', true);
|
||||
define('NEED_SID', true);
|
||||
require($phpbb_root_path . 'common.'.$phpEx);
|
||||
require_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
|
||||
// Start session management
|
||||
$user->start($update);
|
||||
$user->setup();
|
||||
$auth->acl($user->data);
|
||||
// End session management
|
||||
|
||||
// -----------------------------
|
||||
// Functions
|
||||
function page_header($sub_title, $meta = '', $table_html = true)
|
||||
{
|
||||
global $config, $db, $user, $phpEx;
|
||||
|
||||
define('HEADER_INC', true);
|
||||
|
||||
// gzip_compression
|
||||
if ($config['gzip_compress'])
|
||||
{
|
||||
if (extension_loaded('zlib') && !headers_sent())
|
||||
{
|
||||
ob_start('ob_gzhandler');
|
||||
}
|
||||
}
|
||||
|
||||
header("Content-type: text/html; charset=" . $user->lang['ENCODING']);
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $user->lang['ENCODING']; ?>">
|
||||
<meta http-equiv="Content-Style-Type" content="text/css">
|
||||
<link rel="stylesheet" href="subSilver.css" type="text/css">
|
||||
<?php
|
||||
|
||||
echo $meta;
|
||||
|
||||
?>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
th { background-image: url('images/cellpic3.gif') }
|
||||
td.cat { background-image: url('images/cellpic1.gif') }
|
||||
//-->
|
||||
</style>
|
||||
<title><?php echo $config['sitename'] . ' - ' . $page_title; ?></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
if ($table_html)
|
||||
{
|
||||
|
||||
?>
|
||||
<a name="top"></a>
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td colspan="2" height="25" align="right" nowrap="nowrap"><span class="subtitle">» <i><?php echo $sub_title; ?></i></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table width="95%" cellspacing="0" cellpadding="0" border="0" align="center">
|
||||
<tr>
|
||||
<td><br clear="all" />
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function page_footer($copyright_html = true)
|
||||
{
|
||||
global $cache, $config, $db, $phpEx;
|
||||
|
||||
// Close our DB connection.
|
||||
$db->sql_close();
|
||||
|
||||
?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
|
||||
if ($copyright_html)
|
||||
{
|
||||
|
||||
?>
|
||||
|
||||
<div align="center"><span class="copyright">Powered by phpBB <?php echo $config['version']; ?> © 2002 <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB Group</a></span></div>
|
||||
|
||||
<br clear="all" />
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
if (!empty($cache))
|
||||
{
|
||||
$cache->unload();
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
function page_message($title, $message, $show_header = false)
|
||||
{
|
||||
global $phpEx, $SID, $user;
|
||||
|
||||
if ($show_header)
|
||||
{
|
||||
|
||||
?>
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td><a href="../index.<?php echo $phpEx . $SID; ?>"><img src="images/header_left.jpg" width="200" height="60" alt="phpBB Logo" title="phpBB Logo" border="0"/></a></td>
|
||||
<td width="100%" background="images/header_bg.jpg" height="60" align="right" nowrap="nowrap"><span class="maintitle"><?php echo $user->lang['ADMIN_TITLE']; ?></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<br /><br />
|
||||
|
||||
<table class="bg" width="80%" cellpadding="4" cellspacing="1" border="0" align="center">
|
||||
<tr>
|
||||
<th><?php echo $title; ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1" align="center"><?php echo $message; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
// End Functions
|
||||
// -----------------------------
|
||||
|
||||
?>
|
|
@ -1,187 +0,0 @@
|
|||
/*
|
||||
$Id$
|
||||
|
||||
The original "subSilver" theme for phpBB2
|
||||
Created by subBlue design :: http://www.subBlue.com
|
||||
Copyright (c) 2002 phpBB Group
|
||||
*/
|
||||
|
||||
body {
|
||||
background-color: white;
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
margin: 0px;
|
||||
border: 0px;
|
||||
padding: 0px;
|
||||
|
||||
scrollbar-face-color: #DEE3E7;
|
||||
scrollbar-highlight-color: white;
|
||||
scrollbar-shadow-color: #DEE3E7;
|
||||
scrollbar-3dlight-color: #D1D7DC;
|
||||
scrollbar-arrow-color: #006699;
|
||||
scrollbar-track-color: #EFEFEF;
|
||||
scrollbar-darkshadow-color: #98AAB1;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
.maintitle, h1, h2 {
|
||||
font: bold 18pt 'Trebuchet MS', Verdana,sans-serif;
|
||||
text-decoration:none;
|
||||
line-height: 120%;
|
||||
}
|
||||
|
||||
.maintitle {
|
||||
color: #12749B
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font: bold 12pt Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
/*
|
||||
Anchors
|
||||
*/
|
||||
a:link, a:active, a:visited {
|
||||
color: #006699;
|
||||
}
|
||||
a.gen, a.genmed, a.gensmall {
|
||||
color: #006699;
|
||||
text-decoration: none;
|
||||
}
|
||||
a.nav {
|
||||
color: #006699;
|
||||
text-decoration: none;
|
||||
}
|
||||
a.copyright {
|
||||
color: #444444;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.gen:hover, a.genmed:hover, a.gensmall:hover {
|
||||
color: #DD6900;
|
||||
text-decoration: underline;
|
||||
}
|
||||
a:hover {
|
||||
color: #DD6900;
|
||||
text-decoration: underline;
|
||||
}
|
||||
a.nav:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
a.copyright:hover {
|
||||
color: #DD6900;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/*
|
||||
Non-tag specific
|
||||
*/
|
||||
.gen, .gensmall {
|
||||
color: black;
|
||||
}
|
||||
.gen {
|
||||
font-size: 8pt;
|
||||
}
|
||||
.gensmall {
|
||||
font-size: 7pt;
|
||||
}
|
||||
.nav {
|
||||
color: black;
|
||||
font: bold 11px;
|
||||
}
|
||||
.name {
|
||||
color: black;
|
||||
font-size: 11px;
|
||||
}
|
||||
.postdetails {
|
||||
color: black;
|
||||
font-size: 10px;
|
||||
}
|
||||
.copyright {
|
||||
color: #444444;
|
||||
font: 8pt Verdana, Arial, Helvetica, sans-serif;
|
||||
letter-spacing: -1px;
|
||||
}
|
||||
|
||||
/*
|
||||
Tables
|
||||
*/
|
||||
table.bg {
|
||||
background-color: #ACBBC6
|
||||
}
|
||||
|
||||
th, td {
|
||||
font: 8pt Verdana, Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
th {
|
||||
height: 25px;
|
||||
background-color: #006699;
|
||||
color: #FFA34F;
|
||||
font: bold 11px;
|
||||
}
|
||||
|
||||
th.menu {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
td.cat {
|
||||
height: 28px;
|
||||
background-color: #D1D7DC;
|
||||
}
|
||||
|
||||
.row1 {
|
||||
background-color: #EFEFEF;
|
||||
}
|
||||
.row2 {
|
||||
background-color: #DEE3E7;
|
||||
}
|
||||
.row3 {
|
||||
background-color: #D1D7DC;
|
||||
}
|
||||
|
||||
/*
|
||||
Misc
|
||||
*/
|
||||
hr {
|
||||
height: 0px;
|
||||
border: solid #D1D7DC 0px;
|
||||
border-top-width: 1px;
|
||||
}
|
||||
|
||||
/*
|
||||
Forms
|
||||
*/
|
||||
input, textarea, select {
|
||||
color: black;
|
||||
font: normal 8pt Verdana, Arial, Helvetica, sans-serif;
|
||||
border-color: black;
|
||||
}
|
||||
|
||||
input.text {
|
||||
font-family: 'Courier New', courier;
|
||||
}
|
||||
|
||||
option.sep {
|
||||
background-color: #EFEFEF;
|
||||
}
|
||||
|
||||
textarea.edit {
|
||||
font: 9pt 'Courier New', courier;
|
||||
line-height:125%;
|
||||
}
|
||||
|
||||
input.mainoption {
|
||||
background-color: #FAFAFA;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
input.liteoption {
|
||||
background-color: #FAFAFA;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
/* Import the fancy styles for IE only (NS4.x doesn't use the @import function) */
|
||||
@import url("forms.css");
|
|
@ -1,56 +0,0 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<title>phpBB 2.2 Color Swatch</title>
|
||||
<style type="text/css">
|
||||
|
||||
td {
|
||||
border: solid 1px #333333;
|
||||
}
|
||||
|
||||
.over {
|
||||
border-color: white;
|
||||
}
|
||||
|
||||
.out {
|
||||
border-color: #333333;
|
||||
}
|
||||
|
||||
</style>
|
||||
<body bgcolor="#404040" text="#FFFFFF">
|
||||
<script language="javascript" type="text/javascript">
|
||||
<!--
|
||||
var r = 0, g = 0, b = 0;
|
||||
var numberList = new Array(6);
|
||||
numberList[0] = "00";
|
||||
numberList[1] = "33";
|
||||
numberList[2] = "66";
|
||||
numberList[3] = "99";
|
||||
numberList[4] = "CC";
|
||||
numberList[5] = "FF";
|
||||
document.writeln('<table cellspacing="0" cellpadding="0" border="0">');
|
||||
for(r = 0; r < 6; r++)
|
||||
{
|
||||
document.writeln('<tr>');
|
||||
for(g = 0; g < 6; g++)
|
||||
{
|
||||
for(b = 0; b < 6; b++)
|
||||
{
|
||||
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
|
||||
document.write('<td bgcolor="#' + color + '" onmouseover="this.className=\'over\'" onmouseout="this.className=\'out\'">');
|
||||
document.write('<a href="javascript:cell(\'' + color + '\');"><img src="../images/spacer.gif" width="15" height="12" border="0" alt="#' + color + '" title="#' + color + '" /></a>');
|
||||
document.writeln('</td>');
|
||||
}
|
||||
}
|
||||
document.writeln('</tr>');
|
||||
}
|
||||
document.writeln('</table>');
|
||||
|
||||
function cell(color)
|
||||
{
|
||||
opener.document.forms['<?php echo $_GET['form']; ?>'].<?php echo $_GET['name']; ?>.value=color;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|