The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/printthread.php(287) : eval()'d code 2 errorHandler->error
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



UserSpice
redirect to page after login - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: redirect to page after login (/showthread.php?tid=389)

Pages: 1 2


redirect to page after login - meetmec12 - 12-14-2016

Hi am new here .I will like to knw how to redirect all users to a new page and not the default dashboard page. If that will not be cool how do I add new links to the default dashboard and how do I hide the current links .Thank you


redirect to page after login - mudmin - 12-14-2016

For the redirect after login thing, go to usersc/scripts/custom_login_script.php and put

Code:
Redirect::to('http://yourlinkhere');

If you just want to add links to the current dashboard, you can put them in
usersc/includes/admin_panels.php (if it doesn't exist, create it).

If you want to completely modify the admin.php file, then you probably need to make bigger changes. The main reason is that our updates, would eventually overwrite your customizations. To prevent that, copy admin.php into the usersc folder.

Change line 21 in your NEW admin.php to
Code:
<?php require_once '../users/init.php'; ?>

Now when you go to the admin panel, you will see your custom page instead of ours and you can modify it however you want without breaking things on updates. There may be a few other things that have to be tweaked with a page as complicated as that one, but that should get you close.





redirect to page after login - meetmec12 - 12-14-2016

Thanks for your quick response. I am in love with this framework .its so cool . #5stars


redirect to page after login - mudmin - 12-14-2016

Awesome! So glad you're liking it. It's my first php project and I've had a lot of fun with it.



redirect to page after login - CarlPiper - 05-16-2018

Hi there, i've changed the redirect url to
Code:
Redirect::to($us_url_root.'index.php');
but it still redirects to
Code:
users/account.php
.

How do i fix this?


redirect to page after login - Brandin - 05-16-2018

Did you do this in the custom_login_script?


redirect to page after login - CarlPiper - 05-17-2018

Yes in the
Code:
usersc/scripts/custom_login_script.php

Whole contents of the file:
<pre>
Code:
<?php
//Whatever you put here will happen after the username and password are verified and the user is "technically" logged in, but they have not yet been redirected to their starting page.  This gives you access to all the user's data through $user->data()

//Where do you want to redirect the user after login
Redirect::to($us_url_root.'index.php');
?>
</pre>


I have tried with a / before the index.php as well and that didn't work either.

Little bit of info I'm running userspice version 4.3.10


redirect to page after login - Brandin - 05-17-2018

Are you able to type in the URL to this index.php file directly and access it?

Thanks,
Brandin.


redirect to page after login - CarlPiper - 05-18-2018

Yes the index.php is working perfectly fine. Only accessible when user is logged in though.

Edit:

If i go to myurl.com/index.php you mean?
and going to just myurl.com goes to index.php aswell, but obviously only when logged in. if your not logged in it goes to login page as expected.


redirect to page after login - Brandin - 05-18-2018

The issue could be that you might be putting Redirect::to('index.php') and youre trying to get to /index.php but that would redirect you to users/index.php. If you want to go to index.php in root, use Redirect::to('../index.php');