[ Index ]

PHP Cross Reference of phpBB-3.1.12-deutsch

title

Body

[close]

/adm/ -> index.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  
  14  /**
  15  */
  16  define('IN_PHPBB', true);
  17  define('ADMIN_START', true);
  18  define('NEED_SID', true);
  19  
  20  // Include files
  21  $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
  22  $phpEx = substr(strrchr(__FILE__, '.'), 1);
  23  require($phpbb_root_path . 'common.' . $phpEx);
  24  require($phpbb_root_path . 'includes/functions_acp.' . $phpEx);
  25  require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
  26  require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
  27  
  28  // Start session management
  29  $user->session_begin();
  30  $auth->acl($user->data);
  31  $user->setup('acp/common');
  32  // End session management
  33  
  34  // Have they authenticated (again) as an admin for this session?
  35  if (!isset($user->data['session_admin']) || !$user->data['session_admin'])
  36  {
  37      login_box('', $user->lang['LOGIN_ADMIN_CONFIRM'], $user->lang['LOGIN_ADMIN_SUCCESS'], true, false);
  38  }
  39  
  40  // Is user any type of admin? No, then stop here, each script needs to
  41  // check specific permissions but this is a catchall
  42  if (!$auth->acl_get('a_'))
  43  {
  44      trigger_error('NO_ADMIN');
  45  }
  46  
  47  // We define the admin variables now, because the user is now able to use the admin related features...
  48  define('IN_ADMIN', true);
  49  
  50  // Some oft used variables
  51  $safe_mode        = (@ini_get('safe_mode') == '1' || strtolower(@ini_get('safe_mode')) === 'on') ? true : false;
  52  $file_uploads    = (@ini_get('file_uploads') == '1' || strtolower(@ini_get('file_uploads')) === 'on') ? true : false;
  53  $module_id        = request_var('i', '');
  54  $mode            = request_var('mode', '');
  55  
  56  // Set custom style for admin area
  57  $template->set_custom_style(array(
  58      array(
  59          'name'         => 'adm',
  60          'ext_path'     => 'adm/style/',
  61      ),
  62  ), $phpbb_admin_path . 'style');
  63  
  64  $template->assign_var('T_ASSETS_PATH', $phpbb_root_path . 'assets');
  65  $template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
  66  
  67  // Instantiate new module
  68  $module = new p_master();
  69  
  70  // Instantiate module system and generate list of available modules
  71  $module->list_modules('acp');
  72  
  73  // Select the active module
  74  $module->set_active($module_id, $mode);
  75  
  76  // Assign data to the template engine for the list of modules
  77  // We do this before loading the active module for correct menu display in trigger_error
  78  $module->assign_tpl_vars(append_sid("{$phpbb_admin_path}index.$phpEx"));
  79  
  80  // Load and execute the relevant module
  81  $module->load_active();
  82  
  83  // Generate the page
  84  adm_page_header($module->get_page_title());
  85  
  86  $template->set_filenames(array(
  87      'body' => $module->get_tpl_name(),
  88  ));
  89  
  90  adm_page_footer();


Generated: Thu Jan 11 00:25:41 2018 Cross-referenced by PHPXref 0.7.1