diff options
author | Evan Prodromou <git@evanprodromou.name> | 2009-01-08 16:15:08 -0500 |
---|---|---|
committer | Evan Prodromou <git@evanprodromou.name> | 2009-01-08 16:15:08 -0500 |
commit | 0f8b902004dc7245a56307ed69c766d949f06dc3 (patch) | |
tree | ab3bd152c45ae2b74e50497e7e277f1ee00b8a1e /actions/api.php | |
parent | 28d17d8d90b8b15eec2baa19d7c3bfaf5ad057db (diff) |
Revert "Twitter-compatible API - update verify_credentials to return profile"
This reverts commit b801f73b1f4706f15783f91fd07508a03175592d.
Twhirl assumes we return the old kind of results, so we have to do that.
Diffstat (limited to 'actions/api.php')
-rw-r--r-- | actions/api.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/actions/api.php b/actions/api.php index 919a515ce..ccebcd89e 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,9 +70,13 @@ class ApiAction extends Action { } } else { - # Look for the user in the session - if (common_logged_in()) { - $this->user = common_current_user(); + # 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 } $this->process_command(); |