|
From: Paul S. O. <ps...@us...> - 2002-07-14 14:51:08
|
Update of /cvsroot/phpbb/phpBB2/admin
In directory usw-pr-cvs1:/tmp/cvs-serv16663/admin
Modified Files:
admin_board.php admin_db_utilities.php admin_permissions.php
admin_search.php admin_styles.php admin_users.php
admin_words.php index.php page_footer_admin.php
page_header_admin.php pagestart.php subSilver.css
Added Files:
admin_email.php admin_prune.php forms.css
Log Message:
Hard-coded HTML into admin modules ... no point in continuing to template this stuff since no one (or few) rarely bother to make use of the feature. Lots of changes for permissions, sessions, etc. some new styling stuff present (inc. editing templates though not complete), lots of bugs and non-functioning stuff ... any 'existing' modules will cause the right hand panel to fail ... remove them. If I catch anyone nicking graphics from here I'll kill 'em ...
--- NEW FILE ---
<?php
/***************************************************************************
* admin_email.php
* -------------------
* begin : Thu May 31, 2001
* copyright : (C) 2001 The phpBB Group
* email : su...@ph...
*
* $Id: admin_email.php,v 1.1 2002/07/14 14:51:03 psotfx Exp $
*
****************************************************************************/
/***************************************************************************
*
* 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 ( !$acl->get_acl_admin('general') )
{
return;
}
$filename = basename(__FILE__);
$module['Users']['Mass_Email'] = $filename;
return;
}
define('IN_PHPBB', 1);
//
// Include files
//
$phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx);
//
// Do we have general admin permissions?
//
if ( !$acl->get_acl_admin('general') )
{
return;
}
//
// Set some vars
//
$message = '';
$subject = '';
//
// Do the job ...
//
if ( isset($HTTP_POST_VARS['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($HTTP_POST_VARS['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($HTTP_POST_VARS['subject']);
$message = stripslashes($HTTP_POST_VARS['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')) && !$board_config['smtp_delivery'])
{
// We are running on windows, force delivery to use
// our smtp functions since php's are broken by default
$board_config['smtp_delivery'] = 1;
$board_config['smtp_host'] = get_cfg_var('SMTP');
}
$emailer = new emailer($board_config['smtp_delivery']);
$email_headers = 'From: ' . $board_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 . "\r\n";
$emailer->use_template('admin_send_email');
$emailer->email_address($board_config['board_email']);
$emailer->set_subject($subject);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
'SITENAME' => $board_config['sitename'],
'BOARD_EMAIL' => $board_config['board_email'],
'MESSAGE' => $message)
);
$emailer->send();
$emailer->reset();
$message = $lang['Email_sent'] . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . "index.$phpEx$SID?pane=right" . '">', '</a>');
message_die(MESSAGE, $message);
}
}
//
// Initial selection
//
$sql = "SELECT group_id, group_name
FROM ".GROUPS_TABLE;
$result = $db->sql_query($sql);
$select_list = '<select name = "g"><option value = "-1">' . $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($lang['Users']);
?>
<h1><?php echo $lang['Email']; ?></h1>
<p><?php echo $lang['Mass_email_explain']; ?></p>
<form method="post" action="<?php echo "admin_mass_email.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1">
<tr>
<th colspan="2"><?php echo $lang['Compose']; ?></th>
</tr>
<tr>
<td class="row1" align="right"><b><?php echo $lang['Recipients']; ?></b></td>
<td class="row2" align="left"><?php echo $select_list; ?></td>
</tr>
<tr>
<td class="row1" align="right"><b><?php echo $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 $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 $lang['Email']; ?>" name="submit" class="mainoption" /></td>
</tr>
</table></form>
<?php
page_footer();
?>
--- NEW FILE ---
<?php
/***************************************************************************
* admin_prune.php
* -------------------
* begin : Mon Jul 31, 2001
* copyright : (C) 2001 The phpBB Group
* email : su...@ph...
*
* $Id: admin_prune.php,v 1.1 2002/07/14 14:51:03 psotfx Exp $
*
****************************************************************************/
/***************************************************************************
*
* 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 ( !$acl->get_acl_admin('forum') )
{
return;
}
$filename = basename(__FILE__);
$module['Forums']['Prune'] = $filename . $SID . '&mode=forums';
return;
}
define('IN_PHPBB', 1);
//
// Include files
//
$phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx);
require($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
//
// Do we have forum admin permissions?
//
if ( !$acl->get_acl_admin('forum') )
{
message_die(MESSAGE, $lang['No_admin']);
}
//
// Get the forum ID for pruning
//
if ( isset($HTTP_GET_VARS['f']) || isset($HTTP_POST_VARS['f']) )
{
$forum_id = ( isset($HTTP_POST_VARS['f']) ) ? intval($HTTP_POST_VARS['f']) : intval($HTTP_GET_VARS['f']);
$forum_sql = ( $forum_id == -1 ) ? '' : "AND forum_id = $forum_id";
}
else
{
$forum_id = '';
$forum_sql = '';
}
//
// Get a list of forum's or the data for the forum that we are pruning.
//
$sql = "SELECT f.*
FROM " . FORUMS_TABLE . " f, " . CATEGORIES_TABLE . " c
WHERE c.cat_id = f.cat_id
$forum_sql
ORDER BY c.cat_order ASC, f.forum_order ASC";
$result = $db->sql_query($sql);
$forum_rows = array();
while( $row = $db->sql_fetchrow($result) )
{
$forum_rows[] = $row;
}
//
// Check for submit to be equal to Prune. If so then proceed with the pruning.
//
if ( isset($HTTP_POST_VARS['doprune']) )
{
$prunedays = ( isset($HTTP_POST_VARS['prunedays']) ) ? intval($HTTP_POST_VARS['prunedays']) : 0;
// Convert days to seconds for timestamp functions...
$prunedate = time() - ( $prunedays * 86400 );
$template->set_filenames(array(
'body' => 'admin/forum_prune_result_body.tpl')
);
$log_data = '';
for($i = 0; $i < count($forum_rows); $i++)
{
$p_result = prune($forum_rows[$i]['forum_id'], $prunedate);
sync('forum', $forum_rows[$i]['forum_id']);
$template->assign_block_vars('prune_results', array(
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
'FORUM_NAME' => $forum_rows[$i]['forum_name'],
'FORUM_TOPICS' => $p_result['topics'],
'FORUM_POSTS' => $p_result['posts'])
);
$log_data .= ( ( $log_data != '' ) ? ', ' : '' ) . $forum_rows[$i]['forum_name'];
}
$template->assign_vars(array(
'L_FORUM_PRUNE' => $lang['Forum_Prune'],
'L_FORUM' => $lang['Forum'],
'L_TOPICS_PRUNED' => $lang['Topics_pruned'],
'L_POSTS_PRUNED' => $lang['Posts_pruned'],
'L_PRUNE_RESULT' => $lang['Prune_success'])
);
add_admin_log('log_prune', $log_data);
}
else
{
page_header($lang['Forums']);
//
// 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">' . $lang['All_Forums'] . '</option>';
for($i = 0; $i < count($forum_rows); $i++)
{
$select_list .= '<option value="' . $forum_rows[$i]['forum_id'] . '">' . $forum_rows[$i]['forum_name'] . '</option>';
}
?>
<h1><?php echo $lang['Prune']; ?></h1>
<p><?php echo $lang['Forum_Prune_explain']; ?></p>
<form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1">
<tr>
<th align="center"><?php echo $lang['Select_a_Forum']; ?></th>
</tr>
<tr>
<td class="row1" align="center"><?php echo $s_hidden_fields; ?> <select name="f"><?php echo $select_list; ?></select> <input type="submit" value="<?php echo $lang['Look_up_Forum']; ?>" class="mainoption" /> </td>
</tr>
</table></form>
<?php
}
else
{
$forum_name = ( $forum_id == -1 ) ? $lang['All_Forums'] : $forum_rows[0]['forum_name'];
$prune_data = $lang['Prune_topics_not_posted'] . " ";
$prune_data .= '<input type="text" name="prunedays" size="4"> ' . $lang['Days'];
$s_hidden_fields = '<input type="hidden" name="f" value="' . $forum_id . '">';
?>
<h1><?php echo $lang['Prune']; ?></h1>
<p><?php echo $lang['Forum_Prune_explain']; ?></p>
<h2><?php echo $lang['Forum'] . ': ' . $forum_name; ?></h2>
<form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1">
<tr>
<th class="th"><?php echo $lang['Forum_Prune']; ?></th>
</tr>
<tr>
<td class="row1"><?php echo $prune_data; ?></td>
</tr>
<tr>
<td class="cat" align="center"><?php echo $s_hidden_fields; ?><input type="submit" name="doprune" value="<?php echo $lang['Do_Prune']; ?>" class="mainoption"></td>
</tr>
</table></form>
<?php
}
}
//
// Actually output the page here.
//
page_footer();
?>
--- NEW FILE ---
/* Fancy form styles for IE */
input, textarea, select {
border-width: 1px;
}
input {
text-indent: 2px;
}
.postbody {
line-height: 18px
}
Index: admin_board.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_board.php,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -r1.51 -r1.52
*** admin_board.php 22 Mar 2002 17:00:32 -0000 1.51
--- admin_board.php 14 Jul 2002 14:51:03 -0000 1.52
***************
*** 9,21 ****
* $Id$
*
- *
***************************************************************************/
! define('IN_PHPBB', 1);
! if( !empty($setmodules) )
{
$file = basename(__FILE__);
! $module['General']['Configuration'] = "$file?mode=config";
return;
}
--- 9,36 ----
* $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 ( !$acl->get_acl_admin('general') )
+ {
+ return;
+ }
+
$file = basename(__FILE__);
! $module['General']['Avatar_Setup'] = "$file?mode=avatars";
! $module['General']['Basic_Config'] = "$file?mode=basic";
! $module['General']['Cookie_Parameters'] = "$file?mode=cookies";
! $module['General']['Default_Settings'] = "$file?mode=gendefs";
! $module['Users']['Default_Settings'] = "$file?mode=userdefs";
return;
}
***************
*** 24,31 ****
// Let's set the root dir for phpBB
//
$phpbb_root_path = "../";
require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx);
! include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
//
--- 39,51 ----
// Let's set the root dir for phpBB
//
+ define('IN_PHPBB', 1);
$phpbb_root_path = "../";
require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx);
!
! if ( !$acl->get_acl_admin('general') )
! {
! return;
! }
//
***************
*** 34,126 ****
$sql = "SELECT *
FROM " . CONFIG_TABLE;
! if(!$result = $db->sql_query($sql))
! {
! message_die(CRITICAL_ERROR, "Could not query config information in admin_board", "", __LINE__, __FILE__, $sql);
! }
! else
{
! 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($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name];
!
! if( isset($HTTP_POST_VARS['submit']) )
! {
! $sql = "UPDATE " . CONFIG_TABLE . " SET
! config_value = '" . str_replace("\'", "''", $new[$config_name]) . "'
! WHERE config_name = '$config_name'";
! if( !$db->sql_query($sql) )
! {
! message_die(GENERAL_ERROR, "Failed to update general configuration for $config_name", "", __LINE__, __FILE__, $sql);
! }
! }
}
! if( isset($HTTP_POST_VARS['submit']) )
! {
! $message = $lang['Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_config'], "<a href=\"" . append_sid("admin_board.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");
! message_die(GENERAL_MESSAGE, $message);
! }
}
! $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');
! $disable_board_yes = ( $new['board_disable'] ) ? "checked=\"checked\"" : "";
! $disable_board_no = ( !$new['board_disable'] ) ? "checked=\"checked\"" : "";
! $cookie_secure_yes = ( $new['cookie_secure'] ) ? "checked=\"checked\"" : "";
! $cookie_secure_no = ( !$new['cookie_secure'] ) ? "checked=\"checked\"" : "";
$html_tags = $new['allow_html_tags'];
! $override_user_style_yes = ( $new['override_user_style'] ) ? "checked=\"checked\"" : "";
! $override_user_style_no = ( !$new['override_user_style'] ) ? "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\"" : "";
! $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\"" : "";
! $board_email_form_yes = ( $new['board_email_form'] ) ? "checked=\"checked\"" : "";
! $board_email_form_no = ( !$new['board_email_form'] ) ? "checked=\"checked\"" : "";
! $gzip_yes = ( $new['gzip_compress'] ) ? "checked=\"checked\"" : "";
! $gzip_no = ( !$new['gzip_compress'] ) ? "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\"" : "";
! $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\"" : "";
! $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\"" : "";
! $smtp_yes = ( $new['smtp_delivery'] ) ? "checked=\"checked\"" : "";
! $smtp_no = ( !$new['smtp_delivery'] ) ? "checked=\"checked\"" : "";
$template->set_filenames(array(
--- 54,138 ----
$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($HTTP_POST_VARS[$config_name]) ) ? $HTTP_POST_VARS[$config_name] : $default_config[$config_name];
!
! if ( isset($HTTP_POST_VARS['submit']) )
{
! $sql = "UPDATE " . CONFIG_TABLE . " SET
! config_value = '" . str_replace("\'", "''", $new[$config_name]) . "'
! WHERE config_name = '$config_name'";
! $db->sql_query($sql);
}
+ }
! if ( isset($HTTP_POST_VARS['submit']) )
! {
! $message = $lang['Config_updated'] . "<br /><br />" . sprintf($lang['Click_return_config'], '<a href="' . "admin_board.$phpEx$SID" . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . "index.$phpEx$SID?pane=right" . '">', '</a>');
! message_die(MESSAGE, $message);
}
! $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');
! $disable_board_yes = ( $new['board_disable'] ) ? 'checked="checked"' : '';
! $disable_board_no = ( !$new['board_disable'] ) ? 'checked="checked"' : '';
! $cookie_secure_yes = ( $new['cookie_secure'] ) ? 'checked="checked"' : '';
! $cookie_secure_no = ( !$new['cookie_secure'] ) ? 'checked="checked"' : '';
$html_tags = $new['allow_html_tags'];
! $override_user_style_yes = ( $new['override_user_style'] ) ? 'checked="checked"' : '';
! $override_user_style_no = ( !$new['override_user_style'] ) ? '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"' : '';
! $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"' : '';
! $board_email_form_yes = ( $new['board_email_form'] ) ? 'checked="checked"' : '';
! $board_email_form_no = ( !$new['board_email_form'] ) ? 'checked="checked"' : '';
! $gzip_yes = ( $new['gzip_compress'] ) ? 'checked="checked"' : '';
! $gzip_no = ( !$new['gzip_compress'] ) ? '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"' : '';
! $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"' : '';
! $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"' : '';
! $smtp_yes = ( $new['smtp_delivery'] ) ? 'checked="checked"' : '';
! $smtp_no = ( !$new['smtp_delivery'] ) ? 'checked="checked"' : '';
$template->set_filenames(array(
***************
*** 132,139 ****
// box on the admin page
//
- $new['site_desc'] = str_replace('"', '"', $new['site_desc']);
- $new['sitename'] = str_replace('"', '"', strip_tags($new['sitename']));
$template->assign_vars(array(
! "S_CONFIG_ACTION" => append_sid("admin_board.$phpEx"),
"L_YES" => $lang['Yes'],
--- 144,149 ----
// box on the admin page
//
$template->assign_vars(array(
! "S_CONFIG_ACTION" => "admin_board.$phpEx$SID",
"L_YES" => $lang['Yes'],
***************
*** 233,238 ****
"SCRIPT_PATH" => $new['script_path'],
"SERVER_PORT" => $new['server_port'],
! "SITENAME" => $new['sitename'],
! "SITE_DESCRIPTION" => $new['site_desc'],
"S_DISABLE_BOARD_YES" => $disable_board_yes,
"S_DISABLE_BOARD_NO" => $disable_board_no,
--- 243,248 ----
"SCRIPT_PATH" => $new['script_path'],
"SERVER_PORT" => $new['server_port'],
! "SITENAME" => htmlentities($new['sitename']),
! "SITE_DESCRIPTION" => htmlentities($new['site_desc']),
"S_DISABLE_BOARD_YES" => $disable_board_yes,
"S_DISABLE_BOARD_NO" => $disable_board_no,
***************
*** 310,316 ****
);
- $template->pparse("body");
-
include('page_footer_admin.'.$phpEx);
! ?>
--- 320,324 ----
);
include('page_footer_admin.'.$phpEx);
! ?>
\ No newline at end of file
Index: admin_db_utilities.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_db_utilities.php,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -r1.42 -r1.43
*** admin_db_utilities.php 3 Apr 2002 20:14:46 -0000 1.42
--- admin_db_utilities.php 14 Jul 2002 14:51:03 -0000 1.43
***************
*** 31,49 ****
define('IN_PHPBB', 1);
! if( !empty($setmodules) )
{
! $filename = basename(__FILE__);
! $module['General']['Backup_DB'] = $filename . "?perform=backup";
! if(@phpversion() >= '4.0.0')
! {
! $file_uploads = @ini_get('file_uploads');
! }
[...1941 lines suppressed...]
!
}
+ return(true);
}
! function output_table_content($content)
! {
! global $tempfile;
! //fwrite($tempfile, $content . "\n");
! //$backup_sql .= $content . "\n";
! echo $content ."\n";
! return;
! }
! //
! // End Functions
! // -------------
!
! ?>
\ No newline at end of file
Index: admin_permissions.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_permissions.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** admin_permissions.php 5 Jul 2002 23:52:14 -0000 1.1
--- admin_permissions.php 14 Jul 2002 14:51:03 -0000 1.2
***************
*** 22,26 ****
if ( !empty($setmodules) )
{
! if ( !$acl->get_acl_admin('forums') )
{
return;
--- 22,26 ----
if ( !empty($setmodules) )
{
! if ( !$acl->get_acl_admin('auth') )
{
return;
***************
*** 29,33 ****
$filename = basename(__FILE__);
$module['Forums']['Permissions'] = $filename . $SID . '&mode=forums';
! $module['General']['Set_Administrators'] = $filename . $SID . '&mode=admins';
return;
--- 29,34 ----
$filename = basename(__FILE__);
$module['Forums']['Permissions'] = $filename . $SID . '&mode=forums';
! $module['Forums']['Moderators'] = $filename . $SID . '&mode=moderators';
! $module['General']['Administrators'] = $filename . $SID . '&mode=administrators';
return;
***************
*** 45,49 ****
// Do we have forum admin permissions?
//
! if ( !$acl->get_acl_admin('forums') )
{
message_die(MESSAGE, $lang['No_admin']);
--- 46,50 ----
// Do we have forum admin permissions?
//
! if ( !$acl->get_acl_admin('auth') )
{
message_die(MESSAGE, $lang['No_admin']);
***************
*** 56,60 ****
{
$forum_id = ( isset($HTTP_POST_VARS['f']) ) ? intval($HTTP_POST_VARS['f']) : intval($HTTP_GET_VARS['f']);
-
$forum_sql = " WHERE forum_id = $forum_id";
}
--- 57,60 ----
***************
*** 65,71 ****
--- 65,88 ----
}
+ $mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
+
//
// Start program proper
//
+ switch ( $mode )
+ {
+ case 'forums':
+ $l_title = $lang['Permissions'];
+ $l_title_explain = $lang['Permissions_explain'];
+ break;
+ case 'moderators':
+ $l_title = $lang['Moderators'];
+ $l_title_explain = $lang['Moderators_explain'];
+ break;
+ case 'administrators':
+ $l_title = $lang['Administrators'];
+ $l_title_explain = $lang['Administrators_explain'];
+ break;
+ }
//
***************
*** 74,93 ****
// was
//
! if ( !empty($forum_id) )
{
//
! // Output the selection table if no forum id was
! // specified
//
! $template->set_filenames(array(
! "body" => "admin/auth_select_body.tpl")
! );
! $select_list = '<select name=f">';
! for($i = 0; $i < count($forum_rows); $i++)
{
! $select_list .= '<option value="' . $forum_rows[$i]['forum_id'] . '">' . $forum_rows[$i]['forum_name'] . '</option>';
}
! $select_list .= '</select>';
}
else
--- 91,310 ----
// was
//
! if ( !empty($forum_id) || $mode == 'administrators' )
{
//
! // Clear some vars, grab some info if relevant ...
! //
! $s_hidden_fields = '';
! if ( !empty($forum_id) )
! {
! $sql = "SELECT forum_name
! FROM " . FORUMS_TABLE . "
! WHERE forum_id = $forum_id";
! $result = $db->sql_query($sql);
!
! $forum_info = $db->sql_fetchrow($result);
!
! $l_title .= ' : <i>' . $forum_info['forum_name'] . '</i>';
! $s_hidden_fields = '<input type="hidden" name="f" value="' . $forum_id .'" />';
! }
!
//
! // Generate header
! //
! page_header($lang['Forums']);
!
! ?>
!
! <h1><?php echo $l_title; ?></h1>
! <p><?php echo $l_title_explain; ?></p>
!
! <?php
!
! switch ( $mode )
{
! case 'forums':
!
! ?>
!
! <form method="post" action="<?php echo "admin_permissions.$phpEx$SID&mode=$mode"; ?>">
!
! <h3><?php echo $lang['Allowed_users']; ?></h3>
!
! <select name="user_allowed"><?php echo $user_allowed_options; ?></select>
!
! <p>[ <a href=""><?php echo $lang['Advanced']; ?></a> ]</p>
!
! <h3><?php echo $lang['Allowed_groups']; ?></h3>
!
! <select name="group_allowed"><?php echo $group_allowed_options; ?></select>
!
! <p>[ <a href=""><?php echo $lang['Advanced']; ?></a> ]</p>
!
! <h3><?php echo $lang['Disallowed_users']; ?></h3>
!
! <select name="user_disallowed"><?php echo $user_disallowed_options; ?></select>
!
! <p>[ <a href=""><?php echo $lang['Advanced']; ?></a> ]</p>
!
! <h3><?php echo $lang['Disallowed_groups']; ?></h3>
!
! <select name="group_disallowed"><?php echo $group_disallowed_options; ?></select>
!
! <p>[ <a href=""><?php echo $lang['Advanced']; ?></a> ]</p>
!
! <?php
! break;
!
! case 'moderators':
! $sql = "SELECT auth_option
! FROM " . ACL_OPTIONS_TABLE . "
! WHERE auth_type LIKE 'mod'";
! $result = $db->sql_query($sql);
!
! $auth_options = array();
! while ( $row = $db->sql_fetchrow($result) )
! {
! $auth_options[] = $row;
! }
!
! $sql = "SELECT u.user_id, u.username, ao.auth_option
! FROM " . USERS_TABLE . " u, " . ACL_USERS_TABLE . " au, " . ACL_OPTIONS_TABLE . " ao
! WHERE ao.auth_type LIKE 'mod'
! AND au.auth_option_id = ao.auth_option_id
! AND au.forum_id = $forum_id
! AND u.user_id = au.user_id
! ORDER BY u.username, u.user_regdate ASC";
! $result = $db->sql_query($sql);
!
! $auth_users = array();
! while ( $row = $db->sql_fetchrow($result) )
! {
! $auth_users[$row['auth_option']] .= '<option value="' . $row['user_id'] . '">' . $row['username'] . '</option>';
! }
!
! $sql = "SELECT g.group_id, g.group_name, ao.auth_option
! FROM " . GROUPS_TABLE . " g, " . ACL_GROUPS_TABLE . " ag, " . ACL_OPTIONS_TABLE . " ao
! WHERE ao.auth_type LIKE 'mod'
! AND ag.auth_option_id = ao.auth_option_id
! AND ag.forum_id = $forum_id
! AND g.group_id = ag.group_id
! ORDER BY g.group_name ASC";
! $result = $db->sql_query($sql);
!
! $auth_groups = array();
! while ( $row = $db->sql_fetchrow($result) )
! {
! $auth_groups[$row['auth_option']] .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
! }
!
! ?>
!
! <table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
! <tr>
! <th>Setting</th>
! <th>Users</th>
! <th>Groups</th>
! </tr>
! <?php
! for($i = 0; $i < sizeof($auth_options); $i++)
! {
! $cell_bg = ( $cell_bg == 'row1' ) ? 'row2' : 'row1';
!
! ?>
! <tr>
! <td class="<?php echo $cell_bg; ?>" align="center"><?php echo $auth_options[$i]['auth_option']; ?></td>
! <td class="<?php echo $cell_bg; ?>" align="center"><select name="option[<?php echo $auth_options[$i]['auth_option']; ?>]" multiple="multiple"><?php echo $auth_users[$auth_options[$i]['auth_option']]; ?></select></td>
! <td class="<?php echo $cell_bg; ?>" align="center"><select name="option[<?php echo $auth_options[$i]['auth_option']; ?>]" multiple="multiple"><?php echo $auth_groups[$auth_options[$i]['auth_option']]; ?></select></td>
! </tr>
!
! <?php
! }
!
! ?>
! </table>
!
! <?php
! break;
!
! case 'administrators':
! $sql = "SELECT auth_option
! FROM " . ACL_OPTIONS_TABLE . "
! WHERE auth_type LIKE 'admin'";
! $result = $db->sql_query($sql);
!
! $auth_options = array();
! while ( $row = $db->sql_fetchrow($result) )
! {
! $auth_options[] = $row;
! }
!
! $sql = "SELECT u.user_id, u.username, ao.auth_option
! FROM " . USERS_TABLE . " u, " . ACL_USERS_TABLE . " au, " . ACL_OPTIONS_TABLE . " ao
! WHERE ao.auth_type LIKE 'admin'
! AND au.auth_option_id = ao.auth_option_id
! AND u.user_id = au.user_id
! ORDER BY u.username, u.user_regdate ASC";
! $result = $db->sql_query($sql);
!
! $auth_users = array();
! while ( $row = $db->sql_fetchrow($result) )
! {
! $auth_users[$row['auth_option']] .= '<option value="' . $row['user_id'] . '">' . $row['username'] . '</option>';
! }
!
! $sql = "SELECT g.group_id, g.group_name, ao.auth_option
! FROM " . GROUPS_TABLE . " g, " . ACL_GROUPS_TABLE . " ag, " . ACL_OPTIONS_TABLE . " ao
! WHERE ao.auth_type LIKE 'admin'
! AND ag.auth_option_id = ao.auth_option_id
! AND g.group_id = ag.group_id
! ORDER BY g.group_name ASC";
! $result = $db->sql_query($sql);
!
! $auth_groups = array();
! while ( $row = $db->sql_fetchrow($result) )
! {
! $auth_groups[$row['auth_option']] .= '<option value="' . $row['group_id'] . '">' . ( ( $row['group_name'] == 'ADMINISTRATORS' ) ? $lang['Admin_group'] : $row['group_name'] ) . '</option>';
! }
!
! ?>
!
! <table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
! <tr>
! <th>Setting</th>
! <th>Users</th>
! <th>Groups</th>
! </tr>
! <?php
! for($i = 0; $i < sizeof($auth_options); $i++)
! {
! $cell_bg = ( $cell_bg == 'row1' ) ? 'row2' : 'row1';
!
! $l_can_cell = ( !empty($lang['acl_admin_' . $auth_options[$i]['auth_option']]) ) ? $lang['acl_admin_' . $auth_options[$i]['auth_option']] : $auth_options[$i]['auth_option'];
!
! ?>
! <tr>
! <td class="<?php echo $cell_bg; ?>"><?php echo $l_can_cell; ?></td>
! <td class="<?php echo $cell_bg; ?>" align="center"><?php if ( !empty($auth_users[$auth_options[$i]['auth_option']]) ) { ?><select name="user_option[<?php echo $auth_options[$i]['auth_option']; ?>]"><?php echo $auth_users[$auth_options[$i]['auth_option']]; ?></select><?php } else { ?> <?php } ?></td>
! <td class="<?php echo $cell_bg; ?>" align="center"><?php if ( !empty($auth_groups[$auth_options[$i]['auth_option']]) ) { ?><select name="group_option[<?php echo $auth_options[$i]['auth_option']; ?>]"><?php echo $auth_groups[$auth_options[$i]['auth_option']]; ?></select><?php } else { ?> <?php } ?></td>
! </tr>
!
! <?php
! }
!
! ?>
! </table>
! <?php
! break;
}
!
!
! ?>
!
! <?php echo $s_hidden_fields; ?></form>
!
! <?php
!
}
else
***************
*** 109,122 ****
?>
! <h1><?php echo $lang['Permissions']; ?></h1>
! <p><?php echo $lang['Permissions_explain']; ?></p>
! <form method="post" action="<?php echo "admin_permissions.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1">
<tr>
<th align="center"><?php echo $lang['Select_a_Forum']; ?></th>
</tr>
<tr>
! <td class="row1" align="center"> <select name="f"><?php echo $select_list; ?></select> <input type="submit" value="<?php echo $lang['Look_up_Forum']; ?>" class="mainoption" /> </td>
</tr>
</table></form>
--- 326,339 ----
?>
! <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">
<tr>
<th align="center"><?php echo $lang['Select_a_Forum']; ?></th>
</tr>
<tr>
! <td class="row1" align="center"> <select name="f"><?php echo $select_list; ?></select> <input type="submit" value="<?php echo $lang['Look_up_Forum']; ?>" class="mainoption" /> </td>
</tr>
</table></form>
Index: admin_search.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_search.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** admin_search.php 5 Jul 2002 23:52:14 -0000 1.1
--- admin_search.php 14 Jul 2002 14:51:03 -0000 1.2
***************
*** 1,5 ****
<?php
/***************************************************************************
! * admin_search.php
* -------------------
* begin : Saturday, Feb 13, 2001
--- 1,5 ----
<?php
/***************************************************************************
! * admin_search.php
* -------------------
* begin : Saturday, Feb 13, 2001
***************
*** 33,36 ****
--- 33,40 ----
}
+ define('IN_PHPBB', 1);
+ //
+ // Include files
+ //
$phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc');
***************
*** 49,69 ****
// Start indexing
//
! if ( isset($HTTP_POST_VARS['start']) )
{
//
// Do not change anything below this line.
//
! set_time_limit(0);
$common_percent = 0.4; // Percentage of posts in which a word has to appear to be marked as common
- print "<html>\n<body>\n";
-
//
// Try and load stopword and synonym files
//
// This needs fixing! Shouldn't be hardcoded to English files!
! $stopword_array = file($phpbb_root_path . "language/lang_english/search_stopwords.txt");
! $synonym_array = file($phpbb_root_path . "language/lang_english/search_synonyms.txt");
//
--- 53,101 ----
// Start indexing
//
! if ( isset($HTTP_POST_VARS['start']) || isset($HTTP_GET_VARS['batchstart']) )
{
//
// Do not change anything below this line.
//
! @set_time_limit(0);
$common_percent = 0.4; // Percentage of posts in which a word has to appear to be marked as common
//
// Try and load stopword and synonym files
//
// This needs fixing! Shouldn't be hardcoded to English files!
! $stopword_array = array();
! $synonym_array = array();
!
! $dir = opendir($phpbb_root_path . 'language/');
! while ( $file = readdir($dir) )
! {
! if ( ereg('^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_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_merge($synonym_array, $tmp_array);
! }
! }
! }
!
! closedir($dir);
!
! $sql = "UPDATE " . CONFIG_TABLE . "
! SET config_value = '1'
! WHERE config_name = 'board_disable'";
! $db->sql_query($sql);
//
***************
*** 71,80 ****
//
$sql = "SELECT COUNT(*) as total, MAX(post_id) as max_post_id
! FROM ". POSTS_TEXT_TABLE;
! if ( !($result = $db->sql_query($sql)) )
! {
! $error = $db->sql_error();
! die("Couldn't get maximum post ID :: " . $sql . " :: " . $error['message']);
! }
$max_post_id = $db->sql_fetchrow($result);
--- 103,108 ----
//
$sql = "SELECT COUNT(*) as total, MAX(post_id) as max_post_id
! FROM " . POSTS_TEXT_TABLE;
! $result = $db->sql_query($sql);
$max_post_id = $db->sql_fetchrow($result);
***************
*** 83,90 ****
$max_post_id = $max_post_id['max_post_id'];
! $postcounter = (!isset($HTTP_GET_VARS['batchstart'])) ? 0 : $HTTP_GET_VARS['batchstart'];
- $batchsize = 200; // Process this many posts per loop
$batchcount = 0;
for(;$postcounter <= $max_post_id; $postcounter += $batchsize)
{
--- 111,118 ----
$max_post_id = $max_post_id['max_post_id'];
! $postcounter = ( !isset($HTTP_GET_VARS['batchstart']) ) ? 0 : $HTTP_GET_VARS['batchstart'];
$batchcount = 0;
+ $batchsize = 200; // Process this many posts per loop
for(;$postcounter <= $max_post_id; $postcounter += $batchsize)
{
***************
*** 98,130 ****
BETWEEN $batchstart
AND $batchend";
! if( !($result = $db->sql_query($sql)) )
! {
! $error = $db->sql_error();
! die("Couldn't get post_text :: " . $sql . " :: " . $error['message']);
! }
!
! $rowset = $db->sql_fetchrowset($result);
! $db->sql_freeresult($result);
!
! $post_rows = count($rowset);
! if( $post_rows )
{
! // $sql = "LOCK TABLES ".POST_TEXT_TABLE." WRITE";
! // $result = $db->sql_query($sql);
! print "\n<p>\n<a href='$PHP_SELF?batchstart=$batchstart'>Restart from posting $batchstart</a><br>\n";
!
! // For every post in the batch:
! for($post_nr = 0; $post_nr < $post_rows; $post_nr++ )
! {
! print ".";
! flush();
! $post_id = $rowset[$post_nr]['post_id'];
$matches = array();
! $matches['text'] = split_words(clean_words("post", $rowset[$post_nr]['post_text'], $stopword_array, $synonym_array));
! $matches['title'] = split_words(clean_words("post", $rowset[$post_nr]['post_subject'], $stopword_array, $synonym_array));
while( list($match_type, $match_ary) = @each($matches) )
--- 126,143 ----
BETWEEN $batchstart
AND $batchend";
! $result = $db->sql_query($sql);
! if ( $row = $db->sql_fetchrow($result) )
{
+ do
+ {
! // print "\n<p>\n<a href='$PHP_SELF?batchstart=$batchstart'>Restart from posting $batchstart</a><br>\n";
! $post_id = $row['post_id'];
$matches = array();
! $matches['text'] = split_words(clean_words('post', $row['post_text'], $stopword_array, $synonym_array));
! $matches['title'] = split_words(clean_words('post', $row['post_subject'], $stopword_array, $synonym_array));
while( list($match_type, $match_ary) = @each($matches) )
***************
*** 141,146 ****
// For all words in the posting
! $sql_in = "";
!
$sql_insert = '';
$sql_select = '';
--- 154,158 ----
// For all words in the posting
! $sql_in = '';
$sql_insert = '';
$sql_select = '';
***************
*** 151,156 ****
for($j = 0; $j < $num_matches; $j++)
{
! $this_word = strtolower(trim($match_ary[$j]));
! if ( $this_word != '' )
{
$word_count[$this_word] = ( isset($word_count[$this_word]) ) ? $word_count[$this_word] + 1 : 0;
--- 163,167 ----
for($j = 0; $j < $num_matches; $j++)
{
! if ( $this_word = strtolower(trim($match_ary[$j])) )
{
$word_count[$this_word] = ( isset($word_count[$this_word]) ) ? $word_count[$this_word] + 1 : 0;
***************
*** 164,178 ****
if ( $sql_insert == '' )
{
! die("no words found");
}
! $sql = 'INSERT IGNORE INTO ' . SEARCH_WORD_TABLE . "
! (word_text)
VALUES $sql_insert";
! if ( !$result = $db->sql_query($sql) )
! {
! $error = $db->sql_error();
! die("Couldn't INSERT words :: " . $sql . " :: " . $error['message']);
! }
// Get the word_id's out of the DB (to see if they are already there)
--- 175,184 ----
if ( $sql_insert == '' )
{
! message_die(ERROR, 'No words found to index');
}
! $sql = "INSERT IGNORE INTO " . SEARCH_WORD_TABLE . " (word_text)
VALUES $sql_insert";
! $db->sql_query($sql);
// Get the word_id's out of the DB (to see if they are already there)
***************
*** 181,227 ****
WHERE word_text IN ($sql_select)
GROUP BY word_text";
! $result = $db->sql_query($sql);
! if ( !$result )
! {
! $error = $db->sql_error();
! die("Couldn't select words :: " . $sql . " :: " . $error['message']);
! }
$sql_insert = array();
! while( $row = $db->sql_fetchrow($result) )
{
$sql_insert[] = "($post_id, " . $row['word_id'] . ", $title_match)";
}
! $db->sql_freeresult($result);
! $sql = "INSERT INTO " . SEARCH_MATCH_TABLE . "
! (post_id, word_id, title_match)
! VALUES " . implode(", ", $sql_insert);
! $result = $db->sql_query($sql);
! if ( !$result )
! {
! $error = $db->sql_error();
! die("Couldn't insert new word match :: " . $sql . " :: " . $error['message']);
! }
} // All posts
}
!
! // $sql = "UNLOCK TABLES";
! // $result = $db->sql_query($sql);
!
}
// Remove common words after the first 2 batches and after every 4th batch after that.
! if( $batchcount % 4 == 3 )
{
! print "<br>Removing common words (words that appear in more than $common_percent of the posts)<br>\n";
! flush();
! print "Removed ". remove_common("global", $common_percent) ." words that where too common.<br>";
}
}
echo "<br>Done";
}
--- 187,220 ----
WHERE word_text IN ($sql_select)
GROUP BY word_text";
! $result2 = $db->sql_query($sql);
$sql_insert = array();
! while( $row = $db->sql_fetchrow($result2) )
{
$sql_insert[] = "($post_id, " . $row['word_id'] . ", $title_match)";
}
! $db->sql_freeresult($result2);
! $sql = "INSERT INTO " . SEARCH_MATCH_TABLE . " (post_id, word_id, title_match)
! VALUES " . implode(', ', $sql_insert);
! $db->sql_query($sql);
} // All posts
}
! while ( $row = $db->sql_fetchrow($result) );
}
// Remove common words after the first 2 batches and after every 4th batch after that.
! if ( $batchcount % 4 == 3 )
{
! // print "<br>Removing common words (words that appear in more than $common_percent of the posts)<br>\n";
! // flush();
! // print "Removed ". remove_common("global", $common_percent) ." words that where too common.<br>";
}
}
echo "<br>Done";
+ exit;
}
Index: admin_styles.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_styles.php,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** admin_styles.php 2 Apr 2002 21:13:47 -0000 1.27
--- admin_styles.php 14 Jul 2002 14:51:03 -0000 1.28
***************
*** 1,937 ****
<?php
- /***************************************************************************
- * admin_styles.php
- * -------------------
- * begin : Thursday, Jul 12, 2001
- * copyright : (C) 2001 The phpBB Group
- * email : su...@ph...
- *
- * $Id$
- *
[...1168 lines suppressed...]
{
! 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 name="' . $row['template_path'] . '"' . $selected . '>' . $row['template_path'] . '</option>';
! }
!
! return $tplroot_options;
}
! ?>
\ No newline at end of file
Index: admin_users.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_users.php,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -r1.57 -r1.58
*** admin_users.php 27 Mar 2002 19:15:39 -0000 1.57
--- admin_users.php 14 Jul 2002 14:51:03 -0000 1.58
***************
*** 9,13 ****
* $Id$
*
- *
***************************************************************************/
--- 9,12 ----
***************
*** 21,28 ****
***************************************************************************/
! define('IN_PHPBB', 1);
!
! if( !empty($setmodules) )
{
$filename = basename(__FILE__);
$module['Users']['Manage'] = $filename;
--- 20,30 ----
***************************************************************************/
! if ( !empty($setmodules) )
{
+ if ( !$acl->get_acl_admin('user') )
+ {
+ return;
+ }
+
$filename = basename(__FILE__);
$module['Users']['Manage'] = $filename;
***************
*** 31,43 ****
}
! $phpbb_root_path = "../";
require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx);
require($phpbb_root_path . 'includes/bbcode.'.$phpEx);
! require($phpbb_root_path . 'includes/functions_post.'.$phpEx);
! require($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
require($phpbb_root_path . 'includes/functions_validate.'.$phpEx);
//
// Set mode
//
--- 33,56 ----
}
! define('IN_PHPBB', 1);
! //
! // Include files
! //
! $phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx);
require($phpbb_root_path . 'includes/bbcode.'.$phpEx);
! require($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
require($phpbb_root_path . 'includes/functions_validate.'.$phpEx);
//
+ // Do we have forum admin permissions?
+ //
+ if ( !$acl->get_acl_admin('user') )
+ {
+ return;
+ }
+
+ //
// Set mode
//
***************
*** 54,58 ****
// Begin program
//
! if( $mode == 'edit' || $mode == 'save' && ( isset($HTTP_POST_VARS['username']) || isset($HTTP_GET_VARS[POST_USERS_URL]) || isset( $HTTP_POST_VARS[POST_USERS_URL]) ) )
{
//
--- 67,71 ----
// Begin program
//
! if ( $mode == 'edit' || $mode == 'save' && ( isset($HTTP_POST_VARS['username']) || isset($HTTP_GET_VARS['u']) || isset( $HTTP_POST_VARS['u']) ) )
{
//
***************
*** 66,70 ****
if( !$this_userdata )
{
! message_die(GENERAL_MESSAGE, $lang['No_user_id_specified'] );
}
--- 79,83 ----
if( !$this_userdata )
{
! message_die(MESSAGE, $lang['No_user_id_specified'] );
}
***************
*** 205,212 ****
$sql = "DELETE FROM " . SESSIONS_TABLE . "
WHERE session_user_id = $user_id";
! if( !$db->sql_query($sql) )
! {
! message_die(GENERAL_ERROR, 'Could not delete this users sessions', '', __LINE__, __FILE__, $sql);
! }
}
--- 218,222 ----
$sql = "DELETE FROM " . SESSIONS_TABLE . "
WHERE session_user_id = $user_id";
! $db->sql_query($sql);
}
***************
*** 240,244 ****
// Avatar stuff
//
! $avatar_sql = "";
if( isset($HTTP_POST_VARS['avatardel']) )
{
--- 250,254 ----
// Avatar stuff
//
! $avatar_sql = '';
if( isset($HTTP_POST_VARS['avatardel']) )
{
***************
*** 516,576 ****
AND g.group_id = ug.group_id
AND g.group_single_user = 1";
! if( !($result = $db->sql_query($sql)) )
! {
! message_die(GENERAL_ERROR, 'Could not obtain group information for this user', '', __LINE__, __FILE__, $sql);
! }
$row = $db->sql_fetchrow($result);
!
$sql = "UPDATE " . POSTS_TABLE . "
SET poster_id = " . ANONYMOUS . ", post_username = '$username'
WHERE poster_id = $user_id";
! if( !$db->sql_query($sql) )
! {
! message_die(GENERAL_ERROR, 'Could not update posts for this user', '', __LINE__, __FILE__, $sql);
! }
$sql = "UPDATE " . TOPICS_TABLE . "
SET topic_poster = " . ANONYMOUS . "
WHERE topic_poster = $user_id";
! if( !$db->sql_query($sql) )
! {
! message_die(GENERAL_ERROR, 'Could not update topics for this user', '', __LINE__, __FILE__, $sql);
! }
$sql = "DELETE FROM " . USERS_TABLE . "
WHERE user_id = $user_id";
! if( !$db->sql_query($sql) )
! {
! message_die(GENERAL_ERROR, 'Could not delete user', '', __LINE__, __FILE__, $sql);
! }
$sql = "DELETE FROM " . USER_GROUP_TABLE . "
WHERE user_id = $user_id";
! if( !$db->sql_query($sql) )
! {
! message_die(GENERAL_ERROR, 'Could not delete user from user_group table', '', __LINE__, __FILE__, $sql);
! }
$sql = "DELETE FROM " . GROUPS_TABLE . "
WHERE group_id = " . $row['group_id'];
! if( !$db->sql_query($sql) )
! {
! message_die(GENERAL_ERROR, 'Could not delete group for this user', '', __LINE__, __FILE__, $sql);
! }
$sql = "DELETE FROM " . AUTH_ACCESS_TABLE . "
WHERE group_id = " . $row['group_id'];
! if( !$db->sql_query($sql) )
! {
! message_die(GENERAL_ERROR, 'Could not delete group for this user', '', __LINE__, __FILE__, $sql);
! }
$sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "
WHERE user_id = $user_id";
! if ( !$db->sql_query($sql) )
! {
! message_die(GENERAL_ERROR, 'Could not delete user from topic watch table', '', __LINE__, __FILE__, $sql);
! }
$message = $lang['User_deleted'];
--- 526,567 ----
AND g.group_id = ug.group_id
AND g.group_single_user = 1";
! $result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
! $db->sql_freeresult($result);
!
! $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 " . GROUPS_TABLE . "
WHERE group_id = " . $row['group_id'];
! $db->sql_query($sql);
$sql = "DELETE FROM " . AUTH_ACCESS_TABLE . "
WHERE group_id = " . $row['group_id'];
! $db->sql_query($sql);
$sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "
WHERE user_id = $user_id";
! $db->sql_query($sql);
!
! $db->sql_transaction('commit');
$message = $lang['User_deleted'];
***************
*** 582,609 ****
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) . "', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", $aim) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_sig_bbcode_uid = '$signature_bbcode_uid', user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_allow_pm = $user_allowpm, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_active = $user_status, user_rank = $user_rank" . $avatar_sql . "
WHERE user_id = $user_id";
! if( $result = $db->sql_query($sql) )
! {
! if( isset($rename_user) )
! {
! $sql = "UPDATE " . GROUPS_TABLE . "
! SET group_name = '".str_replace("\'", "''", $rename_user)."'
! WHERE group_name = '".str_replace("\'", "''", $this_userdata['username'] )."'";
! if( !$result = $db->sql_query($sql) )
! {
! message_die(GENERAL_ERROR, 'Could not rename users group', '', __LINE__, __FILE__, $sql);
! }
! }
! $message .= $lang['Admin_user_updated'];
! }
! else
{
! $error = TRUE;
! $error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Admin_user_fail'];
}
}
! $message .= '<br /><br />' . sprintf($lang['Click_return_useradmin'], '<a href="' . append_sid("admin_users.$phpEx") . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid("index.$phpEx?pane=right") . '">', '</a>');
! message_die(GENERAL_MESSAGE, $message);
}
else
--- 573,592 ----
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) . "', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", $aim) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_sig_bbcode_uid = '$signature_bbcode_uid', user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_allow_pm = $user_allowpm, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_active = $user_status, user_rank = $user_rank" . $avatar_sql . "
WHERE user_id = $user_id";
! $result = $db->sql_query($sql);
!
! if ( isset($rename_user) )
{
! $sql = "UPDATE " . GROUPS_TABLE . "
! SET group_name = '".str_replace("\'", "''", $rename_user)."'
! WHERE group_name = '".str_replace("\'", "''", $this_userdata['username'] )."'";
! $db->sql_query($sql);
}
+
+ $message .= $lang['Admin_user_updated'];
}
! $message .= '<br /><br />' . sprintf($lang['Click_return_useradmin'], '<a href="' . "admin_users.$phpEx$SID" . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . "index.$phpE$SID?pane=right" . '">', '</a>');
! message_die(MESSAGE, $message);
}
else
***************
*** 647,651 ****
if( !$this_userdata )
{
! message_die(GENERAL_MESSAGE, $lang['No_user_id_specified'] );
}
}
--- 630,634 ----
if( !$this_userdata )
{
! message_die(MESSAGE, $lang['No_user_id_specified'] );
}
}
***************
*** 655,659 ****
if( !$this_userdata )
{
! message_die(GENERAL_MESSAGE, $lang['No_user_id_specified'] );
}
}
--- 638,642 ----
if( !$this_userdata )
{
! message_die(MESSAGE, $lang['No_user_id_specified'] );
}
}
***************
*** 871,878 ****
WHERE rank_special = 1
ORDER BY rank_title";
! if ( !($result = $db->sql_query($sql)) )
! {
! message_die(GENERAL_ERROR, 'Could not obtain ranks data', '', __LINE__, __FILE__, $sql);
! }
$rank_select_box = '<option value="0">' . $lang['No_assigned_rank'] . '</option>';
--- 854,858 ----
WHERE rank_special = 1
ORDER BY rank_title";
! $result = $db->sql_query($sql);
$rank_select_box = '<option value="0">' . $lang['No_assigned_rank'] . '</option>';
***************
*** 1002,1006 ****
'HTML_STATUS' => $html_status,
! 'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="../' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>'),
'SMILIES_STATUS' => $smilies_status,
--- 982,986 ----
'HTML_STATUS' => $html_status,
! 'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="../' . "faq.$phpEx$SID&mode=bbcode" . '" target="_phpbbcode">', '</a>'),
'SMILIES_STATUS' => $smilies_status,
***************
*** 1010,1014 ****
'S_HIDDEN_FIELDS' => $s_hidden_fields,
! 'S_PROFILE_ACTION' => append_sid("admin_users.$phpEx"))
);
--- 990,994 ----
'S_HIDDEN_FIELDS' => $s_hidden_fields,
! 'S_PROFILE_ACTION' => "admin_u...
[truncated message content] |