Merge branch '0.9.x' into openidplugin

This commit is contained in:
Evan Prodromou 2009-08-04 13:10:43 -04:00
commit 000e21be19
2 changed files with 10 additions and 4 deletions

View File

@ -223,3 +223,7 @@ EndRegistrationTry: after saving a new user (note: no profile or user object!)
StartNewQueueManager: before trying to start a new queue manager; good for plugins implementing new queue manager classes StartNewQueueManager: before trying to start a new queue manager; good for plugins implementing new queue manager classes
- $qm: empty queue manager to set - $qm: empty queue manager to set
RedirectToLogin: event when we force a redirect to login (like when going to a settings page on a remembered login)
- $action: action object being shown
- $user: current user

View File

@ -77,10 +77,12 @@ class SettingsAction extends CurrentUserDesignAction
// _all_ our settings are important // _all_ our settings are important
common_set_returnto($this->selfUrl()); common_set_returnto($this->selfUrl());
$user = common_current_user(); $user = common_current_user();
if ($user->hasOpenID()) { if (Event::handle('RedirectToLogin', array($this, $user))) {
common_redirect(common_local_url('openidlogin'), 303); if ($user->hasOpenID()) {
} else { common_redirect(common_local_url('openidlogin'), 303);
common_redirect(common_local_url('login'), 303); } else {
common_redirect(common_local_url('login'), 303);
}
} }
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') { } else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$this->handlePost(); $this->handlePost();