logout destination

Permalink 2 users found helpful
Hi,

Is there a way to set where a user is taken when they sign out? Let's say I wanted to send them to google.com -- could I do that?

Thanks,

Andrey

 
Mnkras replied on at Permalink Reply
Mnkras
copy /concrete/controllers/login.php to /controllers find

public function logout() {
      $u = new User();
      $u->logout();
      $this->redirect('/');
   }


change the redirect line.
andreyman3d2k replied on at Permalink Reply
Hi,

This did not actually work (assuming I did it right).

I changed it to:

$this->redirect('http://www.google.com');

And now it takes me to a 'not found' page, because i tacks on the new URL after index.php:

...index.php/http://www.google.com/

I just want it to send the user to that address... Can this be done?

Andrey
SVijay replied on at Permalink Best Answer Reply
SVijay
Hi,

Just try this

public function logout() {
      $u = new User();
      $u->logout();
     header( 'Location:http://www.google.com/' ) ;
   }


It works for me.
andreyman3d2k replied on at Permalink Reply
Genius. Thank you!

Andrey
Gabrius replied on at Permalink Reply
Hi,

Thank you for the code it worked wonderfully in concrete5.5

After the upgrade to 5.6 sadly it wont work.
I have tried both codes and none of them works.
Perhaps this code should be in another php file after the update?

Any help would be great! :)

Thank you,

Henrik
Gabrius replied on at Permalink Reply
I found out a solution.
Thanks SVijay and marticps for providing the Code and destination.

The solution that worked for me is.

1) Copy your root/concrete/controllers/login.php to root/controllers/login.php
2) Go to line 361 or search this:

public function logout() {
      $u = new User();
      $u->logout();
      $this->redirect('/');
   }



Modify it to:

public function logout() {
      $u = new User();
      $u->logout();
      header( 'Location:http://www.google.com/' )
}


Save it in:

root/controllers/login.php

Hope it helps you if you run into the same problem.

Henrik