<?PHP
$rootpath=$_SERVER['DOCUMENT_ROOT'] . "/";
include_once($rootpath . "common.php");
if (is_array($_GET) && (isset($_GET['action'])))
doGet($_GET);
elseif (is_array($_POST) && (isset($_POST['action'])))
doPost($_POST);
else
exit;
function doGet($request)
{
global $rootpath, $webappcfg, $rb;
if ($request['action'] == "xmlgetid")
{
if (isset($request['username']))
{
include_once($webappcfg['APPPATH'] . "/user/include.php");
$bsuseracc = new BSUserAccount();
$tuseraccount = $bsuseracc->getUserAccount($request['username']);
if (count($tuseraccount)>0)
{
$response['useraccount'] = $tuseraccount[0];
}
else
{
$response['useraccount'] = new UserAccount(-1, "", "", "",
"", "", "", "", "", "", "", "", "", "",
"", "", "");
}
}
header('Content-type: text/xml;charset=UTF-8');
echo('<?xml version="1.0" encoding="UTF-8"?>'."\n");
include($rootpath . "xmlfeed/xmluserid.php");
}
elseif ($request['action']=="dirprop")
{
include_once($webappcfg['APPPATH'] . "/file/include.php");
include_once($webappcfg['APPPATH'] . "/dir/include.php");
include_once($webappcfg['APPPATH'] . "/general/include.php");
include_once($webappcfg['APPPATH'] . "/user/include.php");
$response = array();
$bsxml = new BSXMLDirProp();
$response = $bsxml->getXMLDirProp($request, $response);
header('Content-type: text/xml;charset=UTF-8');
echo('<?xml version="1.0" encoding="UTF-8"?>'."\n");
include($rootpath . "xmlfeed/xmldirprop.php");
//echo("<PRE>");
//print_r($response);
}
elseif ($request['action']=="xmldriveprop")
{
include_once($webappcfg['APPPATH'] . "/file/include.php");
include_once($webappcfg['APPPATH'] . "/general/include.php");
include_once($webappcfg['APPPATH'] . "/acctype/include.php");
include_once($webappcfg['APPPATH'] . "/user/include.php");
// Input Variable
// $request['ownerid']
$bsgdp = new BSGetDriveProp();
$response['driveprop'] = $bsgdp->getDriveProp($request['ownerid']);
header('Content-type: text/xml;charset=UTF-8');
echo('<?xml version="1.0" encoding="UTF-8"?>'."\n");
include($rootpath . "xmlfeed/driveprop.php");
}
}
function doPost($request)
{
doGet($request);
}
/*
Function to check login
if (!NSession::check_login())
{
//echo("NOLOGIN");
// Bring to login page;
header("Location: http://".$webappcfg['httphost']."/");
return;
}
*/
?>