summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-01-20 18:01:07 -0800
committerZach Copley <zach@status.net>2010-01-20 18:01:07 -0800
commitfd276ff9e7a1292a217ddb144d600d04bc473d03 (patch)
treef016ef37ba336ab6be1fb538e1e1f96e5cef69a1 /lib
parent05156b708a16c5a20d4081242c398e667792de15 (diff)
Add Start/EndSetApiUser events when setting API user via OAuth
Diffstat (limited to 'lib')
-rw-r--r--lib/apiauth.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/apiauth.php b/lib/apiauth.php
index b4292408a..927dcad6a 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).";