diff options
author | Brion Vibber <brion@pobox.com> | 2010-10-20 15:59:27 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-10-20 15:59:27 -0700 |
commit | bcc06d05e8b0ec4ac9d91ac65e6905d02c4b43cc (patch) | |
tree | 17ab2581f487f081723696c96ac5571257e79990 /actions/apioauthauthorize.php | |
parent | 9d401e2b15c93b91c087507ae8ac8dcb8a44f8d2 (diff) |
Initial OpenID+OAuth thingy.
Diffstat (limited to 'actions/apioauthauthorize.php')
-rw-r--r-- | actions/apioauthauthorize.php | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/actions/apioauthauthorize.php b/actions/apioauthauthorize.php index 0e61cdf2c..b603dce4a 100644 --- a/actions/apioauthauthorize.php +++ b/actions/apioauthauthorize.php @@ -157,9 +157,13 @@ class ApiOauthAuthorizeAction extends Action // XXX Force credentials check? - // XXX OpenID + // @fixme this should probably use a unified login form handler + $user = null; + if (Event::handle('StartOAuthLoginCheck', array($this, &$user))) { + $user = common_check_user($this->nickname, $this->password); + } + Event::handle('EndOAuthLoginCheck', array($this, &$user)); - $user = common_check_user($this->nickname, $this->password); if (empty($user)) { // TRANS: Form validation error given when an invalid username and/or password was passed to the OAuth API. $this->showForm(_("Invalid nickname / password!")); @@ -344,21 +348,24 @@ class ApiOauthAuthorizeAction extends Action $this->elementEnd('ul'); if (!common_logged_in()) { - $this->elementStart('fieldset'); - // TRANS: Fieldset legend. - $this->element('legend', null, _m('LEGEND','Account')); - $this->elementStart('ul', 'form_data'); - $this->elementStart('li'); - // TRANS: Field label on OAuth API authorisation form. - $this->input('nickname', _('Nickname')); - $this->elementEnd('li'); - $this->elementStart('li'); - // TRANS: Field label on OAuth API authorisation form. - $this->password('password', _('Password')); - $this->elementEnd('li'); - $this->elementEnd('ul'); - - $this->elementEnd('fieldset'); + if (Event::handle('StartOAuthLoginForm', array($this))) { + $this->elementStart('fieldset'); + // TRANS: Fieldset legend. + $this->element('legend', null, _m('LEGEND','Account')); + $this->elementStart('ul', 'form_data'); + $this->elementStart('li'); + // TRANS: Field label on OAuth API authorisation form. + $this->input('nickname', _('Nickname')); + $this->elementEnd('li'); + $this->elementStart('li'); + // TRANS: Field label on OAuth API authorisation form. + $this->password('password', _('Password')); + $this->elementEnd('li'); + $this->elementEnd('ul'); + + $this->elementEnd('fieldset'); + } + Event::handle('EndOAuthLoginForm', array($this)); } $this->element('input', array('id' => 'cancel_submit', |