summaryrefslogtreecommitdiff
path: root/actions/api.php
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-01-23 01:20:00 -0800
committerZach Copley <zach@controlyourself.ca>2009-01-23 01:20:00 -0800
commit0ef33663ce0b3739e8e9eb3b9951dee5059c6b3b (patch)
tree179a9aaa7f7828489e93fca86ceeaa01b4d270a2 /actions/api.php
parentb13374faa568e4e77478b9ffe5c800758ffdc3f3 (diff)
parent6b5fb0ab7d8c2e982052a48270e882e7f7379743 (diff)
Merge branch 'master' of ssh://zach@dev.controlyourself.ca/var/www/trunk
Diffstat (limited to 'actions/api.php')
-rw-r--r--actions/api.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/actions/api.php b/actions/api.php
index 8c4a24e58..21fe4eea3 100644
--- a/actions/api.php
+++ b/actions/api.php
@@ -72,10 +72,14 @@ 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();
}