Location: PHPKode > projects > Network Managment / Inventory System > clearsite/admin.php
<?php
/*
 +-------------------------------------------------------------------------+
 | Copyright (C) 2006-2008 Xinn.org                                        |
 |                                                                         |
 | 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.                  |
 |                                                                         |
 | This program is distributed in the hope that it will be useful,         |
 | but WITHOUT ANY WARRANTY; without even the implied warranty of          |
 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           |
 | GNU General Public License for more details.                            |
 +-------------------------------------------------------------------------+
 | ClearSite/ALOE, A Long Overdue Enterprise network managment solution!   |
 +-------------------------------------------------------------------------+
 | This code is designed, written, and maintained by the Xinn.org. See     |
 | about.php and/or the AUTHORS file for specific developer information.   |
 +-------------------------------------------------------------------------+
 | http://aloeusers.net                                                    |
 | http://clearsite.sourceforge.net                                        |
 | http://aloenms.net                                                      |
 | http://clear-site.net                                                   |
 | http://clear-site.info                                                  |
 | http://xinn.org/ClearSite.html                                          |
 +-------------------------------------------------------------------------+
*/
$pageref = "admin";

extract($_POST);
extract($_GET);

include_once('include/config.php');
include_once("$cs_base_path/include/header.php");

if (isset($_COOKIE['clearsite']['user_ID'])) {
  $user_ID = $_COOKIE['clearsite']['user_ID'];
  mysql_connect("$DBhost:$DBport",$DBuser,$DBpass) or die("Unable to connect to database");
  @mysql_select_db("$DBName") or die("Unable to select database $DBName");
  $user_level_query = "SELECT userlevel FROM user_data WHERE user_ID=\"$user_ID\"";
  $user_level_result = mysql_query($user_level_query);
  $user_level_row = mysql_fetch_assoc($user_level_result);
  $user_level = $user_level_row['userlevel'];
  if ($user_level > 0) {
    include_once("$cs_base_path/include/sidebar.php");
    print "<div id=\"targetArea\">";
    include_once("$cs_base_path/include/admin/site_admin.php");
    print "</div>";
  } else {
    print "<div id=\"targetArea\">You do not have permissino to use the Admin interface.  Please contact the clear Site administrator.</div>";
  };
} else {
  print "<div id=\"targetArea\">Please Log in</div>";
};

include_once("$cs_base_path/include/footer.php");
?>
Return current item: Network Managment / Inventory System