diff options
author | icewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-06 12:24:52 +0000 |
---|---|---|
committer | icewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-06 12:24:52 +0000 |
commit | 676c95cf17fc49c32d4ea88dc7cf6d3659afd33e (patch) | |
tree | 9ba456f3f7c8b52f386574d76ee4c4c66a076ad8 | |
parent | 66a312099d0c075535d2443ed6c99585eecfe105 (diff) | |
download | elgg-676c95cf17fc49c32d4ea88dc7cf6d3659afd33e.tar.gz elgg-676c95cf17fc49c32d4ea88dc7cf6d3659afd33e.tar.bz2 |
Marcus Povey <marcus@dushka.co.uk>
* More internationalisation
git-svn-id: https://code.elgg.org/elgg/trunk@823 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | languages/en.php | 6 | ||||
-rw-r--r-- | services/api/rest.php | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/languages/en.php b/languages/en.php index 6d28a74dd..3fde82ee5 100644 --- a/languages/en.php +++ b/languages/en.php @@ -93,7 +93,11 @@ 'InvalidParameterException:NoDataFound' => "Could not find any data.", 'InvalidParameterException:DoesNotBelong' => "Does not belong to entity.", 'InvalidParameterException:DoesNotBelongOrRefer' => "Does not belong to entity or refer to entity.", - 'InvalidParameterException:MissingParameter' => "Missing parameter, you need to provide a GUID.",
+ 'InvalidParameterException:MissingParameter' => "Missing parameter, you need to provide a GUID.", + + 'SecurityException:APIAccessDenied' => "Sorry, API access has been disabled by the administrator.", + 'SecurityException:NoAuthMethods' => "No authentication methods were found that could authenticate this API request.", + 'APIException:ApiResultUnknown' => "API Result is of an unknown type, this should never happen.",
/**
* User details
*/
diff --git a/services/api/rest.php b/services/api/rest.php index 2944a24ff..41e44d9b2 100644 --- a/services/api/rest.php +++ b/services/api/rest.php @@ -26,7 +26,7 @@ // Check to see if the api is available if ((isset($CONFIG->disable_api)) && ($CONFIG->disable_api == true)) - throw new ConfigurationException("Sorry, API access has been disabled by the administrator."); + throw new SecurityException(elgg_echo('SecurityException:APIAccessDenied')); // Register some default PAM methods, plugins can add their own register_pam_handler('pam_auth_session'); @@ -47,11 +47,11 @@ $result = execute_method($method, $params, $token); } else - throw new SecurityException("No authentication methods were found that could authenticate this API request."); + throw new SecurityException(elgg_echo('SecurityException:NoAuthMethods')); // Finally output if (!($result instanceof GenericResult)) - throw new APIException("API Result is of an unknown type, this should never happen."); + throw new APIException(elgg_echo('APIException:ApiResultUnknown')); // Output the result page_draw($method, elgg_view("api/output", array("result" => $result))); |