summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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).";