]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
new action for when we redirect to login page
authorEvan Prodromou <evan@controlyourself.ca>
Tue, 4 Aug 2009 17:10:37 +0000 (13:10 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Tue, 4 Aug 2009 17:10:37 +0000 (13:10 -0400)
EVENTS.txt
lib/settingsaction.php

index ef4c2cffa4f5d15f458715615d67f8fb3f3c6b52..25d95fe068345a6ca81b706843f7054ad3ffa7ac 100644 (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
 - $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
index 17d3a2f64dcb1853190ee0064b6a224d01342be0..4cf9b80c4a59e09f166b6e12a038408c5e7689a0 100644 (file)
@@ -77,10 +77,12 @@ class SettingsAction extends CurrentUserDesignAction
             // _all_ our settings are important
             common_set_returnto($this->selfUrl());
             $user = common_current_user();
-            if ($user->hasOpenID()) {
-                common_redirect(common_local_url('openidlogin'), 303);
-            } else {
-                common_redirect(common_local_url('login'), 303);
+            if (Event::handle('RedirectToLogin', array($this, $user))) {
+                if ($user->hasOpenID()) {
+                    common_redirect(common_local_url('openidlogin'), 303);
+                } else {
+                    common_redirect(common_local_url('login'), 303);
+                }
             }
         } else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
             $this->handlePost();