mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Introduced pagestart.inc
git-svn-id: file:///svn/phpbb/trunk@798 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
c9c11d3a71
commit
2aaadc7b07
12 changed files with 224 additions and 354 deletions
|
@ -29,28 +29,10 @@ if($setmodules == 1)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpbb_root_path = "./../";
|
|
||||||
include($phpbb_root_path . 'extension.inc');
|
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Start session management
|
// Include required files, get $phpEx and check permissions
|
||||||
//
|
//
|
||||||
$userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
|
require('pagestart.inc');
|
||||||
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']);
|
|
||||||
}
|
|
||||||
|
|
||||||
include('page_header_admin.'.$phpEx);
|
|
||||||
|
|
||||||
$mode = ($HTTP_GET_VARS['mode']) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
|
$mode = ($HTTP_GET_VARS['mode']) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
|
||||||
|
|
||||||
|
|
|
@ -41,26 +41,10 @@ if($setmodules == 1)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpbb_root_path = "./../";
|
|
||||||
include($phpbb_root_path . 'extension.inc');
|
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Start session management
|
// Include required files, get $phpEx and check permissions
|
||||||
//
|
//
|
||||||
$userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
|
require('pagestart.inc');
|
||||||
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']);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Set VERBOSE to 1 for debugging info..
|
// Set VERBOSE to 1 for debugging info..
|
||||||
|
|
|
@ -39,27 +39,10 @@ if( $setmodules == 1 )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpbb_root_path = "./../";
|
|
||||||
include($phpbb_root_path . 'extension.inc');
|
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
|
||||||
include($phpbb_root_path . 'includes/prune.'.$phpEx);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Start session management
|
// Include required files, get $phpEx and check permissions
|
||||||
//
|
//
|
||||||
$userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
|
require('pagestart.inc');
|
||||||
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']);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get the forum ID for pruning
|
// Get the forum ID for pruning
|
||||||
|
|
|
@ -30,30 +30,10 @@ if($setmodules == 1)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpbb_root_path = "./../";
|
|
||||||
include($phpbb_root_path . 'extension.inc');
|
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Start session management
|
// Include required files, get $phpEx and check permissions
|
||||||
//
|
//
|
||||||
$userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
|
require('pagestart.inc');
|
||||||
init_userprefs($userdata);
|
|
||||||
//
|
|
||||||
// End session management
|
|
||||||
//
|
|
||||||
|
|
||||||
//
|
|
||||||
// Check user permissions
|
|
||||||
//
|
|
||||||
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']);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Start program - define vars
|
// Start program - define vars
|
||||||
|
|
|
@ -22,74 +22,74 @@
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
if( $setmodules == 1 )
|
if($setmodules==1)
|
||||||
{
|
{
|
||||||
$filename = basename(__FILE__);
|
$file = basename(__FILE__);
|
||||||
$module['Forums']['Add_new'] = "$filename?mode=add";
|
$module['General']['forums'] = $file;
|
||||||
$module['Forums']['Manage'] = "$filename?mode=manage";
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpbb_root_path = "./../";
|
//
|
||||||
include($phpbb_root_path . 'extension.inc');
|
// Include required files, get $phpEx and check permissions
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
//
|
||||||
|
require('pagestart.inc');
|
||||||
|
|
||||||
//
|
|
||||||
// Start session management
|
if($HTTP_POST_VARS['newcat'] != "")
|
||||||
//
|
|
||||||
$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/");
|
$mode = 'newcat';
|
||||||
|
$catname = $HTTP_POST_VARS['catname'];
|
||||||
}
|
}
|
||||||
else if( $userdata['user_level'] != ADMIN )
|
if(isset($HTTP_POST_VARS['newforum']))
|
||||||
{
|
{
|
||||||
message_die(GENERAL_MESSAGE, $lang['Not_admin']);
|
$mode = 'newcat';
|
||||||
|
$forumname = $HTTP_POST_VARS['forumname'];
|
||||||
|
list($cat_id) = $HTTP_POST_VARS['newforum'];
|
||||||
}
|
}
|
||||||
|
|
||||||
include('page_header_admin.'.$phpEx);
|
|
||||||
|
|
||||||
$mode = ($HTTP_GET_VARS['mode']) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
|
|
||||||
|
|
||||||
switch($mode)
|
$template_header = "admin/page_header.tpl";
|
||||||
|
|
||||||
|
if(isset($mode))
|
||||||
{
|
{
|
||||||
case 'manage':
|
switch($mode)
|
||||||
|
{
|
||||||
|
case 'newcat':
|
||||||
|
print "Newcat: $catname";
|
||||||
|
break;
|
||||||
|
case 'newforum':
|
||||||
|
print "Newforum: cat = $cat_id name = $forumname";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$template->set_filenames(array(
|
}
|
||||||
"body" => "admin/admin_forum_manage.tpl")
|
|
||||||
);
|
|
||||||
$template->assign_vars(array("S_MANAGE_ACTION" => append_sid("admin_forums.$phpEx"),
|
|
||||||
"L_FORUM" => $lang['Forum'],
|
|
||||||
"L_MODERATOR" => $lang['Moderator'],
|
|
||||||
"L_ORDER" => $lang['Order'],
|
|
||||||
"POST_FORUM_URL" => POST_FORUM_URL,
|
|
||||||
"L_REMOVE" => $lang['Remove'],
|
|
||||||
"L_EDIT" => $lang['Edit'],
|
|
||||||
"L_LOCK" => $lang['Lock'],
|
|
||||||
"L_UPDATE_ORDER" => $lang['Update_order'],
|
|
||||||
"L_ACTION" => $lang['Action']));
|
|
||||||
|
|
||||||
$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
|
|
||||||
|
$template->set_filenames(array(
|
||||||
|
"body" => "admin/forums_body.tpl")
|
||||||
|
);
|
||||||
|
|
||||||
|
$viewcat = (!empty($HTTP_GET_VARS['viewcat'])) ? $HTTP_GET_VARS['viewcat'] : -1;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Start page proper
|
||||||
|
//
|
||||||
|
$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
|
||||||
FROM " . CATEGORIES_TABLE . " c, " . FORUMS_TABLE . " f
|
FROM " . CATEGORIES_TABLE . " c, " . FORUMS_TABLE . " f
|
||||||
WHERE f.cat_id = c.cat_id
|
WHERE f.cat_id = c.cat_id
|
||||||
GROUP BY c.cat_id, c.cat_title, c.cat_order
|
GROUP BY c.cat_id, c.cat_title, c.cat_order
|
||||||
ORDER BY c.cat_order";
|
ORDER BY c.cat_order";
|
||||||
|
if(!$q_categories = $db->sql_query($sql))
|
||||||
if(!$q_categories = $db->sql_query($sql))
|
{
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, "Could not query categories list", "", __LINE__, __FILE__, $sql);
|
message_die(GENERAL_ERROR, "Could not query categories list", "", __LINE__, __FILE__, $sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($total_categories = $db->sql_numrows($q_categories))
|
if($total_categories = $db->sql_numrows($q_categories))
|
||||||
{
|
{
|
||||||
$category_rows = $db->sql_fetchrowset($q_categories);
|
$category_rows = $db->sql_fetchrowset($q_categories);
|
||||||
|
|
||||||
$sql = "SELECT f.forum_id, f.forum_name, f.forum_desc, f.cat_id, f.forum_order
|
$sql = "SELECT f.*
|
||||||
FROM " . FORUMS_TABLE . " f
|
FROM " . FORUMS_TABLE . " f
|
||||||
ORDER BY f.cat_id, f.forum_order";
|
ORDER BY f.cat_id, f.forum_order";
|
||||||
|
|
||||||
|
@ -97,6 +97,7 @@ switch($mode)
|
||||||
{
|
{
|
||||||
message_die(GENERAL_ERROR, "Could not query forums information", "", __LINE__, __FILE__, $sql);
|
message_die(GENERAL_ERROR, "Could not query forums information", "", __LINE__, __FILE__, $sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !$total_forums = $db->sql_numrows($q_forums) )
|
if( !$total_forums = $db->sql_numrows($q_forums) )
|
||||||
{
|
{
|
||||||
message_die(GENERAL_MESSAGE, $lang['No_forums']);
|
message_die(GENERAL_MESSAGE, $lang['No_forums']);
|
||||||
|
@ -104,109 +105,72 @@ switch($mode)
|
||||||
$forum_rows = $db->sql_fetchrowset($q_forums);
|
$forum_rows = $db->sql_fetchrowset($q_forums);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Obtain list of moderators of each forum
|
// Okay, let's build the index
|
||||||
//
|
//
|
||||||
$sql = "SELECT aa.forum_id, g.group_name, g.group_id, g.group_single_user, u.user_id, u.username
|
$gen_cat = array();
|
||||||
FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g, " . USERS_TABLE . " u
|
|
||||||
WHERE aa.auth_mod = " . TRUE . "
|
|
||||||
AND ug.group_id = aa.group_id
|
|
||||||
AND g.group_id = aa.group_id
|
|
||||||
AND u.user_id = ug.user_id
|
|
||||||
ORDER BY aa.forum_id, g.group_id, u.user_id";
|
|
||||||
|
|
||||||
if(!$q_forum_mods = $db->sql_query($sql))
|
|
||||||
{
|
|
||||||
message_die(GENERAL_ERROR, "Could not query forum moderator information", "", __LINE__, __FILE__, $sql);
|
|
||||||
}
|
|
||||||
$forum_mods_list = $db->sql_fetchrowset($q_forum_mods);
|
|
||||||
|
|
||||||
for($i = 0; $i < count($forum_mods_list); $i++)
|
|
||||||
{
|
|
||||||
if($forum_mods_list[$i]['group_single_user'] || !$forum_mods_list[$i]['group_id'])
|
|
||||||
{
|
|
||||||
$forum_mods_single_user[$forum_mods_list[$i]['forum_id']][] = 1;
|
|
||||||
|
|
||||||
$forum_mods_name[$forum_mods_list[$i]['forum_id']][] = $forum_mods_list[$i]['username'];
|
|
||||||
$forum_mods_id[$forum_mods_list[$i]['forum_id']][] = $forum_mods_list[$i]['user_id'];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$forum_mods_single_user[$forum_mods_list[$i]['forum_id']][] = 0;
|
|
||||||
|
|
||||||
$forum_mods_name[$forum_mods_list[$i]['forum_id']][] = $forum_mods_list[$i]['group_name'];
|
|
||||||
$forum_mods_id[$forum_mods_list[$i]['forum_id']][] = $forum_mods_list[$i]['group_id'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for($i = 0; $i < $total_categories; $i++)
|
for($i = 0; $i < $total_categories; $i++)
|
||||||
{
|
{
|
||||||
$cat_id = $category_rows[$i]['cat_id'];
|
$cat_id = $category_rows[$i]['cat_id'];
|
||||||
$count = 0;
|
|
||||||
|
|
||||||
for($j = 0; $j < $total_forums; $j++)
|
for($j = 0; $j < $total_forums; $j++)
|
||||||
{
|
{
|
||||||
$forum_id = $forum_rows[$j]['forum_id'];
|
$forum_id = $forum_rows[$j]['forum_id'];
|
||||||
|
|
||||||
if($forum_rows[$j]['cat_id'] == $cat_id )
|
|
||||||
{
|
|
||||||
if(!$gen_cat[$cat_id])
|
if(!$gen_cat[$cat_id])
|
||||||
{
|
{
|
||||||
$template->assign_block_vars("catrow", array(
|
$template->assign_block_vars("catrow", array(
|
||||||
"CAT_DESC" => stripslashes($category_rows[$i]['cat_title']))
|
"CAT_ID" => $cat_id,
|
||||||
|
"CAT_DESC" => stripslashes($category_rows[$i]['cat_title']),
|
||||||
|
"U_VIEWCAT" => append_sid("index.$phpEx?viewcat=$cat_id"),
|
||||||
|
"U_ADDFORUM" => append_sid("$PHPSELF?mode=addforum&cat=$cat_id"),
|
||||||
|
"ADDFORUM" => "Add Forum")
|
||||||
);
|
);
|
||||||
$gen_cat[$cat_id] = 1;
|
$gen_cat[$cat_id] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$mod_count = 0;
|
//
|
||||||
$moderators_links = "";
|
// This should end up in the template using IF...ELSE...ENDIF
|
||||||
for($mods = 0; $mods < count($forum_mods_name[$forum_id]); $mods++)
|
//
|
||||||
{
|
$row_color == "#DDDDDD" ? $row_color = "#CCCCCC" : $row_color = "#DDDDDD";
|
||||||
if( !strstr($moderators_links, $forum_mods_name[$forum_id][$mods]) )
|
|
||||||
{
|
|
||||||
if($mods > 0)
|
|
||||||
{
|
|
||||||
$moderators_links .= ", ";
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !($mod_count % 2) && $mod_count != 0 )
|
|
||||||
{
|
|
||||||
$moderators_links .= "<br />";
|
|
||||||
}
|
|
||||||
|
|
||||||
if( $forum_mods_single_user[$forum_id][$mods])
|
|
||||||
{
|
|
||||||
$moderators_links .= "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $forum_mods_id[$forum_id][$mods]) . "\">" . $forum_mods_name[$forum_id][$mods] . "</a>";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$moderators_links .= "<a href=\"" . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=" . $forum_mods_id[$forum_id][$mods]) . "\">" . $forum_mods_name[$forum_id][$mods] . "</a>";
|
|
||||||
}
|
|
||||||
|
|
||||||
$mod_count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($moderators_links == "")
|
|
||||||
{
|
|
||||||
$moderators_links = " ";
|
|
||||||
}
|
|
||||||
|
|
||||||
$template->assign_block_vars("catrow.forumrow", array(
|
$template->assign_block_vars("catrow.forumrow", array(
|
||||||
"FORUM_NAME" => stripslashes($forum_rows[$j]['forum_name']),
|
"FORUM_NAME" => stripslashes($forum_rows[$j]['forum_name']),
|
||||||
"FORUM_DESC" => stripslashes($forum_rows[$j]['forum_desc']),
|
"FORUM_DESC" => stripslashes($forum_rows[$j]['forum_desc']),
|
||||||
"MODERATORS" => $moderators_links,
|
"ROW_COLOR" => $row_color,
|
||||||
"FORUM_ID" => $forum_id,
|
"U_VIEWFORUM" => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&" . $forum_rows[$j]['forum_posts']))
|
||||||
"FORUM_ORDER" => $forum_rows[$j]['forum_order'],
|
);
|
||||||
"U_VIEWFORUM" => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"))
|
} // for ... forums
|
||||||
|
$template->assign_block_vars("catrow.forumrow", array(
|
||||||
|
"S_NEWFORUM" => "<INPUT TYPE='text' NAME='forumname'> <INPUT TYPE='submit' NAME='newforum[$cat_id]' VALUE='New Forum'>")
|
||||||
|
);
|
||||||
|
} // for ... categories
|
||||||
|
$template->assign_block_vars("catrow", array(
|
||||||
|
"S_NEWCAT" => "<INPUT TYPE='text' NAME='catname'> <INPUT TYPE='submit' NAME='newcat' VALUE='New Category'>")
|
||||||
);
|
);
|
||||||
|
|
||||||
$count++;
|
}// if ... total_categories
|
||||||
}
|
else
|
||||||
}
|
{
|
||||||
} // for ... categories
|
message_die(GENERAL_MESSAGE, "There are no Categories or Forums on this board", "", __LINE__, __FILE__, $sql);
|
||||||
}
|
|
||||||
$template->pparse("body");
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$othertext = "<a href='$PHPSELF?mode=addcat'>Add category</a><br>\n";
|
||||||
|
|
||||||
|
$template->assign_vars(array(
|
||||||
|
"S_FORMSTART" => "<FORM METHOD='post' ACTION='$PHP_SELF'>",
|
||||||
|
"S_FORMEND" => "</FORM>"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Generate the page
|
||||||
|
//
|
||||||
|
$template->pparse("body");
|
||||||
|
|
||||||
|
//
|
||||||
|
// Page Footer
|
||||||
|
//
|
||||||
include('page_footer_admin.'.$phpEx);
|
include('page_footer_admin.'.$phpEx);
|
||||||
?>
|
?>
|
|
@ -30,26 +30,10 @@ if($setmodules == 1)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpbb_root_path = "./../";
|
|
||||||
include($phpbb_root_path . 'extension.inc');
|
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Start session management
|
// Include required files, get $phpEx and check permissions
|
||||||
//
|
//
|
||||||
$userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
|
require('pagestart.inc');
|
||||||
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']);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Start program - define vars
|
// Start program - define vars
|
||||||
|
|
|
@ -30,25 +30,11 @@ if($setmodules == 1)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpbb_root_path = "./../";
|
//
|
||||||
include($phpbb_root_path . 'extension.inc');
|
// Include required files, get $phpEx and check permissions
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
//
|
||||||
|
require('pagestart.inc');
|
||||||
|
|
||||||
//
|
echo "Nothing to see here, move on people...<br>\n";
|
||||||
// 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']);
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -31,32 +31,17 @@ if($setmodules == 1)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpbb_root_path = "./../";
|
|
||||||
include($phpbb_root_path . 'extension.inc');
|
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
|
||||||
|
|
||||||
$mode = (isset($HTTP_GET_VARS['mode'])) ? $HTTP_GET_VARS['mode'] : "unban";
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Start session management
|
// Include required files, get $phpEx and check permissions
|
||||||
//
|
//
|
||||||
$userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
|
require('pagestart.inc');
|
||||||
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']);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Start program
|
// Start program
|
||||||
//
|
//
|
||||||
|
|
||||||
|
$mode = (isset($HTTP_GET_VARS['mode'])) ? $HTTP_GET_VARS['mode'] : "unban";
|
||||||
|
|
||||||
if( isset($HTTP_POST_VARS['submit']) && isset($HTTP_POST_VARS['bancontrol']) )
|
if( isset($HTTP_POST_VARS['submit']) && isset($HTTP_POST_VARS['bancontrol']) )
|
||||||
{
|
{
|
||||||
include('page_header_admin.'.$phpEx);
|
include('page_header_admin.'.$phpEx);
|
||||||
|
|
|
@ -30,26 +30,10 @@ if($setmodules == 1)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpbb_root_path = "./../";
|
|
||||||
include($phpbb_root_path . 'extension.inc');
|
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Start session management
|
// Include required files, get $phpEx and check permissions
|
||||||
//
|
//
|
||||||
$userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
|
require('pagestart.inc');
|
||||||
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']);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Start program - define vars
|
// Start program - define vars
|
||||||
|
|
|
@ -30,25 +30,11 @@ if($setmodules == 1)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$phpbb_root_path = "./../";
|
//
|
||||||
include($phpbb_root_path . 'extension.inc');
|
// Include required files, get $phpEx and check permissions
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
//
|
||||||
|
require('pagestart.inc');
|
||||||
|
|
||||||
//
|
echo "BOE!<br>";
|
||||||
// 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']);
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -153,7 +153,7 @@ elseif( $HTTP_GET_VARS['pane'] == 'right' )
|
||||||
|
|
||||||
$avatar_dir_size = 0;
|
$avatar_dir_size = 0;
|
||||||
|
|
||||||
if ($avatar_dir = opendir($phpbb_root_path . $board_config['avatar_path']))
|
if ($avatar_dir = @opendir($phpbb_root_path . $board_config['avatar_path']))
|
||||||
{
|
{
|
||||||
while($file = readdir($avatar_dir))
|
while($file = readdir($avatar_dir))
|
||||||
{
|
{
|
||||||
|
@ -164,6 +164,11 @@ elseif( $HTTP_GET_VARS['pane'] == 'right' )
|
||||||
}
|
}
|
||||||
closedir($avatar_dir);
|
closedir($avatar_dir);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Couldn't open Avatar dir.
|
||||||
|
$avatar_dir_size = '?';
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// This bit of code translates the avatar directory size into human readable format
|
// This bit of code translates the avatar directory size into human readable format
|
||||||
|
|
47
phpBB/admin/pagestart.inc
Normal file
47
phpBB/admin/pagestart.inc
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
<?
|
||||||
|
/***************************************************************************
|
||||||
|
*
|
||||||
|
* -------------------
|
||||||
|
* begin : Thursday, Aug 2, 2001
|
||||||
|
* copyright : (C) 2001 The phpBB Group
|
||||||
|
* email : support@phpbb.com
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
*
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
$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']);
|
||||||
|
}
|
||||||
|
|
||||||
|
include('page_header_admin.'.$phpEx);
|
||||||
|
?>
|
Loading…
Add table
Reference in a new issue