2001-02-17 08:37:32 +00:00
|
|
|
<?php
|
|
|
|
/***************************************************************************
|
|
|
|
*
|
|
|
|
* -------------------
|
|
|
|
* begin : Saturday, Feb 13, 2001
|
|
|
|
* copyright : (C) 2001 The phpBB Group
|
|
|
|
* email : support@phpbb.com
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
|
|
|
|
2001-07-13 17:03:04 +00:00
|
|
|
$phpbb_root_path = "./../";
|
|
|
|
include($phpbb_root_path . 'extension.inc');
|
|
|
|
include($phpbb_root_path . 'common.'.$phpEx);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Start session management
|
|
|
|
//
|
2001-07-13 14:16:11 +00:00
|
|
|
$userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
|
|
|
|
init_userprefs($userdata);
|
2001-07-13 17:03:04 +00:00
|
|
|
//
|
2001-07-14 20:00:27 +00:00
|
|
|
// End session management
|
2001-07-13 17:03:04 +00:00
|
|
|
//
|
2001-07-13 14:16:11 +00:00
|
|
|
|
2001-07-14 15:22:55 +00:00
|
|
|
//
|
2001-07-14 20:00:27 +00:00
|
|
|
// Is user logged in? If yes are they an admin?
|
2001-07-14 15:22:55 +00:00
|
|
|
//
|
2001-07-14 20:00:27 +00:00
|
|
|
if( !$userdata['session_logged_in'] )
|
2001-07-14 15:22:55 +00:00
|
|
|
{
|
2001-07-14 20:00:27 +00:00
|
|
|
header("Location: ../login.$phpEx?forward_page=/admin/");
|
2001-07-14 15:22:55 +00:00
|
|
|
}
|
2001-07-14 20:00:27 +00:00
|
|
|
else if( $userdata['user_level'] != ADMIN )
|
|
|
|
{
|
|
|
|
message_die(GENERAL_MESSAGE, "You are not authorised to administer this board");
|
|
|
|
}
|
|
|
|
|
2001-07-14 15:22:55 +00:00
|
|
|
//
|
2001-07-14 20:00:27 +00:00
|
|
|
// Generate relevant output
|
2001-07-14 15:22:55 +00:00
|
|
|
//
|
2001-07-14 20:00:27 +00:00
|
|
|
if( $HTTP_GET_VARS['pane'] == 'top' )
|
2001-07-13 14:16:11 +00:00
|
|
|
{
|
2001-07-13 17:03:04 +00:00
|
|
|
|
2001-07-14 20:00:27 +00:00
|
|
|
$template_header = "admin/overall_header.tpl";
|
|
|
|
include('page_header_admin.'.$phpEx);
|
2001-07-13 17:03:04 +00:00
|
|
|
|
2001-07-13 14:16:11 +00:00
|
|
|
}
|
2001-07-14 20:00:27 +00:00
|
|
|
elseif( $HTTP_GET_VARS['pane'] == 'left' )
|
2001-07-13 14:16:11 +00:00
|
|
|
{
|
|
|
|
$dir = opendir(".");
|
|
|
|
|
2001-07-13 17:03:04 +00:00
|
|
|
$setmodules = 1;
|
2001-07-13 14:16:11 +00:00
|
|
|
while($file = readdir($dir))
|
|
|
|
{
|
2001-07-13 17:03:04 +00:00
|
|
|
if(preg_match("/^admin_.*/", $file))
|
|
|
|
{
|
|
|
|
include($file);
|
|
|
|
}
|
2001-07-13 14:16:11 +00:00
|
|
|
}
|
|
|
|
|
2001-07-14 21:43:57 +00:00
|
|
|
$template_header = "admin/page_header.tpl";
|
|
|
|
include('page_header_admin.'.$phpEx);
|
2001-07-14 20:00:27 +00:00
|
|
|
|
2001-07-14 15:22:55 +00:00
|
|
|
$template->set_filenames(array(
|
|
|
|
"body" => "admin/navigate.tpl")
|
|
|
|
);
|
2001-07-14 20:00:27 +00:00
|
|
|
|
2001-07-13 17:03:04 +00:00
|
|
|
while( list($cat, $action_array) = each($module) )
|
2001-07-13 14:16:11 +00:00
|
|
|
{
|
2001-07-14 15:22:55 +00:00
|
|
|
$template->assign_block_vars("catrow", array(
|
|
|
|
"CATNAME" => $cat)
|
|
|
|
);
|
2001-07-14 20:00:27 +00:00
|
|
|
while( list($action, $file) = each($action_array) )
|
2001-07-13 17:03:04 +00:00
|
|
|
{
|
2001-07-14 15:22:55 +00:00
|
|
|
$template->assign_block_vars("catrow.actionrow", array(
|
2001-07-14 20:00:27 +00:00
|
|
|
"ACTIONNAME" => $action,
|
|
|
|
"FILE" => $file)
|
2001-07-14 15:22:55 +00:00
|
|
|
);
|
2001-07-13 17:03:04 +00:00
|
|
|
}
|
2001-07-13 14:16:11 +00:00
|
|
|
}
|
|
|
|
//var_dump($module);
|
2001-07-14 20:00:27 +00:00
|
|
|
|
2001-07-14 15:22:55 +00:00
|
|
|
$template->pparse("body");
|
2001-07-13 14:16:11 +00:00
|
|
|
|
|
|
|
$setmodules = 0;
|
|
|
|
}
|
2001-07-14 20:00:27 +00:00
|
|
|
elseif( $HTTP_GET_VARS['pane'] == 'right' )
|
2001-07-13 14:16:11 +00:00
|
|
|
{
|
|
|
|
|
2001-07-19 00:25:56 +00:00
|
|
|
$template_header = "admin/page_header.tpl";
|
|
|
|
include('page_header_admin.'.$phpEx);
|
|
|
|
|
|
|
|
include('page_footer_admin.'.$phpEx);
|
2001-07-13 14:16:11 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
else
|
2001-07-13 17:03:04 +00:00
|
|
|
{
|
2001-07-14 20:00:27 +00:00
|
|
|
//
|
|
|
|
// Generate frameset
|
|
|
|
//
|
|
|
|
$template->set_filenames(array(
|
|
|
|
"body" => "admin/index_frameset.tpl")
|
|
|
|
);
|
|
|
|
|
|
|
|
$template->assign_vars(array(
|
|
|
|
"S_FRAME_HEADER" => "index.$phpEx?pane=top",
|
|
|
|
"S_FRAME_NAV" => "index.$phpEx?pane=left",
|
2001-07-14 20:07:13 +00:00
|
|
|
"S_FRAME_MAIN" => "index.$phpEx?pane=right")
|
2001-07-14 20:00:27 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
$template->pparse("body");
|
2001-07-13 17:03:04 +00:00
|
|
|
|
2001-07-14 20:00:27 +00:00
|
|
|
exit;
|
2001-07-13 14:16:11 +00:00
|
|
|
|
|
|
|
}
|
2001-02-17 08:37:32 +00:00
|
|
|
|
2001-07-14 20:00:27 +00:00
|
|
|
?>
|