diff options
author | Zach Copley <zach@status.net> | 2010-02-05 03:19:12 +0000 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-02-05 03:19:12 +0000 |
commit | 23802e58d6d01e5f8dacade2161147d31b2dacb9 (patch) | |
tree | 707120cc8d2d0217e4168473b7a7ef25e94919e0 /lib/apiauth.php | |
parent | 4502bea9a86fe5992eb9b359d90f0c1f004998c1 (diff) | |
parent | 857494c9c61d872b7decf69de226bba6cd250d99 (diff) |
Merge branch 'temp'
Diffstat (limited to 'lib/apiauth.php')
-rw-r--r-- | lib/apiauth.php | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/apiauth.php b/lib/apiauth.php index 99500404f..25e2196cf 100644 --- a/lib/apiauth.php +++ b/lib/apiauth.php @@ -55,6 +55,7 @@ class ApiAuthAction extends ApiAction { var $auth_user_nickname = null; var $auth_user_password = null; + var $oauth_source = null; /** * Take arguments for running, looks for an OAuth request, @@ -73,20 +74,18 @@ class ApiAuthAction extends ApiAction // NOTE: $this->auth_user has to get set in prepare(), not handle(), // because subclasses do stuff with it in their prepares. - if ($this->requiresAuth()) { + $oauthReq = $this->getOAuthRequest(); - $oauthReq = $this->getOAuthRequest(); - - if (!$oauthReq) { + if (!$oauthReq) { + if ($this->requiresAuth()) { $this->checkBasicAuthUser(true); } else { - $this->checkOAuthRequest($oauthReq); + // Check to see if a basic auth user is there even + // if one's not required + $this->checkBasicAuthUser(false); } } else { - - // Check to see if a basic auth user is there even - // if one's not required - $this->checkBasicAuthUser(false); + $this->checkOAuthRequest($oauthReq); } // Reject API calls with the wrong access level @@ -108,7 +107,6 @@ class ApiAuthAction extends ApiAction * This is to avoid doign any unnecessary DB lookups. * * @return mixed the OAuthRequest or false - * */ function getOAuthRequest() @@ -137,7 +135,6 @@ class ApiAuthAction extends ApiAction * @param OAuthRequest $request the OAuth Request * * @return nothing - * */ function checkOAuthRequest($request) |