]> git.vanrenterghem.biz Git - www.vanrenterghem.biz.git/blob - phpBB2/admin/pagestart.php
26c269a3130ab0af7f0fd057b4e962076911da76
[www.vanrenterghem.biz.git] / phpBB2 / admin / pagestart.php
1 <?php
2 /***************************************************************************
3  *                               pagestart.php
4  *                            -------------------
5  *   begin                : Thursday, Aug 2, 2001
6  *   copyright            : (C) 2001 The phpBB Group
7  *   email                : support@phpbb.com
8  *
9  *   $Id: pagestart.php,v 1.1.2.10 2006/01/22 17:11:09 grahamje Exp $
10  *
11  *
12  ***************************************************************************/
14 /***************************************************************************
15  *
16  *   This program is free software; you can redistribute it and/or modify
17  *   it under the terms of the GNU General Public License as published by
18  *   the Free Software Foundation; either version 2 of the License, or
19  *   (at your option) any later version.
20  *
21  ***************************************************************************/
23 if (!defined('IN_PHPBB'))
24 {
25         die("Hacking attempt");
26 }
28 define('IN_ADMIN', true);
29 // Include files
30 include($phpbb_root_path . 'common.'.$phpEx);
32 //
33 // Start session management
34 //
35 $userdata = session_pagestart($user_ip, PAGE_INDEX);
36 init_userprefs($userdata);
37 //
38 // End session management
39 //
41 if (!$userdata['session_logged_in'])
42 {
43         redirect(append_sid("login.$phpEx?redirect=admin/index.$phpEx", true));
44 }
45 else if ($userdata['user_level'] != ADMIN)
46 {
47         message_die(GENERAL_MESSAGE, $lang['Not_admin']);
48 }
50 if ($HTTP_GET_VARS['sid'] != $userdata['session_id'])
51 {
52         redirect("index.$phpEx?sid=" . $userdata['session_id']);
53 }
55 if (!$userdata['session_admin'])
56 {
57         redirect(append_sid("login.$phpEx?redirect=admin/index.$phpEx&admin=1", true));
58 }
60 if (empty($no_page_header))
61 {
62         // Not including the pageheader can be neccesarry if META tags are
63         // needed in the calling script.
64         include('./page_header_admin.'.$phpEx);
65 }
67 ?>