]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/apiauth.php
Merge branch 'admin-sections/4' into 0.9.x
[quix0rs-gnu-social.git] / lib / apiauth.php
index b8189f15dd9e276ea8f63ae9d85340fdfdad1770..0d1613d381ed17de89be5410b47e1b7df2f04637 100644 (file)
@@ -87,7 +87,7 @@ class ApiAuthAction extends ApiAction
     }
 
     /**
-     * Check for a user specified via HTTP basic auth. If there is not
+     * Check for a user specified via HTTP basic auth. If there isn't
      * one, try to get one by outputting the basic auth header.
      *
      * @return boolean true or false
@@ -110,7 +110,11 @@ class ApiAuthAction extends ApiAction
         } else {
             $nickname = $this->auth_user;
             $password = $this->auth_pw;
-            $this->auth_user = common_check_user($nickname, $password);
+            $user = common_check_user($nickname, $password);
+            if (Event::handle('StartSetApiUser', array(&$user))) {
+                $this->auth_user = $user;
+                Event::handle('EndSetApiUser', array($user));
+            }
 
             if (empty($this->auth_user)) {