Esempio n. 1
0
 /**
  * @return bool
  */
 protected function isAuth()
 {
     require_once ROOT . '/dataProvider/Applications.php';
     $Applications = new Applications();
     $access = $Applications->hasAccess($this->params->SecureKey);
     unset($Applications);
     return $access;
 }
Esempio n. 2
0
    $pvtKey = $data[0]->server->pvtKey;
    $token = $data[0]->server->token;
} else {
    $site = $data->server->site;
    $pvtKey = isset($data->server->pvtKey) ? $data->server->pvtKey : '';
    $token = isset($data->server->token) ? $data->server->token : '';
}
include_once '../registry.php';
include_once '../sites/' . $site . '/conf.php';
include_once '../dataProvider/Modules.php';
include_once '../dataProvider/Applications.php';
include_once '../classes/Sessions.php';
include_once 'config.php';
$modules = new Modules();
$app = new Applications();
$appAccess = $app->hasAccess($pvtKey);
$API = array_merge($API, $modules->getEnabledModulesAPI());
if (isset($token)) {
    $s = new Sessions();
    $userAccess = $s->setSessionByToken($token);
}
function doRpc($cdata)
{
    global $API;
    global $appAccess;
    try {
        if (!$appAccess) {
            throw new Exception('Access Denied: Please make sure API Key is typed correctly in the settings tab');
        }
        if (!isset($API[$cdata->action])) {
            throw new Exception('Call to undefined action: ' . $cdata->action);