<?php
ob_start();
if(!(is_readable(realpath(dirname(__FILE__).'/../')."/include/loginroutines.inc"))) {
	die("Error - Could not open or read file ".realpath(dirname(__FILE__).'/../')."/include/loginroutines.inc");
} else {
	include_once(realpath(dirname(__FILE__).'/../')."/include/loginroutines.inc");
}

// параметр фасад передается как часть пути
if(!(is_readable(realpath(dirname(__FILE__).'/../')."/include/db/mysqlroutines.inc"))) {
	die("Error - Could not open or read file ".realpath(dirname(__FILE__).'/../')."/include/db/mysqlroutines.inc");
} else {
	include_once(realpath(dirname(__FILE__).'/../')."/include/db/mysqlroutines.inc");
}

if(!(is_readable(realpath(dirname(__FILE__).'/../')."/include/translate.inc"))) {
	die("Error - Could not open or read file ".realpath(dirname(__FILE__).'/../')."/include/translate.inc");
} else {
	include_once(realpath(dirname(__FILE__).'/../')."/include/translate.inc");
}

if(!(is_readable(realpath(dirname(__FILE__).'/../')."/include/content.inc"))) {
	die("Error - Could not open or read file ".realpath(dirname(__FILE__).'/../')."/include/content.inc");
} else {
	include_once(realpath(dirname(__FILE__).'/../')."/include/content.inc");
}


if ( getSetting('portal','useRights',0) != 1 || !IsUserLogin() || !isUserAdmin()){
	ob_end_flush();
	exit;
}

if (!isset($_SESSION['user_idlanguagecontent'])){
	checkLanguage();
}

$cn = db_connect();
$user_idlanguagecontent = $_SESSION['user_idlanguagecontent'];
session_write_close();
db_getServiceDataObjectTreetoAdmin($cn,isset($_REQUEST['root']) ? $_REQUEST['root'] : 0, $user_idlanguagecontent);
db_disconnect($cn);
ob_end_flush();
?>
