Esempio n. 1
0
    };
    $cacheKey = MemcacheProvider::getKeyDirectusUserFind($userId);
    $user = $DirectusUsersTableGateway->memcache->getOrCache($cacheKey, $cacheFn, 10800);
    return $user;
});
if (Auth::loggedIn()) {
    $user = Auth::getUserRecord();
    $acl->setUserId($user['id']);
    $acl->setGroupId($user['group']);
}
/**
 * Request Payload
 */
$params = $_GET;
$requestPayload = json_decode($app->request()->getBody(), true);
$endpoints = Bootstrap::getCustomEndpoints();
foreach ($endpoints as $endpoint) {
    require $endpoint;
}
/**
 * Extension Alias
 */
if (isset($_REQUEST['run_extension']) && $_REQUEST['run_extension']) {
    // Validate extension name
    $extensionName = $_REQUEST['run_extension'];
    if (!Bootstrap::extensionExists($extensionName)) {
        header('HTTP/1.0 404 Not Found');
        return JsonView::render(['message' => __t('no_such_extensions')]);
    }
    // Validate request nonce
    // NOTE: do no use nonce until it's well implemented