From: Zach Copley Date: Thu, 21 Jan 2010 02:01:07 +0000 (-0800) Subject: Add Start/EndSetApiUser events when setting API user via OAuth X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fd276ff9e7a1292a217ddb144d600d04bc473d03;p=quix0rs-gnu-social.git Add Start/EndSetApiUser events when setting API user via OAuth --- diff --git a/lib/apiauth.php b/lib/apiauth.php index b4292408a1..927dcad6af 100644 --- a/lib/apiauth.php +++ b/lib/apiauth.php @@ -148,7 +148,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).";