<?php
/**
 * @version $Id: main.inc.php v2.0 $
 * @package PBDigg
 * @copyright Copyright (C) 2007 - 2008 PBDigg.com. All Rights Reserved.
 * @license PBDigg is free software and use is subject to license terms
 */

if(!defined('IN_ADMIN') || !isset($_PBDEV['PHP_SELF']) || !preg_match('/[\/\\\\]admincp\.php$/i', $_PBDEV['PHP_SELF']))
{
	exit('Access Denied');
}
define('PB_CSCRIPT', 'main');
$system = array();

$system['serverSoft'] = $_SERVER['SERVER_SOFTWARE'];
$system['serverOS'] = PHP_OS;
$system['PHPVersion'] = PHP_VERSION;
$system['MySQLVersion'] = $DB->db_version();
$system['globalRegister'] = checkCfg('register_globals');
if (ini_get('file_uploads'))
{
	$system['uploadFile'] = $a_message['allow'];
}
else
{
	$system['uploadFile'] = '<span class="r">' . $a_message['deny'] . '</span>';
}
$system['gdVersion'] = GDVersion();
$system['gdVersion'] = $system['gdVersion'] ? $system['gdVersion'] : '<span class="r">' . $a_message['deny'] . '</span>';
$system['domain'] = $_SERVER['SERVER_NAME'];
$system['serverTime'] = gdate($timestamp, 'Y-m-d H:i:s');
$TPL->assign('system', $system);
$TPL->assign('menu', $m_shortcut);
function checkCfg($str)
{
	global $a_message;
	$fun = function_exists('get_cfg_var') ? 'get_cfg_var' : 'ini_get';
	$param = $fun($str);
	switch ($param)
	{
		case 1 :
			return $a_message['open'];
			break;
		case 0 :
			return $a_message['close'];
			break;
		default :
			return $param;
			break;
	}
}
function GDVersion()
{
	if (function_exists('gd_info'))
	{
		$gd = gd_info();
	}
	return $gd['GD Version'] ? $gd['GD Version'] : FALSE;	
}
?>
