From dc189ba46fc8c2f54b6f680410b9e7f85e6c9c8d Mon Sep 17 00:00:00 2001 From: Michael Francis Date: Fri, 1 Jul 2011 00:59:21 -0400 Subject: Fix to redirect a user if they request a private function while not logged in --- controllers/UsersController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'controllers') diff --git a/controllers/UsersController.php b/controllers/UsersController.php index cc0b3db..fdea5f8 100644 --- a/controllers/UsersController.php +++ b/controllers/UsersController.php @@ -319,9 +319,14 @@ class UsersController extends \lithium\action\Controller { } //If the user was trying to go somewhere, redirect them there - if ($location != null) + $loc = Session::read('url'); + if (isset($loc)) { - + Session::delete('url'); + return $this->redirect(array('controller' => $loc['controller'], + 'action' => $loc['action'], + 'args' => $loc['args'] + )); } //Otherwise send them to the hompa return $this->redirect('Users::feed'); -- cgit v1.2.3