<?php

# $Author: chatserv $
# $Date: 2004/10/05 18:04:51 $
/************************************************************************/
/* Forum admin files for PHP-Nuke 7.5 by chatserv                       */
/************************************************************************/
if ( !defined('ADMIN_FILE') )
{	die("Illegal File Access");}
if (!defined('ADMIN_ALLOW') && !defined('USER_ALLOW')) {
	die ("Access Denied");
}
global $prefix, $db;
$aid = substr("$aid", 0,25);
$row = $db->sql_fetchrow($db->sql_query("SELECT title, admins FROM ".TABLE_MODULES." WHERE title='Forums'"));
$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) {

	switch($op) {
	
		case "forums":
		Header("Location: modules/Forums/admin/index.php");
	}

			
} else {
    echo "Access Denied";
}