Re: Auth > redirect - error

2013-07-12 Thread euromark
thx, fixed that. shouldnt have been false in the first place ;)

I think this is the ticket to the issue - for reference:
https://cakephp.lighthouseapp.com/projects/42648/tickets/3916-fail-to-redirct-in-237



Am Freitag, 12. Juli 2013 17:38:14 UTC+2 schrieb Allan Diego:
>
> I have followed cook book
>
>
> http://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-controlled-application/part-two.html
> Controller::redirect(*mixed $url*, *integer $status*, *boolean $exit*)
>
> If a user is already logged in, redirect him by adding this to your 
> UsersController:
>
> public function login() {
> if ($this->Session->read('Auth.User')) {
> $this->Session->setFlash('You are logged in!');
> $this->redirect('/', null, false);
> }}
>
> tried
>
> $this->redirect('/');
> $this->redirect($this->referer()); 
>
> all redirect to the same url (duplicated base folder)
>
>  
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Auth > redirect - error

2013-07-12 Thread Allan Diego
I have followed cook book

http://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-controlled-application/part-two.html
Controller::redirect(*mixed $url*, *integer $status*, *boolean $exit*)

If a user is already logged in, redirect him by adding this to your 
UsersController:

public function login() {
if ($this->Session->read('Auth.User')) {
$this->Session->setFlash('You are logged in!');
$this->redirect('/', null, false);
}}

tried

$this->redirect('/');
$this->redirect($this->referer()); 

all redirect to the same url (duplicated base folder)

 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Auth > redirect - error

2013-07-12 Thread euromark
unrelated
but why $this->redirect('/', null, false); ?
it should be just $this->redirect('/'); to properly exit on redirect


Am Freitag, 12. Juli 2013 14:14:02 UTC+2 schrieb Allan Diego:
>
> Hello,
>
> I have a redirection problem after upgrade to 2.3.7
> accessing:
>
> *http://www.mysite.com/test/users/login* 
> => logging in, I am directed to 
> *http://www.mysite.com/teste/
> * (thats ok)
>
>
> but accessing:
> *http://www.mysite.com/test/AnyController
> *
> I am directed to 
> *http://www.mysite.com/test/users/login(thats
>  ok too)
> *
> => logging in, I am directed to 
> *http://www.mysite.com/
> test/**test/AnyController***  (duplicated base folder on redirect)
>
> debug kit  Session:
>
>- *Auth*
>   - *redirect* /test/AnyController
>
>
> object(CakeRequest) {
>   url => 'test/AnyController'
>   base => '/test'
>   webroot => '/test/'
>   here => '/test/test/AnyController'
> }
>
>
> AppController beforeFilter()
>
> $this->Auth->loginRedirect = array('controller' => 'pages', 'action' => 
> 'index');
>
>
>
> public function login() {
>
> if ($this->Session->read('Auth.Usuario')) {
>$this->redirect('/', null, false);
> }
> 
>
> if ($this->request->is('post')) {
> 
> if ($this->Auth->login()) {
> $this->redirect($this->Auth->redirectUrl()); 
> //$this->redirect($this->Auth->redirect());
> 
> } else {
> $this->Session->setFlash('Incorrect Users or password.', 
> 'flash_erro');
> }
> }
> }
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Auth > redirect - error

2013-07-12 Thread Allan Diego
Hello,

I have a redirection problem after upgrade to 2.3.7
accessing:

*http://www.mysite.com/test/users/login* 
=> logging in, I am directed to 
*http://www.mysite.com/teste/
* (thats ok)


but accessing:
*http://www.mysite.com/test/AnyController
*
I am directed to 
*http://www.mysite.com/test/users/login(thats
 ok too)
*
=> logging in, I am directed to *http://www.mysite.com/
test/**test/AnyController***  (duplicated base folder on redirect)

debug kit  Session:

   - *Auth*
  - *redirect* /test/AnyController
   

object(CakeRequest) {
url => 'test/AnyController'
base => '/test'
webroot => '/test/'
here => '/test/test/AnyController'
}


AppController beforeFilter()

$this->Auth->loginRedirect = array('controller' => 'pages', 'action' => 
'index');



public function login() {

if ($this->Session->read('Auth.Usuario')) {
   $this->redirect('/', null, false);
}


if ($this->request->is('post')) {

if ($this->Auth->login()) {
$this->redirect($this->Auth->redirectUrl()); 
//$this->redirect($this->Auth->redirect());

} else {
$this->Session->setFlash('Incorrect Users or password.', 
'flash_erro');
}
}
}

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.