Файл: adultscript-2.0.3-pro/files/admin/index.php
Строк: 21
<?php
define('_VALID', true);
define('_ADMIN', true);
require realpath('../libraries/bootstrap.php');
VAuth::check('Administrator', ADMIN_URL.'/login.php');
VCookie::set('age_check', '1', 31536000);
$template = VF::cfg_item('template_admin');
$tpl = VF::factory('template', array(
'template' => $template,
'template_dir' => BASE_DIR.'/admin/templates/'.$template,
'template_url' => BASE_URL.'/admin/templates/'.$template,
'template_rel' => RELATIVE_URL.'/admin/templates/'.$template
));
$module = (VUri::request(0)) ? VUri::request(0) : 'main';
if (preg_match('/^[A-Za-z0-9_]+$/', $module)) {
$module_path = ADMIN_DIR.'/modules/'.$module.'/'.$module.'.php';
$module_class = 'VModule_Admin_'.$module;
try {
require $module_path;
$obj = new $module_class();
$obj->render();
} catch (Exception $e) {
throw new VException($e);
}
} else {
throw new VException('Invalid admin module format! Aborting!');
}
VF::close();
?>