Beehive PHP Cross Reference Discussion Forums

Source: /admin.php - 95 lines - 3240 bytes - Summary - Text - Print

   1  <?php
   2  
   3  /*======================================================================
   4  Copyright Project Beehive Forum 2002
   5  
   6  This file is part of Beehive Forum.
   7  
   8  Beehive Forum is free software; you can redistribute it and/or modify
   9  it under the terms of the GNU General Public License as published by
  10  the Free Software Foundation; either version 3 of the License, or
  11  (at your option) any later version.
  12  
  13  Beehive Forum is distributed in the hope that it will be useful,
  14  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16  GNU General Public License for more details.
  17  
  18  You should have received a copy of the GNU General Public License
  19  along with Beehive; if not, write to the Free Software
  20  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  21  USA
  22  ======================================================================*/
  23  
  24  // Bootstrap
  25  require_once  'boot.php';
  26  
  27  // Required includes
  28  require_once  BH_INCLUDE_PATH . 'admin.inc.php';
  29  require_once  BH_INCLUDE_PATH . 'cache.inc.php';
  30  require_once  BH_INCLUDE_PATH . 'constants.inc.php';
  31  require_once  BH_INCLUDE_PATH . 'format.inc.php';
  32  require_once  BH_INCLUDE_PATH . 'html.inc.php';
  33  require_once  BH_INCLUDE_PATH . 'server.inc.php';
  34  require_once  BH_INCLUDE_PATH . 'session.inc.php';
  35  // End Required includes
  36  
  37  // Don't cache this page
  38  cache_disable();
  39  
  40  // Check we're logged in correctly
  41  if (!session::logged_in()) {
  42      html_guest_error();
  43  }
  44  
  45  // Check we have Admin / Moderator access
  46  if ((!session::check_perm(USER_PERM_ADMIN_TOOLS, 0) && !session::check_perm(USER_PERM_FORUM_TOOLS, 0, 0) && !session::get_folders_by_perm(USER_PERM_FOLDER_MODERATE))) {
  47      html_draw_error(gettext("You do not have permission to use this section."));
  48  }
  49  
  50  // Perform additional admin login.
  51  admin_check_credentials();
  52  
  53  // Get the user's saved left frame width.
  54  if (isset($_SESSION['LEFT_FRAME_WIDTH']) && is_numeric($_SESSION['LEFT_FRAME_WIDTH'])) {
  55      $left_frame_width = max(100, $_SESSION['LEFT_FRAME_WIDTH']);
  56  } else {
  57      $left_frame_width = 280;
  58  }
  59  
  60  // Output starts here
  61  html_draw_top('frame_set_html', 'pm_popup_disabled', 'main_css=admin.css');
  62  
  63  $frameset = new html_frameset_cols('admin', "$left_frame_width,*");
  64  
  65  if (isset($_GET['page']) && strlen(trim($_GET['page'])) > 0) {
  66  
  67      $requested_page = trim($_GET['page']);
  68  
  69      $available_pages_preg = implode("|^", array_map('preg_quote_callback', get_available_admin_files()));
  70  
  71      if (preg_match("/^$available_pages_preg/u", basename($requested_page)) > 0) {
  72  
  73          $requested_page = href_cleanup_query_keys($requested_page);
  74  
  75          $frameset->html_frame("admin_menu.php?webtag=$webtag", html_get_frame_name('left'));
  76          $frameset->html_frame($requested_page, html_get_frame_name('right'));
  77  
  78          $frameset->output_html();
  79  
  80          html_draw_bottom(true);
  81          exit;
  82      }
  83  }
  84  
  85  $frameset->html_frame("admin_menu.php?webtag=$webtag", html_get_frame_name('left'));
  86  
  87  if (session::check_perm(USER_PERM_ADMIN_TOOLS, 0)) {
  88      $frameset->html_frame("admin_users.php?webtag=$webtag", html_get_frame_name('right'));
  89  } else {
  90      $frameset->html_frame("admin_forums.php?webtag=$webtag", html_get_frame_name('right'));
  91  }
  92  
  93  $frameset->output_html();
  94  
  95  html_draw_bottom(true);

title

Description

title

Description

title

Description

title

title

Body