Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix redirect

  • Loading branch information...
commit f91a7c010137a215a59258a008febdd519654145 1 parent d74b380
Yusuke Ando authored
7 app/Controller/AccountController.php
@@ -176,8 +176,11 @@ public function register() {
176 176 */
177 177 public function login() {
178 178 $this->set('setting', $this->Setting);
179   -
180   - if (!$this->request->data) {
  179 +
  180 + if (isset($this->request->query['back_url'])) {
  181 + $this->set('back_url',$this->request->query['back_url']);
  182 + return;
  183 + } elseif (!$this->request->data) {
181 184 $this->set('back_url',$this->referer());
182 185 return;
183 186 }
9 app/Controller/AppController.php
@@ -217,7 +217,14 @@ public function set_localization() {
217 217 */
218 218 public function require_login() {
219 219 if (!$this->current_user || !$this->current_user['logged']) {
220   - $this->redirect('/account/login');
  220 + $this->redirect(
  221 + '/account/login?back_url=' .
  222 + urlencode(
  223 + 'http://' .
  224 + env('HTTP_HOST') .
  225 + env('REQUEST_URI')
  226 + )
  227 + );
221 228 # redirect_to :controller => "account", :action => "login", :back_url => url_for(params)
222 229 return false;
223 230 }

0 comments on commit f91a7c0

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