<?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                                 */
/************************************************************************/
if (!defined('ADMIN_ALLOW') && !defined('ADMIN_MAX')) {
	die ("Access Denied");
}
global $admin_file;
$aid = substr("$aid", 0,25);
$row = $GLOBALS['db']->sql_fetchrow($GLOBALS['db']->sql_query("SELECT `radminsuper` FROM `".TABLE_AUTHORS."` WHERE `aid`='$aid'"));
$acces = $GLOBALS['db']->XMFbin($row['radminsuper']);
if ($acces == 1) {

get_adminlang("secureadmin");

function nsnsecureadminmenu() {
    global $admin_file;

    $sql = "SELECT `active_journal`, `active_ban` from `".TABLE_NSNSECUREADMIN_CONFIG."`";
    if ( !($graf = $GLOBALS['db']->sql_query($sql)) )
{ query_die(GENERAL_ERROR, 'Could not obtain config nsnsecureadmin', '', __LINE__, __FILE__, $sql);}
    $row = $GLOBALS['db']->sql_fetchrow($graf);
    $active_journal = $GLOBALS['db']->XMFnum($row['active_journal']);
    $active_ban     = $GLOBALS['db']->XMFnum($row['active_ban']);

    Max_OpenTable();
    echo "<center><font class='title'><b>"._SECUREADMIN."</b></font></center>"
        ."<center><font class='title'>[ <a href=\"".$admin_file.".php\"><i>"._ADMINISTRATION."</i></a> - "
        ."<a href=\"".$admin_file.".php?op=nsnsecureadmin\">"._PANELNSNSECUREADMIN."</A> - "
        ."<a href=\"".$admin_file.".php?op=secureadminconfig\">   "._CONFIG."</a> ";
    if ($active_journal == 1) {
    echo "- <a href=\"".$admin_file.".php?op=nsnsecureadminjournal\">"._JOURNAL."</a> ";}
    if ($active_ban == 1) {
    echo "- <a href=\"".$admin_file.".php?op=ABMain\">"._IPBANN."</a>";}
    echo " ]</font></center>";
    if (defined('NSN_SECURE_ADMIN')){
    echo "<br /><font size=\"2\" color=\"green\"><center>"._NSNSAOK."</center></font>";}
    else {
    echo "<br /><font size=\"2\" color=\"red\">$nsnsecureadminacces<center>"._NSNSAKO."</center></font>";
    }
    Max_CloseTable();
    br('1');
}

if($admintest && $adminsecu)  {
switch ($op){

    default:include_once ('admin/modules/secureadmin/secureadmin.php');break;
    case 'editnsnsecureadmin':include_once ('admin/modules/secureadmin/editsecureadmin.php');break;
    case 'addnsnsecureadmin':include_once ('admin/modules/secureadmin/addsecureadmin.php');break;
    case 'deletensnsecureadmin':include_once ('admin/modules/secureadmin/deletesecureadmin.php');break;
    case 'savensnsecureadmin':include_once ('admin/modules/secureadmin/savesecureadmin.php');break;
    case 'nsnsecureadminjournal':include_once ('admin/modules/secureadmin/secureadminjournal.php');break;
    case 'deletensnsecureadminjournal':include_once ('admin/modules/secureadmin/deletesecureadminjournal.php');break;
    case 'deletensnsecureadminalljournal':include_once ('admin/modules/secureadmin/deletesecureadminalljournal.php');
    break;
    case 'secureadminconfig':include_once ('admin/modules/secureadmin/secureadminconfig.php');break;
    case 'nsnsecureadminconfigvalid':include_once ('admin/modules/secureadmin/secureadminconfigvalid.php');
    break;

   }
   }
   } else {
    echo "Access Denied";
}