summaryrefslogtreecommitdiff
path: root/actions/api.php
diff options
context:
space:
mode:
authorsarven <csarven@plantard.controlezvous.ca>2009-01-23 08:52:24 +0000
committersarven <csarven@plantard.controlezvous.ca>2009-01-23 08:52:24 +0000
commit0aa2cb35f19fa52160331e9a3846fc9a37a8bc98 (patch)
tree1612445f9c7657f8800191be46312e0ed4e1a5aa /actions/api.php
parent6c9bbdb56174f106ceeebab9a4b6f0ee452ee17f (diff)
parent9c5ab86d0e9fd318eaa3767651975d85a9ffce1a (diff)
Merge branch 'master' of ../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 47c119605..dfe2c8857 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();
}