aboutsummaryrefslogtreecommitdiff
path: root/endpoints
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-10 08:32:16 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-04-10 08:32:16 +0000
commitb0d3d96af7765ce1aff21a1a3ab19ffbb494363a (patch)
tree2cab87dba2eb687eec067a78468e2870b450c9c1 /endpoints
parent4943b4e05e41d270a8c1448bcf82780ef5103c06 (diff)
downloadelgg-b0d3d96af7765ce1aff21a1a3ab19ffbb494363a.tar.gz
elgg-b0d3d96af7765ce1aff21a1a3ab19ffbb494363a.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Created PAM library * API moved to use new PAM functions git-svn-id: https://code.elgg.org/elgg/trunk@431 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'endpoints')
-rw-r--r--endpoints/rest.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/endpoints/rest.php b/endpoints/rest.php
index 862540e57..6d4e253f8 100644
--- a/endpoints/rest.php
+++ b/endpoints/rest.php
@@ -33,8 +33,8 @@
throw new ConfigurationException("Sorry, API access has been disabled by the administrator.");
// Register some default PAM methods, plugins can add their own
- register_api_pam_handler('pam_auth_session');
- register_api_pam_handler('pam_auth_hmac');
+ register_pam_handler('pam_auth_session');
+ register_pam_handler('pam_auth_hmac');
// Get parameter variables
$format = get_input('format', 'php');
@@ -42,7 +42,7 @@
$result = null;
// Authenticate session
- if (api_pam_authenticate())
+ if (pam_authenticate())
{
// Authenticated somehow, now execute.
$token = "";
@@ -51,6 +51,8 @@
$result = execute_method($method, $params, $token);
}
+ else
+ throw new SecurityException("No authentication methods were found that could authenticate this API request.");
// Finally output
if (!($result instanceof GenericResult))