diff options
author | Zach Copley <zach@controlyourself.ca> | 2008-12-15 22:04:55 -0500 |
---|---|---|
committer | Zach Copley <zach@controlyourself.ca> | 2008-12-15 22:04:55 -0500 |
commit | b801f73b1f4706f15783f91fd07508a03175592d (patch) | |
tree | e42fd4e07a70583a342b502a063e15f2b188d475 /actions/api.php | |
parent | 9ef3f7cee601c80d93924eec2216a36bcbce73ef (diff) |
Twitter-compatible API - update verify_credentials to return profile
darcs-hash:20081216030455-7b5ce-552516bfb34cb0ae1550787813feb4a4514d6c53.gz
Diffstat (limited to 'actions/api.php')
-rw-r--r-- | actions/api.php | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/actions/api.php b/actions/api.php index ccebcd89e..919a515ce 100644 --- a/actions/api.php +++ b/actions/api.php @@ -47,7 +47,7 @@ class ApiAction extends Action { $this->content_type = strtolower($cmdext[1]); } - if($this->requires_auth()) { + if ($this->requires_auth()) { if (!isset($_SERVER['PHP_AUTH_USER'])) { # This header makes basic auth go @@ -70,13 +70,9 @@ class ApiAction extends Action { } } else { - # Caller might give us a username even if not required - if (isset($_SERVER['PHP_AUTH_USER'])) { - $user = User::staticGet('nickname', $_SERVER['PHP_AUTH_USER']); - if ($user) { - $this->user = $user; - } - # Twitter doesn't throw an error if the user isn't found + # Look for the user in the session + if (common_logged_in()) { + $this->user = common_current_user(); } $this->process_command(); |