From 049f2af1c982bb12fee6e5512e4830f63d06d343 Mon Sep 17 00:00:00 2001 From: Joe7 Date: Wed, 12 Jan 2011 00:05:11 +0100 Subject: Returning 2 flags from l10n_client::validate_api_key(), 1 to reflect if connection was built up properly (just a boolean, not distuingishing between reasons in case of a failure), the other to reflect API validating success status. Using this presenting a slightly more meaningfull error msg to user in case the connection would fail. Fixes Ticket #1504 --- modules/gallery/helpers/l10n_client.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules/gallery/helpers') diff --git a/modules/gallery/helpers/l10n_client.php b/modules/gallery/helpers/l10n_client.php index 8c2685a8..2af5c8d0 100644 --- a/modules/gallery/helpers/l10n_client.php +++ b/modules/gallery/helpers/l10n_client.php @@ -60,10 +60,14 @@ class l10n_client_Core { "client_token" => l10n_client::client_token(), "signature" => $signature, "uid" => l10n_client::server_uid($api_key))); + if (!isset($response_data) && !isset($response_status)) { + return array(false, false); + } + if (!remote::success($response_status)) { - return false; + return array(true, false); } - return true; + return array(true, true); } /** -- cgit v1.2.3