From cda80c696522c713d4e802f5aaa5c91b82f05353 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 28 Nov 2010 13:41:56 +0000 Subject: moved rest/rpc web services handler into web_services library git-svn-id: http://code.elgg.org/elgg/trunk@7460 36083f99-b078-4883-b0ff-0f9b5a30f544 --- services/api/rest_api.php | 58 ----------------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 services/api/rest_api.php (limited to 'services/api') diff --git a/services/api/rest_api.php b/services/api/rest_api.php deleted file mode 100644 index 4cee374d6..000000000 --- a/services/api/rest_api.php +++ /dev/null @@ -1,58 +0,0 @@ -disable_api)) && ($CONFIG->disable_api == true)) { - throw new SecurityException(elgg_echo('SecurityException:APIAccessDenied')); -} - -// plugins should return true to control what API and user authentication handlers are registered -if (elgg_trigger_plugin_hook('rest', 'init', null, false) == false) { - // for testing from a web browser, you can use the session PAM - // do not use for production sites!! - //register_pam_handler('pam_auth_session'); - - // user token can also be used for user authentication - register_pam_handler('pam_auth_usertoken'); - - // simple API key check - register_pam_handler('api_auth_key', "sufficient", "api"); - // hmac - register_pam_handler('api_auth_hmac', "sufficient", "api"); -} - -// Get parameter variables -$method = get_input('method'); -$result = null; - -// this will throw an exception if authentication fails -authenticate_method($method); - -$result = execute_method($method); - - -if (!($result instanceof GenericResult)) { - throw new APIException(elgg_echo('APIException:ApiResultUnknown')); -} - -// Output the result -echo elgg_view_page($method, elgg_view("api/output", array("result" => $result))); \ No newline at end of file -- cgit v1.2.3