<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.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.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
/********************************************************/
/* NSN Banner Ads                                       */
/* By: NukeScripts Network (webmaster@nukescripts.net)  */
/* http://www.nukescripts.net                           */
/* Copyright  2000-2005 by NukeScripts Network         */
/********************************************************/

global $admin_file, $adveditor;
$adveditor = 0;
if(!isset($admin_file)) { $admin_file = "admin"; }
if (!defined('ADMIN_ALLOW') && !defined('ADMIN_MAX')) {
    redirect_url("../../".$admin_file.".php");
    die();
}
include_once('modules/Banner_Ads/includes/functions_admin.php');
$modname = "Banner_Ads";
get_lang($modname);
$index=1;
$aid = substr("$aid", 0,25);
$row = $db->sql_fetchrow($db->sql_query("SELECT `title`, `admins` FROM `".TABLE_MODULES."` WHERE `title`='$modname'"));
$row2 = $db->sql_fetchrow($db->sql_query("SELECT `name`, `radminsuper` FROM `".TABLE_AUTHORS."` WHERE `aid`='$aid'"));
$admins = explode(",", $row['admins']);
$auth_user = 0;
for($i=0; $i < sizeof($admins); $i++) { if($row2['name'] == "$admins[$i]" AND $row['admins'] != "") { $auth_user = 1; } }
if($row2['radminsuper'] == 1 || $auth_user == 1) {
  $ba_config = baget_configs();
  switch($op) {
    case "BAClient":include("modules/$modname/admin/BAClient.php");break;
    case "BAClientAdd":include("modules/$modname/admin/BAClientAdd.php");break;
    case "BAClientAddSave":include("modules/$modname/admin/BAClientAddSave.php");break;
    case "BAClientDelete":include("modules/$modname/admin/BAClientDelete.php");break;
    case "BAClientDeleteConf":include("modules/$modname/admin/BAClientDeleteConf.php");break;
    case "BAClientEdit":include("modules/$modname/admin/BAClientEdit.php");break;
    case "BAClientEditSave":include("modules/$modname/admin/BAClientEditSave.php");break;
    case "BAClientView":include("modules/$modname/admin/BAClientView.php");break;
    case "BAImage":include("modules/$modname/admin/BAImage.php");break;
    case "BAImageAdd":include("modules/$modname/admin/BAImageAdd.php");break;
    case "BAImageAddSave":include("modules/$modname/admin/BAImageAddSave.php");break;
    case "BAImageDelete":include("modules/$modname/admin/BAImageDelete.php");break;
    case "BAImageDeleteConf":include("modules/$modname/admin/BAImageDeleteConf.php");break;
    case "BAImageEdit":include("modules/$modname/admin/BAImageEdit.php");break;
    case "BAImageEditSave":include("modules/$modname/admin/BAImageEditSave.php");break;
    case "BAImageMail":include("modules/$modname/admin/BAImageMail.php");break;
    case "BAImageView":include("modules/$modname/admin/BAImageView.php");break;
    case "BAMain":include("modules/$modname/admin/BAMain.php");break;
    case "BAMainSave":include("modules/$modname/admin/BAMainSave.php");break;
  }
} else {
  echo _BA_ACCDEN;
}