Update of /cvsroot/phpbb/phpBB2/admin
In directory usw-pr-cvs1:/tmp/cvs-serv14210
Modified Files:
admin_board.php admin_db_utilities.php admin_forumauth.php
admin_forum_prune.php admin_forums.php admin_groupauth.php
admin_groups.php admin_mass_email.php admin_ranks.php
admin_smilies.php admin_userauth.php admin_user_ban.php
admin_users.php admin_words.php index.php
page_footer_admin.php page_header_admin.php pagestart.inc
Added Files:
admin_styles.php
Log Message:
Various updates, cleanups and support for URI based sessions ... more to come at some point
--- NEW FILE ---
<?php
/***************************************************************************
* admin_words.php
* -------------------
* begin : Thursday, Jul 12, 2001
* copyright : (C) 2001 The phpBB Group
* email : su...@ph...
*
* $Id: admin_styles.php,v 1.1 2001/10/14 15:46:53 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($setmodules == 1)
{
$file = basename(__FILE__);
$module['Styles']['Add_new'] = "$file?mode=addnew";
$module['Styles']['Create_new'] = "$file?mode=addnew";
$module['Styles']['Manage'] = "$file";
return;
}
//
// Load default header
//
$phpbb_root_dir = "./../";
require('pagestart.inc');
if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{
$mode = ($HTTP_GET_VARS['mode']) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
}
else
{
$mode = "";
}
include('page_footer_admin.'.$phpEx);
?>
Index: admin_board.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_board.php,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** admin_board.php 2001/10/11 22:01:11 1.27
--- admin_board.php 2001/10/14 15:46:53 1.28
***************
*** 23,32 ****
//
$phpbb_root_dir = "./../";
//
- // Include required files, get $phpEx and check permissions
//
! require('pagestart.inc');
!
$sql = "SELECT *
FROM " . CONFIG_TABLE;
--- 23,31 ----
//
$phpbb_root_dir = "./../";
+ require('pagestart.inc');
//
//
! //
$sql = "SELECT *
FROM " . CONFIG_TABLE;
***************
*** 98,102 ****
$template->set_filenames(array(
! "body" => "admin/admin_config_body.tpl")
);
--- 97,101 ----
$template->set_filenames(array(
! "body" => "admin/board_config_body.tpl")
);
Index: admin_db_utilities.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_db_utilities.php,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** admin_db_utilities.php 2001/09/25 00:48:12 1.25
--- admin_db_utilities.php 2001/10/14 15:46:53 1.26
***************
*** 38,64 ****
}
- $phpbb_root_path = "./../";
- include($phpbb_root_path . 'extension.inc');
- include($phpbb_root_path . 'common.'.$phpEx);
//
! // Start session management
//
! $userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
! init_userprefs($userdata);
! //
! // End session management
! //
!
! //
! // Is user logged in? If yes are they an admin?
! //
! if( !$userdata['session_logged_in'] )
! {
! header("Location: ../login.$phpEx?forward_page=admin/");
! }
! else if( $userdata['user_level'] != ADMIN )
! {
! message_die(GENERAL_MESSAGE, $lang['Not_admin']);
! }
//
--- 38,48 ----
}
//
! // Load default header
//
! $phpbb_root_dir = "./../";
! $no_page_header = TRUE;
! require('pagestart.inc');
! include($phpbb_root_path . 'includes/sql_parse.'.$phpEx);
//
***************
*** 73,86 ****
@set_time_limit(1200);
! //
! // Pull in the functions for splitting an sql file into individual statements
! //
!
! include($phpbb_root_path . 'includes/sql_parse.'.$phpEx);
!
! //
// The following functions are adapted from phpMyAdmin and upgrade_20.php
//
-
//
// This function is used for grabbing the sequences for postgres...
--- 57,63 ----
@set_time_limit(1200);
! // -----------------------
// The following functions are adapted from phpMyAdmin and upgrade_20.php
//
//
// This function is used for grabbing the sequences for postgres...
Index: admin_forumauth.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_forumauth.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** admin_forumauth.php 2001/09/06 00:29:07 1.12
--- admin_forumauth.php 2001/10/14 15:46:53 1.13
***************
*** 21,24 ****
--- 21,26 ----
***************************************************************************/
+ define("IN_ADMIN", true);
+
if($setmodules == 1)
{
***************
*** 30,37 ****
//
! // Include required files, get $phpEx and check permissions
//
require('pagestart.inc');
//
// Start program - define vars
--- 32,42 ----
//
! // Load default header
//
+ $phpbb_root_dir = "./../";
+ $no_page_header = TRUE;
require('pagestart.inc');
+
//
// Start program - define vars
***************
*** 68,72 ****
if(isset($HTTP_GET_VARS[POST_FORUM_URL]) || isset($HTTP_POST_VARS[POST_FORUM_URL]))
{
! $forum_id = (isset($HTTP_POST_VARS[POST_FORUM_URL])) ? $HTTP_POST_VARS[POST_FORUM_URL] : $HTTP_GET_VARS[POST_FORUM_URL];
$forum_sql = "AND forum_id = $forum_id";
}
--- 73,77 ----
if(isset($HTTP_GET_VARS[POST_FORUM_URL]) || isset($HTTP_POST_VARS[POST_FORUM_URL]))
{
! $forum_id = (isset($HTTP_POST_VARS[POST_FORUM_URL])) ? intval($HTTP_POST_VARS[POST_FORUM_URL]) : intval($HTTP_GET_VARS[POST_FORUM_URL]);
$forum_sql = "AND forum_id = $forum_id";
}
***************
*** 79,83 ****
if( isset($HTTP_GET_VARS['adv']) )
{
! $adv = $HTTP_GET_VARS['adv'];
}
else
--- 84,88 ----
if( isset($HTTP_GET_VARS['adv']) )
{
! $adv = intval($HTTP_GET_VARS['adv']);
}
else
***************
*** 89,93 ****
// Start program proper
//
! if(isset($HTTP_POST_VARS['submit']))
{
$sql = "";
--- 94,98 ----
// Start program proper
//
! if( isset($HTTP_POST_VARS['submit']) )
{
$sql = "";
***************
*** 125,128 ****
--- 130,142 ----
}
}
+
+ if($forum_auth_fields[$i] == 'auth_vote')
+ {
+ if( $HTTP_POST_VARS['auth_vote'] == AUTH_ALL )
+ {
+ $value = AUTH_REG;
+ }
+ }
+
$sql .= $forum_auth_fields[$i] . " = " . $value;
if($i < count($forum_auth_fields) - 1)
***************
*** 144,152 ****
}
- unset($forum_id);
$forum_sql = "";
$adv = 0;
-
}
}
--- 158,171 ----
}
$forum_sql = "";
$adv = 0;
}
+
+ $template->assign_vars(array(
+ "META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("admin_forumauth.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">')
+ );
+ $message = $lang['Forum_auth_updated'] . "<br /><br />" . $lang['Click'] . " <a href=\"" . append_sid("admin_forumauth.$phpEx?" . POST_FORUM_URL . "=$forum_id") . "\">" . $lang['Here'] . "</a> " . $lang['return_forum_auth_admin'];
+ message_die(GENERAL_MESSAGE, $message);
+
}
***************
*** 165,169 ****
$forum_rows = $db->sql_fetchrowset($f_result);
! if(empty($forum_id))
{
//
--- 184,188 ----
$forum_rows = $db->sql_fetchrowset($f_result);
! if( empty($forum_id) )
{
//
***************
*** 235,239 ****
if( empty($adv) )
{
! $simple_auth = " <select name=\"simpleauth\">";
for($j = 0; $j < count($simple_auth_types); $j++)
--- 254,258 ----
if( empty($adv) )
{
! $simple_auth = "<select name=\"simpleauth\">";
for($j = 0; $j < count($simple_auth_types); $j++)
***************
*** 251,255 ****
}
! $simple_auth .= "</select> ";
$template->assign_block_vars("forum_auth_titles", array(
--- 270,274 ----
}
! $simple_auth .= "</select>";
$template->assign_block_vars("forum_auth_titles", array(
***************
*** 300,304 ****
}
! $switch_mode = "admin_forumauth.$phpEx?" . POST_FORUM_URL . "=" . $forum_id . "&adv=";
$switch_mode .= ( empty($adv) ) ? "1" : "0";
$switch_mode_text = ( empty($adv) ) ? $lang['Advanced_mode'] : $lang['Simple_mode'];
--- 319,323 ----
}
! $switch_mode = append_sid("admin_forumauth.$phpEx?" . POST_FORUM_URL . "=" . $forum_id . "&adv=");
$switch_mode .= ( empty($adv) ) ? "1" : "0";
$switch_mode_text = ( empty($adv) ) ? $lang['Advanced_mode'] : $lang['Simple_mode'];
***************
*** 323,326 ****
--- 342,347 ----
}
+
+ include('page_header_admin.'.$phpEx);
$template->pparse("body");
Index: admin_forum_prune.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_forum_prune.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** admin_forum_prune.php 2001/09/06 00:44:46 1.8
--- admin_forum_prune.php 2001/10/14 15:46:53 1.9
***************
*** 42,47 ****
//
! // Include required files, get $phpEx and check permissions
//
require('pagestart.inc');
include($phpbb_root_path . 'includes/prune.php');
--- 42,48 ----
//
! // Load default header
//
+ $phpbb_root_dir = "./../";
require('pagestart.inc');
include($phpbb_root_path . 'includes/prune.php');
Index: admin_forums.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_forums.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** admin_forums.php 2001/09/11 04:03:00 1.22
--- admin_forums.php 2001/10/14 15:46:53 1.23
***************
*** 23,31 ****
if($setmodules==1)
{
! $file = basename(__FILE__);
! $module['Forums']['Manage'] = $file;
! return;
}
// ------------------
// Begin function block
--- 23,46 ----
if($setmodules==1)
{
! $file = basename(__FILE__);
! $module['Forums']['Manage'] = $file;
! return;
}
+ //
+ // Load default header
+ //
+ $phpbb_root_dir = "./../";
+ require('pagestart.inc');
+
+ if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) )
+ {
+ $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
+ }
+ else
+ {
+ $mode = "";
+ }
+
// ------------------
// Begin function block
***************
*** 190,211 ****
//
! // Include required files, get $phpEx and check permissions
//
! require('pagestart.inc');
!
! if (isset($HTTP_POST_VARS['mode']))
{
! $mode = $HTTP_POST_VARS['mode'];
! }
! elseif (isset($HTTP_GET_VARS['mode']))
! {
! $mode = $HTTP_GET_VARS['mode'];
! }
! else
! {
! unset($mode);
}
! if(isset($mode)) // Are we supposed to do something?
{
switch($mode)
--- 205,222 ----
//
! // Begin program proper
//
! if( isset($HTTP_POST_VARS['addforum']) || isset($HTTP_POST_VARS['addcategory']) )
{
! $mode = ( isset($HTTP_POST_VARS['addforum']) ) ? "addforum" : "addcat";
!
! if( $mode == "addforum" )
! {
! list($cat_id) = each($HTTP_POST_VARS['addforum']);
! $forumname = $HTTP_POST_VARS['forumname'][$cat_id];
! }
}
! if( !empty($mode) )
{
switch($mode)
***************
*** 213,282 ****
case 'addforum':
case 'editforum':
// Show form to create/modify a forum
if ($mode == 'editforum')
{
// $newmode determines if we are going to INSERT or UPDATE after posting?
$newmode = 'modforum';
! $buttonvalue = 'Change';
! $forum_id = $HTTP_GET_VARS['forum_id'];
$row = get_info('forum', $forum_id);
! $forumname = $row['forum_name'];
$cat_id = $row['cat_id'];
$forumdesc = $row['forum_desc'];
$forumstatus = $row['forum_status'];
//
// start forum prune stuff.
//
! if( $row['prune_enable'] == 1 )
{
$prune_enabled = "checked=\"checked\"";
$sql = "SELECT *
! FROM " . PRUNE_TABLE . "
! WHERE forum_id = $forum_id";
if(!$pr_result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Auto-Prune: Couldn't read auto_prune table.", __LINE__, __FILE__);
}
$pr_row = $db->sql_fetchrow($pr_result);
}
}
else
{
$newmode = 'createforum';
! $buttonvalue = 'Create';
- $forumname = stripslashes($HTTP_POST_VARS['forumname']);
- $cat_id = $HTTP_POST_VARS['cat_id'];
$forumdesc = '';
$forumstatus = FORUM_UNLOCKED;
! $forum_id = '';
}
$catlist = get_list('category', $cat_id, TRUE);
! $forumstatus == FORUM_LOCKED ? $forumlocked = "selected=\"selected\"" : $forumunlocked = "selected=\"selected\"";
! $statuslist = "<option value=\"".FORUM_UNLOCKED."\" $forumunlocked>Unlocked</option>\n";
! $statuslist .= "<option value=\"".FORUM_LOCKED."\" $forumlocked>Locked</option>\n";
$template->set_filenames(array(
"body" => "admin/forum_edit_body.tpl")
);
$template->assign_vars(array(
! 'FORUMNAME' => $forumname,
! 'DESCRIPTION' => $forumdesc,
! 'S_FORUM_ACTION' => $PHP_SELF,
'S_CATLIST' => $catlist,
'S_STATUSLIST' => $statuslist,
'S_FORUMID' => $forum_id,
'S_NEWMODE' => $newmode,
! 'S_PRUNE_EN' => $prune_enabled,
! 'S_PRUNE_DAYS' => $pr_row['prune_days'],
! 'S_PRUNE_FREQ' => $pr_row['prune_freq'],
'L_ENABLED' => $lang['Enabled'],
'L_PRUNE_DAYS' => $lang['prune_days'],
'L_PRUNE_FREQ' => $lang['prune_freq'],
'L_DAYS' => $lang['days'],
'BUTTONVALUE' => $buttonvalue)
);
--- 224,309 ----
case 'addforum':
case 'editforum':
+ //
// Show form to create/modify a forum
+ //
if ($mode == 'editforum')
{
// $newmode determines if we are going to INSERT or UPDATE after posting?
+
+ $l_title = $lang['Edit_forum'];
$newmode = 'modforum';
! $buttonvalue = $lang['Update'];
! $forum_id = intval($HTTP_GET_VARS['forum_id']);
$row = get_info('forum', $forum_id);
!
$cat_id = $row['cat_id'];
+ $forumname = $row['forum_name'];
$forumdesc = $row['forum_desc'];
$forumstatus = $row['forum_status'];
+
//
// start forum prune stuff.
//
! if( $row['prune_enable'] )
{
$prune_enabled = "checked=\"checked\"";
$sql = "SELECT *
! FROM " . PRUNE_TABLE . "
! WHERE forum_id = $forum_id";
if(!$pr_result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Auto-Prune: Couldn't read auto_prune table.", __LINE__, __FILE__);
}
+
$pr_row = $db->sql_fetchrow($pr_result);
}
+ else
+ {
+ $prune_enabled = '';
+ }
}
else
{
+ $l_title = $lang['Create_forum'];
$newmode = 'createforum';
! $buttonvalue = $lang['Create_forum'];
$forumdesc = '';
$forumstatus = FORUM_UNLOCKED;
! $forum_id = '';
! $prune_enabled = '';
}
$catlist = get_list('category', $cat_id, TRUE);
! $forumstatus == ( FORUM_LOCKED ) ? $forumlocked = "selected=\"selected\"" : $forumunlocked = "selected=\"selected\"";
! $statuslist = "<option value=\"" . FORUM_UNLOCKED . "\" $forumunlocked>Unlocked</option>\n";
! $statuslist .= "<option value=\"" . FORUM_LOCKED . "\" $forumlocked>Locked</option>\n";
$template->set_filenames(array(
"body" => "admin/forum_edit_body.tpl")
);
+
$template->assign_vars(array(
! 'S_FORUM_ACTION' => append_sid("admin_forums.$phpEx"),
'S_CATLIST' => $catlist,
'S_STATUSLIST' => $statuslist,
'S_FORUMID' => $forum_id,
'S_NEWMODE' => $newmode,
! 'S_PRUNE_ENABLED' => $prune_enabled,
! 'S_PRUNE_DAYS' => ( isset($pr_row['prune_days']) ) ? $pr_row['prune_days'] : 7,
! 'S_PRUNE_FREQ' => ( isset($pr_row['prune_freq']) ) ? $pr_row['prune_freq'] : 1,
!
! "L_FORUM_TITLE" => $l_title,
! "L_FORUM_EXPLAIN" => $lang['Forum_edit_delete_explain'],
'L_ENABLED' => $lang['Enabled'],
'L_PRUNE_DAYS' => $lang['prune_days'],
'L_PRUNE_FREQ' => $lang['prune_freq'],
'L_DAYS' => $lang['days'],
+
+ 'FORUMNAME' => $forumname,
+ 'DESCRIPTION' => $forumdesc,
'BUTTONVALUE' => $buttonvalue)
);
***************
*** 285,293 ****
case 'createforum':
// Create a forum in the DB
! if( trim($HTTP_POST_VARS['forumname']) == '')
{
message_die(GENERAL_ERROR, "Can't create a forum without a name");
}
$sql = "SELECT MAX(forum_order) AS max_order
FROM " . FORUMS_TABLE . "
--- 312,323 ----
case 'createforum':
+ //
// Create a forum in the DB
! //
! if( trim($HTTP_POST_VARS['forumname']) == "" )
{
message_die(GENERAL_ERROR, "Can't create a forum without a name");
}
+
$sql = "SELECT MAX(forum_order) AS max_order
FROM " . FORUMS_TABLE . "
***************
*** 303,308 ****
// There is no problem having duplicate forum names so we won't check for it.
! $sql = "INSERT INTO " . FORUMS_TABLE . " (forum_name, cat_id, forum_desc, forum_order, forum_status)
! VALUES ('" . $HTTP_POST_VARS['forumname'] . "', " . $HTTP_POST_VARS['cat_id'] . ", '" . $HTTP_POST_VARS['forumdesc'] . "', $next_order, " . $HTTP_POST_VARS['forumstatus'] . ")";
if( !$result = $db->sql_query($sql) )
{
--- 333,338 ----
// There is no problem having duplicate forum names so we won't check for it.
! $sql = "INSERT INTO " . FORUMS_TABLE . " (forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable)
! VALUES ('" . $HTTP_POST_VARS['forumname'] . "', " . intval($HTTP_POST_VARS['cat_id']) . ", '" . $HTTP_POST_VARS['forumdesc'] . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . ")";
if( !$result = $db->sql_query($sql) )
{
***************
*** 310,323 ****
}
! if( $HTTP_POST_VARS['prune_enable'] == TRUE )
{
$new_forum_id = $db->sql_nextid();
if($HTTP_POST_VARS['prune_days'] == "" || $HTTP_POST_VARS['prune_freq'] == "")
{
! message_die(GENERAL_ERROR, $lang['Set_prune_data'], $lang['Error']);
}
$sql = "INSERT INTO " . PRUNE_TABLE . " (forum_id, prune_days, prune_freq)
! VALUES($new_forum_id, " . $HTTP_POST_VARS['prune_days'] . ", " . $HTTP_POST_VARS['prune_freq'] . ")";
if( !$result = $db->sql_query($sql) )
{
--- 340,354 ----
}
! if( $HTTP_POST_VARS['prune_enable'] )
{
$new_forum_id = $db->sql_nextid();
+
if($HTTP_POST_VARS['prune_days'] == "" || $HTTP_POST_VARS['prune_freq'] == "")
{
! message_die(GENERAL_MESSAGE, $lang['Set_prune_data']);
}
$sql = "INSERT INTO " . PRUNE_TABLE . " (forum_id, prune_days, prune_freq)
! VALUES($new_forum_id, " . intval($HTTP_POST_VARS['prune_days']) . ", " . intval($HTTP_POST_VARS['prune_freq']) . ")";
if( !$result = $db->sql_query($sql) )
{
***************
*** 335,338 ****
--- 366,370 ----
$HTTP_POST_VARS['prune_enable'] = 0;
}
+
$sql = "UPDATE " . FORUMS_TABLE . "
SET forum_name = '" . $HTTP_POST_VARS['forumname'] . "', cat_id = " . $HTTP_POST_VARS['cat_id'] . ", forum_desc = '" . $HTTP_POST_VARS['forumdesc'] . "', forum_status = " . $HTTP_POST_VARS['forumstatus'] . ", prune_enable = " . $HTTP_POST_VARS['prune_enable'] . "
***************
*** 347,351 ****
if($HTTP_POST_VARS['prune_days'] == "" || $HTTP_POST_VARS['prune_freq'] == "")
{
! message_die(GENERAL_ERROR, $lang['Set_prune_data'], $lang['Error']);
}
--- 379,383 ----
if($HTTP_POST_VARS['prune_days'] == "" || $HTTP_POST_VARS['prune_freq'] == "")
{
! message_die(GENERAL_MESSAGE, $lang['Set_prune_data']);
}
***************
*** 380,387 ****
case 'addcat':
// Create a category in the DB
! if( trim($HTTP_POST_VARS['catname']) == '')
{
message_die(GENERAL_ERROR, "Can't create a category without a name");
}
$sql = "SELECT MAX(cat_order) AS max_order
FROM " . CATEGORIES_TABLE;
--- 412,420 ----
case 'addcat':
// Create a category in the DB
! if( trim($HTTP_POST_VARS['categoryname']) == '')
{
message_die(GENERAL_ERROR, "Can't create a category without a name");
}
+
$sql = "SELECT MAX(cat_order) AS max_order
FROM " . CATEGORIES_TABLE;
***************
*** 399,403 ****
//
$sql = "INSERT INTO " . CATEGORIES_TABLE . " (cat_title, cat_order)
! VALUES ('" . $HTTP_POST_VARS['catname'] . "', $next_order)";
if( !$result = $db->sql_query($sql) )
{
--- 432,436 ----
//
$sql = "INSERT INTO " . CATEGORIES_TABLE . " (cat_title, cat_order)
! VALUES ('" . $HTTP_POST_VARS['categoryname'] . "', $next_order)";
if( !$result = $db->sql_query($sql) )
{
***************
*** 468,475 ****
case 'movedelforum':
// Move or delete a forum in the DB
! $from_id = $HTTP_POST_VARS['from_id'];
! $to_id = $HTTP_POST_VARS['to_id'];
! $delete_old = $HTTP_POST_VARS['delete_old'];
--- 501,510 ----
case 'movedelforum':
+ //
// Move or delete a forum in the DB
! //
! $from_id = intval($HTTP_POST_VARS['from_id']);
! $to_id = intval($HTTP_POST_VARS['to_id']);
! $delete_old = intval($HTTP_POST_VARS['delete_old']);
***************
*** 518,526 ****
$show_index = TRUE;
break;
case 'deletecat':
// Show form to delete a category
! $cat_id = $HTTP_GET_VARS['cat_id'];
$buttonvalue = "Move&Delete";
$newmode = 'movedelcat';
--- 553,565 ----
$show_index = TRUE;
+
break;
case 'deletecat':
+ //
// Show form to delete a category
! //
! $cat_id = intval($HTTP_GET_VARS['cat_id']);
!
$buttonvalue = "Move&Delete";
$newmode = 'movedelcat';
***************
*** 538,542 ****
$count = $db->sql_fetchrow($result);
$count = $count['total'];
! print "count = $count";
if ($count > 0)
{
--- 577,581 ----
$count = $db->sql_fetchrow($result);
$count = $count['total'];
!
if ($count > 0)
{
***************
*** 560,564 ****
$template->assign_vars(array(
'NAME' => $name,
! 'S_FORUM_ACTION' => $PHP_SELF,
'S_FROM_ID' => $cat_id,
'S_SELECT_TO' => $select_to,
--- 599,603 ----
$template->assign_vars(array(
'NAME' => $name,
! 'S_FORUM_ACTION' => append_sid("admin_forums.$phpEx"),
'S_FROM_ID' => $cat_id,
'S_SELECT_TO' => $select_to,
***************
*** 570,576 ****
case 'movedelcat':
// Move or delete a category in the DB
! $from_id = $HTTP_POST_VARS['from_id'];
! $to_id = $HTTP_POST_VARS['to_id'];
if (isset($to_id))
--- 609,617 ----
case 'movedelcat':
+ //
// Move or delete a category in the DB
! //
! $from_id = intval($HTTP_POST_VARS['from_id']);
! $to_id = intval($HTTP_POST_VARS['to_id']);
if (isset($to_id))
***************
*** 605,615 ****
$show_index = TRUE;
break;
case 'forum_order':
// Change order of forums in the DB
! $move = $HTTP_GET_VARS['move'];
! $forum_id = $HTTP_GET_VARS['forum_id'];
$forum_info = get_info('forum', $forum_id);
$cat_id = $forum_info['cat_id'];
--- 646,661 ----
$show_index = TRUE;
+
break;
case 'forum_order':
+ //
// Change order of forums in the DB
! //
! $move = intval($HTTP_GET_VARS['move']);
! $forum_id = intval($HTTP_GET_VARS['forum_id']);
!
$forum_info = get_info('forum', $forum_id);
+
$cat_id = $forum_info['cat_id'];
***************
*** 621,632 ****
message_die(GENERAL_ERROR, "Couldn't change category order", "", __LINE__, __FILE__, $sql);
}
renumber_order('forum', $forum_info['cat_id']);
$show_index = TRUE;
break;
case 'cat_order':
// Change order of categories in the DB
! $move = $HTTP_GET_VARS['move'];
! $cat_id = $HTTP_GET_VARS['cat_id'];
$sql = "UPDATE " . CATEGORIES_TABLE . "
--- 667,682 ----
message_die(GENERAL_ERROR, "Couldn't change category order", "", __LINE__, __FILE__, $sql);
}
+
renumber_order('forum', $forum_info['cat_id']);
$show_index = TRUE;
+
break;
case 'cat_order':
+ //
// Change order of categories in the DB
! //
! $move = intval($HTTP_GET_VARS['move']);
! $cat_id = intval($HTTP_GET_VARS['cat_id']);
$sql = "UPDATE " . CATEGORIES_TABLE . "
***************
*** 637,651 ****
message_die(GENERAL_ERROR, "Couldn't change category order", "", __LINE__, __FILE__, $sql);
}
renumber_order('category');
$show_index = TRUE;
break;
case 'forum_sync':
! sync('forum', $HTTP_GET_VARS['forum_id']);
$show_index = TRUE;
break;
default:
! message_die(GENERAL_ERROR, "Oops! Wrong mode..");
break;
}
--- 687,704 ----
message_die(GENERAL_ERROR, "Couldn't change category order", "", __LINE__, __FILE__, $sql);
}
+
renumber_order('category');
$show_index = TRUE;
+
break;
case 'forum_sync':
! sync('forum', intval($HTTP_GET_VARS['forum_id']));
$show_index = TRUE;
+
break;
default:
! message_die(GENERAL_MESSAGE, $lang['No_mode']);
break;
}
***************
*** 661,665 ****
//
$template->set_filenames(array(
! "body" => "admin/forums_body.tpl")
);
--- 714,730 ----
//
$template->set_filenames(array(
! "body" => "admin/forum_admin_body.tpl")
! );
!
! $template->assign_vars(array(
! "L_FORUM_TITLE" => $lang['Forum_admin'],
! "L_FORUM_EXPLAIN" => $lang['Forum_admin_explain'],
! "L_CREATE_FORUM" => $lang['Create_forum'],
! "L_CREATE_CATEGORY" => $lang['Create_category'],
! "L_EDIT" => $lang['Edit'],
! "L_DELETE" => $lang['Delete'],
! "L_MOVE_UP" => $lang['Move_up'],
! "L_MOVE_DOWN" => $lang['Move_down'],
! "L_RESYNC" => $lang['Resync'])
);
***************
*** 667,676 ****
FROM " . CATEGORIES_TABLE . "
ORDER BY cat_order";
! if(!$q_categories = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Could not query categories list", "", __LINE__, __FILE__, $sql);
}
! if($total_categories = $db->sql_numrows($q_categories))
{
$category_rows = $db->sql_fetchrowset($q_categories);
--- 732,741 ----
FROM " . CATEGORIES_TABLE . "
ORDER BY cat_order";
! if( !$q_categories = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Could not query categories list", "", __LINE__, __FILE__, $sql);
}
! if( $total_categories = $db->sql_numrows($q_categories) )
{
$category_rows = $db->sql_fetchrowset($q_categories);
***************
*** 686,692 ****
if( !$total_forums = $db->sql_numrows($q_forums) )
{
! // We don't have any forums
!
}
$forum_rows = $db->sql_fetchrowset($q_forums);
--- 751,760 ----
if( !$total_forums = $db->sql_numrows($q_forums) )
{
! $lang['No_forums'];
!
! $template->assign_block_vars("no_forums", array());
!
}
+
$forum_rows = $db->sql_fetchrowset($q_forums);
***************
*** 696,714 ****
$gen_cat = array();
-
for($i = 0; $i < $total_categories; $i++)
{
$cat_id = $category_rows[$i]['cat_id'];
! $template->assign_block_vars("catrow", array(
! "CAT_ID" => $cat_id,
! "CAT_DESC" => stripslashes($category_rows[$i]['cat_title']),
! "CAT_EDIT" => "<a href='".append_sid("$PHP_SELF?mode=editcat&cat_id=$cat_id")."'>Edit</a>",
! "CAT_DELETE" => "<a href='".append_sid("$PHP_SELF?mode=deletecat&cat_id=$cat_id")."'>Delete</a>",
! "CAT_UP" => "<a href='".append_sid("$PHP_SELF?mode=cat_order&move=-15&cat_id=$cat_id")."'>Move up</a>",
! "CAT_DOWN" => "<a href='".append_sid("$PHP_SELF?mode=cat_order&move=15&cat_id=$cat_id")."'>Move down</a>",
! "U_VIEWCAT" => append_sid($phpbb_root_path."index.$phpEx?viewcat=$cat_id"),
! "U_ADDFORUM" => append_sid("$PHP_SELF?mode=addforum&cat_id=$cat_id"),
! "ADDFORUM" => "Add Forum")
! );
for($j = 0; $j < $total_forums; $j++)
--- 764,784 ----
$gen_cat = array();
for($i = 0; $i < $total_categories; $i++)
{
$cat_id = $category_rows[$i]['cat_id'];
!
! $template->assign_block_vars("catrow", array(
! "S_ADD_FORUM_SUBMIT" => "addforum[$cat_id]",
! "S_ADD_FORUM_NAME" => "forumname[$cat_id]",
!
! "CAT_ID" => $cat_id,
! "CAT_DESC" => $category_rows[$i]['cat_title'],
!
! "U_CAT_EDIT" => append_sid("admin_forums.$phpEx?mode=editcat&cat_id=$cat_id"),
! "U_CAT_DELETE" => append_sid("admin_forums.$phpEx?mode=deletecat&cat_id=$cat_id"),
! "U_CAT_MOVE_UP" => append_sid("admin_forums.$phpEx?mode=cat_order&move=-15&cat_id=$cat_id"),
! "U_CAT_MOVE_DOWN" => append_sid("admin_forums.$phpEx?mode=cat_order&move=15&cat_id=$cat_id"),
! "U_VIEWCAT" => append_sid($phpbb_root_path."index.$phpEx?viewcat=$cat_id"))
! );
for($j = 0; $j < $total_forums; $j++)
***************
*** 716,770 ****
$forum_id = $forum_rows[$j]['forum_id'];
- // Don't display this forum unless it's in this category..
if ($forum_rows[$j]['cat_id'] == $cat_id)
{
! //
! // This should end up in the template using IF...ELSE...ENDIF
! //
! $row_color == "#DDDDDD" ? $row_color = "#CCCCCC" : $row_color = "#DDDDDD";
!
$template->assign_block_vars("catrow.forumrow", array(
! "FORUM_NAME" => stripslashes($forum_rows[$j]['forum_name']),
! "FORUM_DESC" => stripslashes($forum_rows[$j]['forum_desc']),
"ROW_COLOR" => $row_color,
"NUM_TOPICS" => $forum_rows[$j]['forum_topics'],
"NUM_POSTS" => $forum_rows[$j]['forum_posts'],
! "U_VIEWFORUM" => append_sid($phpbb_root_path."viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&" . $forum_rows[$j]['forum_posts']),
! "FORUM_EDIT" => "<a href='".append_sid("$PHP_SELF?mode=editforum&forum_id=$forum_id")."'>Edit</a>",
! "FORUM_DELETE" => "<a href='".append_sid("$PHP_SELF?mode=deleteforum&forum_id=$forum_id")."'>Delete</a>",
! "FORUM_UP" => "<a href='".append_sid("$PHP_SELF?mode=forum_order&move=-15&forum_id=$forum_id")."'>Move up</a>",
! "FORUM_DOWN" => "<a href='".append_sid("$PHP_SELF?mode=forum_order&move=15&forum_id=$forum_id")."'>Move down</a>",
! "FORUM_SYNC" => "<a href='".append_sid("$PHP_SELF?mode=forum_sync&forum_id=$forum_id")."'>Sync</a>")
);
}// if ... forumid == catid
} // for ... forums
! $template->assign_block_vars("catrow.forumrow", array(
! "S_ADDFORUM" => '<FORM METHOD="POST" ACTION="'.append_sid($PHP_SELF).'">
! <INPUT TYPE="text" NAME="forumname">
! <INPUT TYPE="hidden" NAME="cat_id" VALUE="'.$cat_id.'">
! <INPUT TYPE="hidden" NAME="mode" VALUE="addforum">
! <INPUT TYPE="submit" NAME="submit" VALUE="Create new Forum">',
! "S_ADDFORUM_ENDFORM" => "</FORM>")
! );
} // for ... categories
- }// if ... total_categories
- $template->assign_block_vars("catrow", array(
- "S_ADDCAT" => '<FORM METHOD="POST" ACTION="'.append_sid($PHP_SELF).'">
- <INPUT TYPE="text" NAME="catname">
- <INPUT TYPE="hidden" NAME="mode" VALUE="addcat">
- <INPUT TYPE="submit" NAME="submit" VALUE="Create new category">',
- "S_ADDCAT_ENDFORM" => "</FORM>")
- );
- //
- // Generate the page
- //
$template->pparse("body");
- //
- // Page Footer
- //
include('page_footer_admin.'.$phpEx);
?>
--- 786,818 ----
$forum_id = $forum_rows[$j]['forum_id'];
if ($forum_rows[$j]['cat_id'] == $cat_id)
{
!
$template->assign_block_vars("catrow.forumrow", array(
! "FORUM_NAME" => $forum_rows[$j]['forum_name'],
! "FORUM_DESC" => $forum_rows[$j]['forum_desc'],
"ROW_COLOR" => $row_color,
"NUM_TOPICS" => $forum_rows[$j]['forum_topics'],
"NUM_POSTS" => $forum_rows[$j]['forum_posts'],
!
! "U_VIEWFORUM" => append_sid($phpbb_root_path."viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&" . $forum_rows[$j]['forum_posts']),
! "U_FORUM_EDIT" => append_sid("admin_forums.$phpEx?mode=editforum&forum_id=$forum_id"),
! "U_FORUM_DELETE" => append_sid("admin_forums.$phpEx?mode=deleteforum&forum_id=$forum_id"),
! "U_FORUM_MOVE_UP" => append_sid("admin_forums.$phpEx?mode=forum_order&move=-15&forum_id=$forum_id"),
! "U_FORUM_MOVE_DOWN" => append_sid("admin_forums.$phpEx?mode=forum_order&move=15&forum_id=$forum_id"),
! "U_FORUM_RESYNC" => append_sid("admin_forums.$phpEx?mode=forum_sync&forum_id=$forum_id"))
);
+
}// if ... forumid == catid
} // for ... forums
!
} // for ... categories
+ }// if ... total_categories
$template->pparse("body");
include('page_footer_admin.'.$phpEx);
+
?>
Index: admin_groupauth.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_groupauth.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** admin_groupauth.php 2001/09/06 00:29:07 1.18
--- admin_groupauth.php 2001/10/14 15:46:53 1.19
***************
*** 29,56 ****
}
- $phpbb_root_path = "./../";
- include($phpbb_root_path . 'extension.inc');
- include($phpbb_root_path . 'common.'.$phpEx);
-
- //
- // Start session management
- //
- $userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
- init_userprefs($userdata);
- //
- // End session management
- //
-
//
! // Is user logged in? If yes are they an admin?
//
! if( !$userdata['session_logged_in'] )
! {
! header("Location: ../login.$phpEx?forward_page=admin/");
! }
! else if( $userdata['user_level'] != ADMIN )
! {
! message_die(GENERAL_MESSAGE, $lang['Not_admin']);
! }
//
--- 29,38 ----
}
//
! // Load default header
//
! $phpbb_root_dir = "./../";
! $no_page_header = TRUE;
! require('pagestart.inc');
//
***************
*** 127,134 ****
! if(isset($HTTP_POST_VARS['submit']) && !empty($HTTP_POST_VARS[POST_GROUPS_URL]))
{
! $group_id = $HTTP_POST_VARS[POST_GROUPS_URL];
! $adv = (isset($HTTP_POST_VARS['adv'])) ? TRUE : FALSE;
//
--- 109,119 ----
! if( isset($HTTP_POST_VARS['submit']) && ( !empty($HTTP_POST_VARS[POST_GROUPS_URL]) || !empty($HTTP_GET_VARS[POST_GROUPS_URL]) ) )
{
! //
! // Front end
! //
! $group_id = ( !empty($HTTP_POST_VARS[POST_GROUPS_URL]) ) ? intval($HTTP_POST_VARS[POST_GROUPS_URL]) : intval($HTTP_GET_VARS[POST_GROUPS_URL]);
! $adv = ( isset($HTTP_POST_VARS['adv']) ) ? TRUE : 0;
//
***************
*** 164,175 ****
AND g2.group_id = ug2.group_id
AND aa2.group_id = g2.group_id";
- /*
- $sql = "SELECT aa.*, g.group_single_user, g.group_id, g.group_name
- FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE. " g
- WHERE g.group_id = $group_id
- AND aa.group_id = g.group_id";*/
$ag_result = $db->sql_query($sql);
! if($num_g_access = $db->sql_numrows($ag_result))
{
$g_access = $db->sql_fetchrowset($ag_result);
--- 149,155 ----
AND g2.group_id = ug2.group_id
AND aa2.group_id = g2.group_id";
$ag_result = $db->sql_query($sql);
! if( $num_g_access = $db->sql_numrows($ag_result) )
{
$g_access = $db->sql_fetchrowset($ag_result);
***************
*** 520,575 ****
}
! else if(empty($HTTP_GET_VARS[POST_GROUPS_URL]))
{
//
- // Default user selection box
- //
- // This should be altered on the final system
- //
-
- $sql = "SELECT group_id, group_name
- FROM " . GROUPS_TABLE . "
- WHERE group_single_user <> " . TRUE;
- $g_result = $db->sql_query($sql);
- $group_list = $db->sql_fetchrowset($g_result);
-
- $select_list = "<select name=\"" . POST_GROUPS_URL . "\">";
- for($i = 0; $i < count($group_list); $i++)
- {
- $select_list .= "<option value=\"" . $group_list[$i]['group_id'] . "\">" . $group_list[$i]['group_name'] . "</option>";
- }
- $select_list .= "</select>";
-
- include('page_header_admin.'.$phpEx);
-
- $template->set_filenames(array(
- "body" => "admin/auth_select_body.tpl")
- );
-
- $template->assign_vars(array(
- "L_AUTH_TITLE" => $lang['Group'] . " " . $lang['Auth_Control'],
- "L_AUTH_EXPLAIN" => $lang['Group_auth_explain'],
- "L_AUTH_SELECT" => $lang['Select_a'] . " " . $lang['Group'],
- "L_LOOK_UP" => $lang['Look_up'] . " " . $lang['Group'],
-
- "S_AUTH_ACTION" => append_sid("admin_groupauth.$phpEx"),
- "S_AUTH_SELECT" => $select_list)
- );
-
- }
- else
- {
- //
// Front end
//
! $group_id = $HTTP_GET_VARS[POST_GROUPS_URL];
! if( isset($HTTP_GET_VARS['adv']) )
! {
! $adv = $HTTP_GET_VARS['adv'];
! }
! else
! {
! $adv = FALSE;
! }
include('page_header_admin.'.$phpEx);
--- 500,510 ----
}
! else if( !empty($HTTP_POST_VARS[POST_GROUPS_URL]) || !empty($HTTP_GET_VARS[POST_GROUPS_URL]) )
{
//
// Front end
//
! $group_id = ( !empty($HTTP_POST_VARS[POST_GROUPS_URL]) ) ? intval($HTTP_POST_VARS[POST_GROUPS_URL]) : intval($HTTP_GET_VARS[POST_GROUPS_URL]);
! $adv = ( isset($HTTP_GET_VARS['adv']) ) ? $HTTP_GET_VARS['adv'] : 0;
include('page_header_admin.'.$phpEx);
***************
*** 903,907 ****
--- 838,878 ----
"S_HIDDEN_FIELDS" => $s_hidden_fields)
);
+ }
+ else
+ {
+ //
+ // Default user selection box
+ //
+ // This should be altered on the final system
+ //
+ $sql = "SELECT group_id, group_name
+ FROM " . GROUPS_TABLE . "
+ WHERE group_single_user <> " . TRUE;
+ $g_result = $db->sql_query($sql);
+ $group_list = $db->sql_fetchrowset($g_result);
+
+ $select_list = "<select name=\"" . POST_GROUPS_URL . "\">";
+ for($i = 0; $i < count($group_list); $i++)
+ {
+ $select_list .= "<option value=\"" . $group_list[$i]['group_id'] . "\">" . $group_list[$i]['group_name'] . "</option>";
+ }
+ $select_list .= "</select>";
+
+ include('page_header_admin.'.$phpEx);
+
+ $template->set_filenames(array(
+ "body" => "admin/auth_group_select_body.tpl")
+ );
+
+ $template->assign_vars(array(
+ "L_AUTH_TITLE" => $lang['Group'] . " " . $lang['Auth_Control'],
+ "L_AUTH_EXPLAIN" => $lang['Group_auth_explain'],
+ "L_AUTH_SELECT" => $lang['Select_a'] . " " . $lang['Group'],
+ "L_LOOK_UP" => $lang['Look_up'] . " " . $lang['Group'],
+
+ "S_AUTH_ACTION" => append_sid("admin_groupauth.$phpEx"),
+ "S_AUTH_SELECT" => $select_list)
+ );
}
Index: admin_groups.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_groups.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** admin_groups.php 2001/10/10 18:06:27 1.9
--- admin_groups.php 2001/10/14 15:46:53 1.10
***************
*** 30,66 ****
//
! // Include required files, get $phpEx and check permissions
//
! $phpbb_root_path = "./../";
! include($phpbb_root_path . 'extension.inc');
! include($phpbb_root_path . 'common.'.$phpEx);
! //
! // Start session management
! //
! $userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
! init_userprefs($userdata);
! //
! // End session management
! //
! if( !$userdata['session_logged_in'] )
{
! header("Location: ../login.$phpEx?forward_page=admin/");
}
! else if( $userdata['user_level'] != ADMIN )
{
! message_die(GENERAL_MESSAGE, $lang['Not_admin']);
}
- $mode = isset($HTTP_POST_VARS['mode']) ? $HTTP_POST_VARS['mode'] : ((isset($HTTP_GET_VARS['mode'])) ? $HTTP_GET_VARS['mode'] : "");
! if($mode && empty($HTTP_POST_VARS['updategroup']))
{
-
//
// Ok they are editing a group or creating a new group
//
! include("page_header_admin." . $phpEx);
! if ( $mode == "editgroup" )
{
//
--- 30,54 ----
//
! // Load default header
//
! $phpbb_root_dir = "./../";
! require('pagestart.inc');
! if( isset($HTTP_POST_VARS[POST_GROUPS_URL]) || isset($HTTP_GET_VARS[POST_GROUPS_URL]) )
{
! $group_id = ( isset($HTTP_POST_VARS[POST_GROUPS_URL]) ) ? $HTTP_POST_VARS[POST_GROUPS_URL] : $HTTP_GET_VARS[POST_GROUPS_URL];
}
! else
{
! $group_id = "";
}
! if( isset($HTTP_POST_VARS['edit']) || isset($HTTP_POST_VARS['new']) )
{
//
// Ok they are editing a group or creating a new group
//
! if ( isset($HTTP_POST_VARS['edit']) )
{
//
***************
*** 70,74 ****
FROM " . GROUPS_TABLE . "
WHERE group_single_user <> " . TRUE . "
! AND group_id = " . $g;
if(!$result = $db->sql_query($sql))
{
--- 58,62 ----
FROM " . GROUPS_TABLE . "
WHERE group_single_user <> " . TRUE . "
! AND group_id = $group_id";
if(!$result = $db->sql_query($sql))
{
***************
*** 80,85 ****
}
$group_info = $db->sql_fetchrow($result);
}
! else if ($mode == "newgroup")
{
$group_info = array (
--- 68,76 ----
}
$group_info = $db->sql_fetchrow($result);
+
+ $mode = "editgroup";
+
}
! else if( isset($HTTP_POST_VARS['new']) )
{
$group_info = array (
***************
*** 90,93 ****
--- 81,87 ----
);
$group_open = "checked=\"checked\"";
+
+ $mode = "newgroup";
+
}
//
***************
*** 99,102 ****
--- 93,101 ----
ORDER BY username";
$u_result = $db->sql_query($sql);
+ if( !$u_result )
+ {
+ message_die(GENERAL_ERROR, "Couldn't obtain user info for moderator list", "", __LINE__, __FILE__, $sql);
+ }
+
$user_list = $db->sql_fetchrowset($u_result);
***************
*** 104,130 ****
for($i = 0; $i < count($user_list); $i++)
{
! if( $user_list[$i]['user_id'] == $group_info['group_moderator'] )
! {
! $select_list .= "<option selected value=\"" . $user_list[$i]['user_id'] . "\">" . $user_list[$i]['username'] . "</option>";
! }
! else
! {
! $select_list .= "<option value=\"" . $user_list[$i]['user_id'] . "\">" . $user_list[$i]['username'] . "</option>";
! }
}
$select_list .= "</select>";
$template->set_filenames(array(
"body" => "admin/group_edit_body.tpl")
);
! if( !empty($group_info['group_type']) )
! {
! $group_open = "checked=\"checked\"";
! }
! else
! {
! $group_closed = "checked=\"checked\"";
! }
$template->assign_vars(array(
! "L_GROUP_INFO" => $lang['Group_edit_explain'],
"L_GROUP_NAME" => $lang['group_name'],
"L_GROUP_DESCRIPTION" => $lang['group_description'],
--- 103,126 ----
for($i = 0; $i < count($user_list); $i++)
{
! $selected = ( $user_list[$i]['user_id'] == $group_info['group_moderator'] ) ? "selected=\"selected\"" : "";
! $select_list .= "<option value=\"" . $user_list[$i]['user_id'] . "\"$selected>" . $user_list[$i]['username'] . "</option>";
}
$select_list .= "</select>";
+
+ $group_open = ( !empty($group_info['group_type']) ) ? "checked=\"checked\"" : "";
+ $group_closed = ( empty($group_info['group_type']) ) ? "checked=\"checked\"" : "";
+
$template->set_filenames(array(
"body" => "admin/group_edit_body.tpl")
);
!
! $s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" /><input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />';
!
$template->assign_vars(array(
! "GROUP_NAME" => $group_info['group_name'],
! "GROUP_DESCRIPTION" => $group_info['group_description'],
!
! "L_GROUP_TITLE" => $lang['Group'] . " " . $lang['Admin'],
! "L_GROUP_EDIT_DELETE" => ( isset($HTTP_POST_VARS['new']) ) ? $lang['New_group'] : $lang['Edit_group'],
"L_GROUP_NAME" => $lang['group_name'],
"L_GROUP_DESCRIPTION" => $lang['group_description'],
***************
*** 138,161 ****
"L_RESET" => $lang['reset_group_changes'],
! "S_GROUP_NAME" => $group_info['group_name'],
! "S_GROUP_DESCRIPTION" => $group_info['group_description'],
! "S_GROUP_MODERATOR" => $select_list,
"S_GROUP_OPEN_CHECKED" => $group_open,
"S_GROUP_CLOSED_CHECKED" => $group_closed,
"S_GROUP_ACTION" => append_sid("admin_groups.$phpEx"),
! "S_GROUP_MODE" => $mode,
! "GROUP_ID" => $g)
);
$template->pparse('body');
}
! else if($mode && $HTTP_POST_VARS['updategroup'] == "update" )
{
//
// Ok, they are submitting a group, let's save the data based on if it's new or editing
//
! if( isset($HTTP_POST_VARS['deletegroup']) )
{
$sql = "DELETE FROM " . GROUPS_TABLE . "
WHERE group_id = " . $group_id;
}
else
--- 134,162 ----
"L_RESET" => $lang['reset_group_changes'],
! "S_SELECT_MODERATORS" => $select_list,
"S_GROUP_OPEN_CHECKED" => $group_open,
"S_GROUP_CLOSED_CHECKED" => $group_closed,
"S_GROUP_ACTION" => append_sid("admin_groups.$phpEx"),
! "S_HIDDEN_FIELDS" => $s_hidden_fields)
);
+
$template->pparse('body');
+
}
! else if( isset($HTTP_POST_VARS['group_update']) )
{
//
// Ok, they are submitting a group, let's save the data based on if it's new or editing
//
! if( isset($HTTP_POST_VARS['group_delete']) )
{
$sql = "DELETE FROM " . GROUPS_TABLE . "
WHERE group_id = " . $group_id;
+ if ( !$result = $db->sql_query($sql) )
+ {
+ message_die(GENERAL_ERROR, "Couldn't update group", "", __LINE__, __FILE__, $sql);
+ }
+
+ message_die(GENERAL_MESSAGE, $lang['Deleted_group']);
}
else
***************
*** 164,243 ****
$group_name = isset($HTTP_POST_VARS['group_name']) ? $HTTP_POST_VARS['group_name'] : "";
$group_description = isset($HTTP_POST_VARS['group_description']) ? $HTTP_POST_VARS['group_description'] : "";
! $group_moderator = isset($HTTP_POST_VARS['group_moderator']) ? $HTTP_POST_VARS['group_moderator'] : "";
! $group_id = isset($HTTP_POST_VARS['group_id']) ? $HTTP_POST_VARS['group_id'] : "";
! switch($mode)
{
! case 'editgroup':
! $sql = "UPDATE " . GROUPS_TABLE . "
! SET group_type = '" . $group_type . "',
! group_name = '" . $group_name . "',
! group_description = '" . $group_description . "',
! group_moderator = '" . $group_moderator . "'
! WHERE group_id = '" . $group_id . "'";
! break;
!
! case 'newgroup':
! $sql = "INSERT INTO " . GROUPS_TABLE . "
! (
! group_type,
! group_name,
! group_description,
! group_moderator,
! group_single_user
! )
! VALUES
! (
! '" . $group_type . "',
! '" . $group_name . "',
! '" . $group_description . "',
! '" . $group_moderator . "',
! '0'
! )";
! break;
!
! case 'default':
! message_die(GENERAL_ERROR, $lang['Group_mode_not_selected']);
! break;
! }
! }
! if ( !$result = $db->sql_query($sql) )
! {
! $error = TRUE;
! }
! if ( $mode == "newgroup" )
! {
! $new_group_id = $db->sql_nextid($result);
!
! $sql = "INSERT INTO " . USER_GROUP_TABLE . "
! (
! group_id,
! user_id,
! user_pending
! )
! VALUES
! (
! '" . $new_group_id . "',
! '" . $group_moderator . "',
! '0'
! )";
! if ( !$result = $db->sql_query($sql) )
{
! $error = TRUE;
}
! }
! if ( isset($error) )
! {
! message_die(GENERAL_ERROR, $lang['Error_updating_groups'], $lang['Error'], __LINE__, __FILE__, $sql);
! }
! else
! {
! message_die(GENERAL_MESSAGE, $lang['Success_updating_groups'], $lang['Success']);
}
}
else
{
- include("page_header_admin." . $phpEx);
-
$sql = "SELECT group_id, group_name
FROM " . GROUPS_TABLE . "
--- 165,226 ----
$group_name = isset($HTTP_POST_VARS['group_name']) ? $HTTP_POST_VARS['group_name'] : "";
$group_description = isset($HTTP_POST_VARS['group_description']) ? $HTTP_POST_VARS['group_description'] : "";
! $group_moderator = isset($HTTP_POST_VARS['group_moderator']) ? intval($HTTP_POST_VARS['group_moderator']) : "";
!
! if( $group_name == "" )
! {
! message_die(GENERAL_MESSAGE, $lang['No_group_name']);
! }
! else if( $group_moderator == "" )
! {
! message_die(GENERAL_MESSAGE, $lang['No_group_moderator']);
! }
! else if( $group_type == "" )
! {
! message_die(GENERAL_MESSAGE, $lang['No_group_mode']);
! }
! if( $mode == "editgroup" )
{
!
! echo $sql = "UPDATE " . GROUPS_TABLE . "
! SET group_type = $group_type, group_name = '" . $group_name . "', group_description = '" . $group_description . "', group_moderator = $group_moderator
! WHERE group_id = $group_id";
! if ( !$result = $db->sql_query($sql) )
! {
! message_die(GENERAL_ERROR, "Couldn't update group", "", __LINE__, __FILE__, $sql);
! }
!
! message_die(GENERAL_MESSAGE, $lang['Updated_group']);
! }
! else if( $mode == "newgroup" )
{
!
! $sql = "INSERT INTO " . GROUPS_TABLE . " (group_type, group_name, group_description, group_moderator, group_single_user)
! VALUES ($group_type, '" . $group_name . "', '" . $group_description . "', $group_moderator, '0')";
! if ( !$result = $db->sql_query($sql) )
! {
! message_die(GENERAL_ERROR, "Couldn't insert new group", "", __LINE__, __FILE__, $sql);
! }
!
! $new_group_id = $db->sql_nextid($result);
!
! $sql = "INSERT INTO " . USER_GROUP_TABLE . " (group_id, user_id, user_pending)
! VALUES ($new_group_id, $group_moderator, 0)";
! if ( !$result = $db->sql_query($sql) )
! {
! message_die(GENERAL_ERROR, "Couldn't insert new user-group info", "", __LINE__, __FILE__, $sql);
! }
!
! message_die(GENERAL_MESSAGE, $lang['Added_new_group']);
!
}
! else
! {
! message_die(GENERAL_MESSAGE, $lang['Group_mode_not_selected']);
! }
}
}
else
{
$sql = "SELECT group_id, group_name
FROM " . GROUPS_TABLE . "
***************
*** 263,267 ****
"L_GROUP_SELECT" => $lang['Select_a'] . " " . $lang['Group'],
"L_LOOK_UP" => $lang['Look_up'] . " " . $lang['Group'],
! "L_GROUP_NEW" => $lang['New_group'],
"S_GROUP_ACTION" => append_sid("admin_groups.$phpEx"),
--- 246,250 ----
"L_GROUP_SELECT" => $lang['Select_a'] . " " . $lang['Group'],
"L_LOOK_UP" => $lang['Look_up'] . " " . $lang['Group'],
! "L_CREATE_NEW_GROUP" => $lang['New_group'],
"S_GROUP_ACTION" => append_sid("admin_groups.$phpEx"),
***************
*** 271,274 ****
--- 254,258 ----
$template->pparse('body');
}
+
include('page_footer_admin.'.$phpEx);
Index: admin_mass_email.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_mass_email.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** admin_mass_email.php 2001/09/09 12:40:42 1.5
--- admin_mass_email.php 2001/10/14 15:46:53 1.6
***************
*** 33,60 ****
}
- $phpbb_root_path = "./../";
- include($phpbb_root_path . 'extension.inc');
- include($phpbb_root_path . 'common.'.$phpEx);
-
- //
- // Start session management
//
! $userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
! init_userprefs($userdata);
//
! // End session management
! //
- //
- // Is user logged in? If yes are they an admin?
- //
- if( !$userdata['session_logged_in'] )
- {
- header("Location: ../login.$phpEx?forward_page=admin/");
- }
- else if( $userdata['user_level'] != ADMIN )
- {
- message_die(GENERAL_MESSAGE, $lang['Not_admin']);
- }
//
--- 33,43 ----
}
//
! // Load default header
//
! $phpbb_root_dir = "./../";
! $no_page_header = TRUE;
! require('pagestart.inc');
//
***************
*** 68,72 ****
//
@set_time_limit(600);
! //Set form names
$f_title = 'e_title';
$f_msg = 'e_msg';
--- 51,58 ----
//
@set_time_limit(600);
!
! //
! // Set form names
! //
$f_title = 'e_title';
$f_msg = 'e_msg';
Index: admin_ranks.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/admin/admin_ranks.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** admin_ranks.php 2001/10/14 14:33:54 1.1
--- admin_ranks.php 2001/10/14 15:46:53 1.2
***************
*** 32,41 ****
//
$phpbb_root_dir = "./../";
-
- //
- // Include required files, get $phpEx and check permissions
- //
require('pagestart.inc');
if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{
--- 32,38 ----
//
$phpbb_root_dir = "./../";
require('pagestart.inc');
+
if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{
***************
*** 70,115 ****
//
! $rank_id = ( isset($HTTP_GET_VARS['id']) ) ? $HTTP_GET_VARS['id'] : 0;
! $template->set_filenames(array(
! "body" => "admin/ranks_edit_body.tpl")
! );
!
! $s_hidden_fields = '';
if( $mode == "edit" )
{
! if( $rank_id )
{
! $sql = "SELECT * FROM " . RANKS_TABLE . "
! WHERE rank_id = $rank_id";
! if(!$result = $db->sql_query($sql))
! {
!
! $template->set_filenames(array(
! "body" => "admin/admin_message_body.tpl")
! );
!
! $template->assign_vars(array(
! "MESSAGE_TITLE" => $lang['Error'],
! "MESSAGE_TEXT" => "Error querying ranks table")
! );
! }
!
! $rank_info = $db->sql_fetchrow($result);
! $s_hidden_fields .= '<input type="hidden" name="id" value="' . $rank_id . '" />';
}
! else
{
! $template->set_filenames(array(
! "body" => "admin/admin_message_body.tpl")
! );
!
! $template->assign_vars(array(
! "MESSAGE_TITLE" => $lang['Error'],
! "MESSAGE_TEXT" => $lang['Must_select_rank'])
! );
!
}
}
else
--- 67,91 ----
//
! $rank_id = ( isset($HTTP_GET_VARS['id']) ) ? intval($HTTP_GET_VARS['id']) : 0;
! $s_hidden_fields = "";
if( $mode == "edit" )
{
! if( empty($rank_id) )
{
! message_die(GENERAL_MESSAGE, $lang['Must_select_rank']);
}
!
! $sql = "SELECT * FROM " . RANKS_TABLE . "
! WHERE rank_id = $rank_id";
! if(!$result = $db->sql_query($sql))
{
! message_die(GENERAL_ERROR, "Couldn't obtain rank data", "", __LINE__, __FILE__, $sql);
}
+
+ $rank_info = $db->sql_fetchrow($result);
+ $s_hidden_fields .= '<input type="hidden" name="id" value="' . $rank_id . '" />';
+
}
else
***************
*** 117,124 ****
$rank_info['rank_special'] = 0;
}
$s_hidden_fields .= '<input type="hidden" name="mode" value="save" />';
! $rank_is_special = ( $rank_info['rank_special'] == 1 ) ? "checked=\"checked\"" : "";
! $rank_is_not_special = ( !($rank_info['rank_special'] == 1) ) ? "checked=\"checked\"" : "";
$template->assign_vars(array(
"RANK" => $rank_info['rank_title'],
--- 93,106 ----
$rank_info['rank_special'] = 0;
}
+
$s_hidden_fields .= '<input type="hidden" name="mode" value="save" />';
!
! $rank_is_special = ( $rank_info['rank_special'] ) ? "checked=\"checked\"" : "";
! $rank_is_not_special = ( !$rank_info['rank_special'] ) ? "checked=\"checked\"" : "";
+ $template->set_filenames(array(
+ "body" => "admin/ranks_edit_body.tpl")
+ );
+
$template->assign_vars(array(
"RANK" => $rank_info['rank_title'],
***************
*** 127,132 ****
"MINIMUM" => $rank_info['rank_min'],
"MAXIMUM" => $rank_info['rank_max'],
! "IMAGE" => ( $rank_info['rank_image'] != "" ) ? $rank_info['rank_image'] : "http://",
! "IMAGE_DISPLAY" => ( $rank_info['rank_image'] != "" ) ? '<img src="'.$rank_info['rank_image'].'" />' : "",
"L_RANKS_TITLE" => $lang['Ranks_title'],
--- 109,114 ----
"MINIMUM" => $rank_info['rank_min'],
"MAXIMUM" => $rank_info['rank_max'],
! "IMAGE" => ( $rank_info['rank_image'] != "" ) ? $rank_info['rank_image'] : "",
! "IMAGE_DISPLAY" => ( $rank_info['rank_image'] != "" ) ? '<img src="' . $rank_info['rank_image'] . '" />' : "",
"L_RANKS_TITLE" => $lang['Ranks_title'],
***************
*** 154,174 ****
//
! $rank_id = ( isset($HTTP_POST_VARS['id']) ) ? $HTTP_POST_VARS['id'] : 0;
$rank_title = ( isset($HTTP_POST_VARS['title']) ) ? $HTTP_POST_VARS['title'] : "";
! $special_rank = ( $HTTP_POST_VARS['special_rank'] == 1 ) ? 1 : 0;
! $max_posts = ( isset($HTTP_POST_VARS['max_posts']) ) ? $HTTP_POST_VARS['max_posts'] : -1;
! $min_posts = ( isset($HTTP_POST_VARS['min_posts']) ) ? $HTTP_POST_VARS['min_posts'] : -1;
$rank_image = ( (isset($HTTP_POST_VARS['rank_image'])) || $HTTP_POST_VARS['rank_image'] != "http://" ) ? $HTTP_POST_VARS['rank_image'] : "";
if( $rank_title == "" )
{
! $template->set_filenames(array(
! "body" => "admin/admin_message_body.tpl")
! );
!
! $template->assign_vars(array(
! "MESSAGE_TITLE" => $lang['Error'],
! "MESSAGE_TEXT" => $lang['Must_select_rank'])
! );
}
if( $special_rank == 1 )
{
--- 136,151 ----
//
! $rank_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : 0;
$rank_title = ( isset($HTTP_POST_VARS['title']) ) ? $HTTP_POST_VARS['title'] : "";
! $special_rank = ( $HTTP_POST_VARS['special_rank'] == 1 ) ? TRUE : 0;
! $max_posts = ( isset($HTTP_POST_VARS['max_posts']) ) ? intval($HTTP_POST_VARS['max_posts']) : -1;
! $min_posts = ( isset($HTTP_POST_VARS['min_posts']) ) ? intval($HTTP_POST_VARS['min_posts']) : -1;
$rank_image = ( (isset($HTTP_POST_VARS['rank_image'])) || $HTTP_POST_VARS['rank_image'] != "http://" ) ? $HTTP_POST_VARS['rank_image'] : "";
+
if( $rank_title == "" )
{
! message_die(GENERAML_MESSAGE, $lang['Must_select_rank']);
}
+
if( $special_rank == 1 )
{
***************
*** 176,193 ****
$min_posts = -1;
}
! // The rank image has to start with http://, followed by something with length at least 3 that
! // contains at least one dot.
if($rank_image != "")
{
! if( !ereg("^http\:\/\/", $rank_image) )
! {
! $rank_image = "http://" . $rank_image;
! }
!
! if (!preg_match("#^http\\:\\/\\/[a-z0-9\-]+\.[a-z0-9\-]+#i", $rank_image))
{
$rank_image = "";
}
}
if( $rank_id )
{
--- 153,168 ----
$min_posts = -1;
}
!
! //
! // The rank image has to be a jpg, gif or png
! //
if($rank_image != "")
{
! if ( !preg_match("/(\.gif|\.png|\.jpg)$/is", $rank_image))
{
$rank_image = "";
}
}
+
if( $rank_id )
{
***************
*** 200,204 ****
rank_image = '$rank_image'
WHERE rank_id = $rank_id";
! $message_success = $lang['Rank_updated'];
}
else
--- 175,179 ----
rank_image = '$rank_image'
WHERE rank_id = $rank_id";
! $message = $lang['Rank_updated'];
}
else
***************
*** 208,236 ****
VALUES
('$rank_title', '$special_rank', '$max_posts', '$min_posts', '$rank_image')";
! $message_success = $lang['Rank_added'];
}
! if(!$result = $db->sql_query($sql))
! {
! $template->set_filenames(array(
! "body" => "admin/admin_message_body.tpl")
! );
!
! $template->assign_vars(array(
! "MESSAGE_TITLE" => $lang['Error'],
! "MESSAGE_TEXT" => "Couldn't update ranks table<br>SQL: ".$sql)
! );
! }
! else
{
! $template->set_filenames(array(
! "body" => "admin/admin_message_body.tpl")
! );
!
! $template->assign_vars(array(
! "MESSAGE_TITLE" => $lang['Success'],
! "MESSAGE_TEXT" => $message_success)
! );
}
}
else if( $mode == "delete" )
--- 183,200 ----
VALUES
('$rank_title', '$special_rank', '$max_posts', '$min_posts', '$rank_image')";
! $message = $lang['Rank_added'];
}
! if( !$result = $db->sql_query($sql) )
{
! message_die(GENERAL_ERROR, "Couldn't update/insert into ranks table", "", __LINE__, __FILE__, $sql);
}
+
+ $template->assign_vars(array(
+ "META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("admin_ranks.$phpEx") . '">')
+ );
+ $message .= "<br /><br />" . $lang['Click'] . " <a href=\"" . append_sid("admin_ranks.$phpEx") . "\">" . $lang['Here'] . "</a> " . $lang['return_rank_admin'];
+ message_die(GENERAL_MESSAGE, $message);
+
}
else if( $mode == "delete" )
***************
*** 242,246 ****
if( isset($HTTP_POST_VARS['id']) || isset($HTTP_GET_VARS['id']) )
{
! $rank_id = ( isset($HTTP_POST_VARS['id']) ) ? $HTTP_POST_VARS['id'] : $HTTP_GET_VARS['id'];
}
else
--- 206,210 ----
if( isset($HTTP_POST_VARS['id']) || isset($HTTP_GET_VARS['id']) )
{
! $rank_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : intval($HTTP_GET_VARS['id']);
}
else
***************
*** 256,290 ****
if( !$result = $db->sql_query...
[truncated message content] |