View file FFDB/admin.php

File size: 6.64Kb
<?php
// +----------------------------------------------------------------------+
// |                      Fantastic File Database                         |
// +----------------------------------------------------------------------+
// |                          By Tony Baird                               |
// |                  Copyright (c) 2003 Fantastic Scripts                |
// |                          http://fscripts.com                         |
// +----------------------------------------------------------------------+
// | Fantastic File Database Can be modified freely as long as copyright  | 
// | is intact and this is left at the top of every source file           |
// +----------------------------------------------------------------------+
// | admin.php                                                            |
// | Date Started: March 10, 2003                                         |
// | Last Modified: March 12, 2003                                        |
// +----------------------------------------------------------------------+
require("config.php");
require("functions.php");
require("Admin/functions.php");
// Advance users can edit this to reflect their own template of choice
// although it's not suggested because a lot can go wrong editing the
// admin area templates but if you got the skills go ahead :)
// Of course remember to leave the nice powered by stuff in since well
// you just did the HTML and that is easy :P
$admin_skin="default";
$ffdb=new Ffdb;
$ffdb->StartTimer();
$tpl=new Templates;
$mysql=new Mysql;
$mysql->Connect();
$admin=new Admin;
session_start();
session_name("Admin_Area");
set_magic_quotes_runtime(0);
error_reporting  (E_ERROR | E_WARNING | E_PARSE);
$adminnav=new AdminNav;
if (empty($_REQUEST['login']) && $_REQUEST['action']!="menu") {
	$admin->Header();
}
class AdminNav {
	var $skin;
	//********************************************/
	// Just Figures out which part of the admin
	// we are using
	//*******************************************/
	function AdminNav() {
		global $admin,$tpl,$admin_skin;
		if ($_REQUEST['login']) {
			$admin->CheckLogin();
			$tpl->LoadTemplate("frame","Admin/templates/$admin_skin/frame.tpl");
			$tpl->ParseTemplate("frame",$frame_array,"No");
			$tpl->PrintTemplate("frame");

		}elseif ($_REQUEST['action']=="menu") {
			$admin->CheckLogin();
			$admin->Menu();

		}elseif ($_REQUEST['action']=="main") {
			$admin->CheckLogin();
			$admin->Main();

		}elseif ($_REQUEST['action']=="add_category" || isset($_REQUEST['add_category']) || $_REQUEST['action']=="edit_category" ||$_REQUEST['action']=="delete_category_confirm" || $_REQUEST['action']=="delete_category" || $_REQUEST['action']=="edit_category_form" || isset($_REQUEST['edit_category'])) {
			$admin->CheckLogin();
			if (!preg_match("/@4/",$admin->user_level)) {
				$admin->Error("You don't have permission to use this feature");
			}
			require("Admin/category.php");
			$category=new Category;

		}elseif ($_REQUEST['action']=="display_order" || isset($_REQUEST['update_display_order'])) {
			$admin->CheckLogin();
			if (!preg_match("/@4@5/",$admin->user_level)) {
				$admin->Error("You don't have permission to use this feature");
			}
			require("Admin/category.php");
			$category=new Category;

		}elseif ($_REQUEST['action']=="add_sub_category" || isset($_REQUEST['add_sub_category']) || $_REQUEST['action']=="edit_sub_category" ||$_REQUEST['action']=="delete_sub_category_confirm" || $_REQUEST['action']=="delete_sub_category" || $_REQUEST['action']=="edit_sub_category_form" || isset($_REQUEST['edit_sub_category'])) {
			$admin->CheckLogin();
			if (!preg_match("/@5/",$admin->user_level)) {
				$admin->Error("You don't have permission to use this feature");
			}
			require("Admin/sub_category.php");
			$sub_category=new SubCategory;
		}elseif ($_REQUEST['action']=="edit_user" || $_REQUEST['action']=="edit_user_form" || $_REQUEST['action']=="confirm_delete_user" || $_REQUEST['action']=="delete_user" || isset($_REQUEST['edit_user'])) {
			$admin->CheckLogin();
			if (!preg_match("/@8/",$admin->user_level)) {
				$admin->Error("You don't have permission to use this feature");
			}
			require("Admin/user.php");
			$user=new User;
		}elseif ($_REQUEST['action']=="add_license" || isset($_REQUEST['add_license']) || $_REQUEST['action']=="edit_license" ||$_REQUEST['action']=="delete_license_confirm" || $_REQUEST['action']=="delete_license" || $_REQUEST['action']=="edit_license_form" || isset($_REQUEST['edit_license'])) {
			$admin->CheckLogin();
			if (!preg_match("/@8/",$admin->user_level)) {
				$admin->Error("You don't have permission to use this feature");
			}
			require("Admin/license.php");
			$license=new License;
		}elseif ($_REQUEST['action']=="edit_templates" || $_REQUEST['action']=="template_list" || $_REQUEST['action']=="edit_template_form" || isset($_REQUEST['update_template'])) {
			$admin->CheckLogin();
			if (!preg_match("/@8/",$admin->user_level)) {
				$admin->Error("You don't have permission to use this feature");
			}
			require("Admin/template.php");
			$template=new Template;
		}elseif ($_REQUEST['action']=="change_settings" || isset($_REQUEST['update_settings'])) {
			$admin->CheckLogin();
			if (!preg_match("/@8/",$admin->user_level)) {
				$admin->Error("You don't have permission to use this feature");
			}
			require("Admin/settings.php");
			$settings=new Settings;
		}elseif ($_REQUEST['action']=="add_file" || isset($_REQUEST['add_file'])) {
			$admin->CheckLogin();
			if (!preg_match("/@6/",$admin->user_level)) {
				$admin->Error("You don't have permission to use this feature");
			}
			require("Admin/file.php");
			$file=new File;
		}elseif ($_REQUEST['action']=="edit_file" ||$_REQUEST['action']=="delete_file_confirm" || $_REQUEST['action']=="delete_file" || $_REQUEST['action']=="edit_file_form" || isset($_REQUEST['edit_file'])) {
			$admin->CheckLogin();
			if (!preg_match("/@7/",$admin->user_level)) {
				$admin->Error("You don't have permission to use this feature");
			}
			require("Admin/file.php");
			$file=new File;
		}elseif ($_REQUEST['action']=="add_skin" || isset($_REQUEST['add_skin']) || $_REQUEST['action']=="edit_skin" || $_REQUEST['action']=="edit_skin_form" || $_REQUEST['action']=="delete_skin_confirm" || $_REQUEST['action']=="delete_skin" || isset($_REQUEST['edit_skin'])) {
			$admin->CheckLogin();
			if (!preg_match("/@8/",$admin->user_level)) {
				$admin->Error("You don't have permission to use this feature");
			}
			require("Admin/skin.php");
			$settings=new Skin;
		} else {
			$admin->LoginForm();
		}
	}
}
if ($_REQUEST['action']!="menu") {
	$admin->Footer();
}
?>