]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/api.php
Merge branch 'master' of /var/www/mublog
[quix0rs-gnu-social.git] / actions / api.php
index 47c1196052e25bd5a3ccf3dfe0a84b1ddcd55765..dfe2c8857b67ff4d8a94d9de1a299856d525c32d 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();
         }