From b0d3d96af7765ce1aff21a1a3ab19ffbb494363a Mon Sep 17 00:00:00 2001 From: icewing Date: Thu, 10 Apr 2008 08:32:16 +0000 Subject: Marcus Povey * 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 --- endpoints/rest.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'endpoints') 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)) -- cgit v1.2.3