]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add Start/EndSetApiUser events when setting API user via OAuth
authorZach Copley <zach@status.net>
Thu, 21 Jan 2010 02:01:07 +0000 (18:01 -0800)
committerZach Copley <zach@status.net>
Mon, 25 Jan 2010 00:46:37 +0000 (16:46 -0800)
lib/apiauth.php

index 8374c24a7fdfcf5d53a70a85d853e88becc73df5..f513ed2c9a02af77cf7595172efdd83170db268f 100644 (file)
@@ -149,7 +149,10 @@ class ApiAuthAction extends ApiAction
                     $this->access = ($appUser->access_type & Oauth_application::$writeAccess)
                       ? self::READ_WRITE : self::READ_ONLY;
 
-                    $this->auth_user = User::staticGet('id', $appUser->profile_id);
+                    if (Event::handle('StartSetApiUser', array(&$user))) {
+                        $this->auth_user = User::staticGet('id', $appUser->profile_id);
+                        Event::handle('EndSetApiUser', array($user));
+                    }
 
                     $msg = "API OAuth authentication for user '%s' (id: %d) on behalf of " .
                       "application '%s' (id: %d).";