diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-11-18 14:19:43 -0500 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-11-18 14:19:43 -0500 |
commit | d07df8a7964e08d1af9e7bd762f2ac07035d9856 (patch) | |
tree | 954e19d9cd996e014ae69dd26ea885618ca7f9cd /lib | |
parent | 1d6bacc681eca89b7c20bb96fbacf5bcb8434d88 (diff) |
Added Authorization plugin
Added LDAPAuthorization plugin
Diffstat (limited to 'lib')
-rw-r--r-- | lib/apiauth.php | 6 | ||||
-rw-r--r-- | lib/util.php | 13 |
2 files changed, 14 insertions, 5 deletions
diff --git a/lib/apiauth.php b/lib/apiauth.php index 2f2e44a26..0d1613d38 100644 --- a/lib/apiauth.php +++ b/lib/apiauth.php @@ -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)) { diff --git a/lib/util.php b/lib/util.php index 68f3520db..5bf4f6091 100644 --- a/lib/util.php +++ b/lib/util.php @@ -196,10 +196,15 @@ function common_set_user($user) } if ($user) { - common_ensure_session(); - $_SESSION['userid'] = $user->id; - $_cur = $user; - return $_cur; + if (Event::handle('StartSetUser', array(&$user))) { + if($user){ + common_ensure_session(); + $_SESSION['userid'] = $user->id; + $_cur = $user; + Event::handle('EndSetUser', array($user)); + return $_cur; + } + } } return false; } |