From 11ecd7e47bd20ec4083e926b0c64586e83193416 Mon Sep 17 00:00:00 2001 From: marcus Date: Thu, 24 Jul 2008 17:36:00 +0000 Subject: Fixing oopsy... git-svn-id: https://code.elgg.org/elgg/trunk@1514 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/api.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/engine/lib/api.php b/engine/lib/api.php index ed77fe162..933b718e8 100644 --- a/engine/lib/api.php +++ b/engine/lib/api.php @@ -627,15 +627,12 @@ $method = get_input('method'); $token = get_input('token'); - if (($method) && ($token)) - { - $validated_userid = validate_user_token($CONFIG->site_id, $token); - - if ((!$METHODS[$method]["require_auth_token"]) || ($validated_userid) || (isloggedin())) - return true; - else - throw new SecurityException(elgg_echo('SecurityException:AuthTokenExpired'), GenericResult::$RESULT_FAIL_AUTHTOKEN); - } + $validated_userid = validate_user_token($CONFIG->site_id, $token); + + if ((!$METHODS[$method]["require_auth_token"]) || ($validated_userid) || (isloggedin())) + return true; + else + throw new SecurityException(elgg_echo('SecurityException:AuthTokenExpired'), GenericResult::$RESULT_FAIL_AUTHTOKEN); return false; } -- cgit v1.2.3