Plugin Directory

Changeset 607204


Ignore:
Timestamp:
10/02/2012 09:14:19 PM (14 years ago)
Author:
bastb
Message:

Improved error handling

Location:
lips/branches/dev-0.8.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lips/branches/dev-0.8.8/lips.php

    r607180 r607204  
    14351435            // The thing is attempted to be authenticated, so it needs a Identification or
    14361436            // another auth_req thing.
    1437             try {
    1438                 $oauth = LinkedInProfileSyncOAuth::fromTokenStore($this->tokenstore, false);
    1439                 $oauth->authorize(trim($input["pin"]), array($this, "setOAuthError"), array("pin" => $input["pin"], "oauth" => $oauth, "class" => "auth"));
    1440             }
    1441             catch (OAuthException2 $e) {
     1437            $oauth = LinkedInProfileSyncOAuth::fromTokenStore($this->tokenstore, false);
     1438            if (! $oauth->authorize(trim($input["pin"]), array($this, "setOAuthError"), array("pin" => $input["pin"], "oauth" => $oauth, "class" => "auth"))) {
    14421439                $errcount++;
    14431440            }
     
    16211618            }
    16221619            // ["lastResponse"]=> string(98) "oauth_problem=additional_authorization_required&oauth_problem_advice=verifier%20does%20not%20match"
    1623             $oauth = $callback_specific['oauth'];
    1624             add_settings_error($callback_specific, "oauth_authorization_1", $message . "<br/>" . $oauth->getLastResponse());   
     1620            add_settings_error($callback_specific, "oauth_authorization_1", $message . "<br/>" . $e->getMessage());
    16251621        }
    16261622        else if (null == $callback_specific) {
  • lips/branches/dev-0.8.8/lips_oauth.php

    r607185 r607204  
    185185     */
    186186    public function authorize($pin, $failure_callback = '', $failure_callback_param = null) {
    187         $authorized_token = null;
     187        $is_authorized = false;
    188188
    189189        // Get consumer token
     
    195195        try {
    196196            $this->getAccessToken($id_token['token'], $pin, LinkedInProfileSyncOAuth::getCAInfo());
     197            $is_authorized = true;
    197198        }
    198199        catch (OAuthException2 $e) {
     
    203204                return $this->authorize($pin, $failure_callback, $failure_callback_param); 
    204205            }
    205            
    206         }
    207        
    208         return $authorized_token;
     206        }
     207       
     208        return $is_authorized;
    209209    }
    210210   
Note: See TracChangeset for help on using the changeset viewer.