Exemple #1
0
header('Access-Control-Allow-Origin: *');
require_once 'Constants.php';
//-----------------------------------------------------------------------------
//init var
//-----------------------------------------------------------------------------
$chk = array("bool" => true);
//-----------------------------------------------------------------------------
require_once Import::$uber_src_path . "server/werm/utils/SetPublicProp.php";
//-----------------------------------------------------------------------------
if (Constants::$loginCHK) {
    require Import::$uber_src_path . "server/werm/services/Account_v0.php";
}
//-----------------------------------------------------------------------------
if (Constants::$loginCHK && isset($_COOKIE["user"])) {
    Constants::$loggedIN = Account_v0::getUserSession($_COOKIE["user"]);
}
//-----------------------------------------------------------------------------
$_OBJ = isset($_GET["service"]) ? $_GET : $_POST;
//-----------------------------------------------------------------------------
indexExist($_OBJ, array('service', 'functionName'));
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//imports
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
constExist("Constants", array("HOST", "PASS", "USER"));
//----------------------------------------------------------
require_once Import::$uber_src_path . "server/werm/utils/GenFun.php";
//----------------------------------------------------------
$classPath = GenFun::constCHK($_OBJ['service']);
Exemple #2
0
$object = SetPublicProp::findObj($object, $_OBJ['functionName']);
//----------------------------------------------------------
$orig_functionName = $_OBJ['functionName'];
//----------------------------------------------------------
$_OBJ['functionName'] = $object['string'];
//----------------------------------------------------------
$object = $object['class'];
//----------------------------------------------------------
//if (!file_exists($classPath) && is_null($object)) die($classPath." does not exist!!!!");
//----------------------------------------------------------
if (isset($_OBJ['prop'])) {
    SetPublicProp::go($object, $_OBJ['prop']);
}
//----------------------------------------------------------
if (Constants::$loginCHK && isset($_COOKIE[Account_v0::getPrefix() . "user"])) {
    $loggedIN = Account_v0::getUserSession();
    if (!$loggedIN['bool']) {
        Constants::$loggedIN = NULL;
    }
}
//-----------------------------------------------------------------------------
if (!isset($_OBJ['params'])) {
    $_OBJ['params'] = array();
}
//----------------------------------------------------------
if (!method_exists($object, $_OBJ['functionName'])) {
    $chk['bool'] = false;
    $chk['message'] = $orig_functionName . " does not exist in " . $_OBJ['service'];
}
//----------------------------------------------------------
$chk = $chk["bool"] ? call_service($object, $_OBJ['functionName'], $_OBJ['params']) : $chk;