]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/api.php
whitespace in deletenotice.php
[quix0rs-gnu-social.git] / actions / api.php
index 8c4a24e5844901a9a31cc94e8b8521e0bdd6f8b7..21fe4eea32004868e9a795422fcddb77ceaeaf73 100644 (file)
@@ -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();
         }