Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix redirect

  • Loading branch information...
commit f91a7c010137a215a59258a008febdd519654145 1 parent d74b380
@yandod authored
View
7 app/Controller/AccountController.php
@@ -176,8 +176,11 @@ public function register() {
*/
public function login() {
$this->set('setting', $this->Setting);
-
- if (!$this->request->data) {
+
+ if (isset($this->request->query['back_url'])) {
+ $this->set('back_url',$this->request->query['back_url']);
+ return;
+ } elseif (!$this->request->data) {
$this->set('back_url',$this->referer());
return;
}
View
9 app/Controller/AppController.php
@@ -217,7 +217,14 @@ public function set_localization() {
*/
public function require_login() {
if (!$this->current_user || !$this->current_user['logged']) {
- $this->redirect('/account/login');
+ $this->redirect(
+ '/account/login?back_url=' .
+ urlencode(
+ 'http://' .
+ env('HTTP_HOST') .
+ env('REQUEST_URI')
+ )
+ );
# redirect_to :controller => "account", :action => "login", :back_url => url_for(params)
return false;
}

0 comments on commit f91a7c0

Please sign in to comment.
Something went wrong with that request. Please try again.