We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Change the Login Destination | Forum

Exaspian Studios
Exaspian Studios Nov 13 '13
Hey there guys! Long time no see.


I have a silly question today, but I simply could not find the answer to it anywhere.


I need to change the page the users are directed to after a successful login. Any ideas? Thanks, Exaspian Studios Staff.

Petar Šlat
Petar Šlat Nov 13 '13
I'm new here but here is my solution.

If you are in Controler try with one of these two lines:


$this->redirect($redirectTo = null);

$this->redirectToAction($action);


redirect is a method that takes one parameter.

if you want it to redirect to dashboard just add 'dashboard'.


EXAMPLE:
$this->redirect('dashboard);

or to 'forum'

$this->redirect('forum');


Hope I helped

The Forum post is edited by Petar Šlat Nov 13 '13
Exaspian Studios
Exaspian Studios Nov 13 '13
Hmmm, looks plausible but I'm not entirely sure what file handles the login?



Thanks for the help, Petar! :)

Petar Šlat
Petar Šlat Nov 13 '13
This is just a guess since I just started using oXwall.


You are looking for a file in

ow_system_plugins\base\controllers\user.php


line 281:

$redirectUrl = isset($_GET['back-uri']) ? OW_URL_HOME . urldecode($_GET['back-uri']) : OW::getRequest()->buildUrlQueryString(null, array());

The Forum post is edited by Petar Šlat Nov 13 '13
Exaspian Studios
Exaspian Studios Nov 13 '13
Perfect! Thanks so much!
Petar Šlat
Petar Šlat Nov 13 '13
You tried it? Did it work?Maybe we can get some other suggestion?


If it's ok rename the first post and add SOLVED at the end :)

The Forum post is edited by Petar Šlat Nov 13 '13
Petar Šlat
Petar Šlat Nov 15 '13
Confirmed in this thread that this solution is OK!


-= RESOLVED =-