Skip to content

Commit

Permalink
Correct redirection after logging in.
Browse files Browse the repository at this point in the history
Signed-off-by: Dhananjay Nakrani <dhananjaynakrani@gmail.com>
  • Loading branch information
JayNakrani committed Jul 30, 2014
1 parent e56fd6e commit eb85646
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/Controller/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ protected function _checkAccess() {

$this->Session->setFlash("You need to be signed in to do this", "default",
array("class" => "alert alert-error"));
$this->Session->write("last_page", $this->here);
return $this->redirect($this->referer());
}
}
6 changes: 5 additions & 1 deletion app/Controller/DevelopersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ public function callback() {
. "Please try again later", "default",
array("class" => "alert alert-error"));
}
$this->redirect(array("controller" => "reports","action" => "index"));
$last_page = $this->Session->read("last_page");
if(empty($last_page)) {
$last_page = array("controller" => "reports","action" => "index");
}
$this->redirect($last_page);
}

public function logout() {
Expand Down

0 comments on commit eb85646

Please sign in to comment.