X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Fapi.php;h=21fe4eea32004868e9a795422fcddb77ceaeaf73;hb=1f4edd70cbe28783784c41eda6c93008bbf86a78;hp=8c4a24e5844901a9a31cc94e8b8521e0bdd6f8b7;hpb=b13374faa568e4e77478b9ffe5c800758ffdc3f3;p=quix0rs-gnu-social.git diff --git a/actions/api.php b/actions/api.php index 8c4a24e584..21fe4eea32 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(); }