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
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
account.php
#1
Hi,

I'm new with this. Just installed the version 4.2 of Userspice.

When I log in, I'm redirected to users/account.php, but that's not what I want. I want to be redirected to the page I landed on.

Does anyone know what I should change in my config?

Kind regards,
nessinits
  Reply
#2
Yep. Go to usersc/scripts/custom_login_script.php
You can edit wherever your user goes after login.
  Reply
#3
Thanks for the answer, but I've changed it into
Redirect::to($us_url_root."/");

But it doesn't work.
  Reply
#4
What about
Code:
Redirect::to('http://mydomain.com');

or

Code:
Redirect::to('http://localhost/userspice');

or whatever you type in your browser to access that page.
  Reply
#5
Nope, still doesn't have any effect and I'm really working with a clean install.
  Reply
#6
By the way: The current code:
<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('admin.php');

?>
</pre>
  Reply
#7
So that would be
Redirect::to($us_url_root.'users/admin.php');

The idea of formatting things like that is that you want the script to work regardless of where it's being called from, so by going relative to your root (that z_us_root.php file), you sort of have this anchor so the code always knows where it's at. I hope that makes sense.
  Reply
#8
It does make sense, but it's not working properly. I've copied your line, pasted into the custom script and bang: back to account.php.

It makes my laugh. ;-)
  Reply
#9
I think what happened is that the wordpress turned the single quotes into curly quotes. Get the link from here...
https://hastebin.com/gaxoxeqube.php (click that and then copy/paste).

Ohh... One more thing to think about. Does the user you are signed into have access to admin.php?

One simple way to test is go to usersc/scripts/did_not_have_permission.php and uncomment out line 3. If you find yourself on facebook, you'll know that you weren't redirected because your link was wrong. You were redirected because your account didn't have the proper permission.
  Reply
#10
mudmin, thanks for the support so far.

I've used the line of code used on hastebin.com. It still didn't work.

I've tried the script did_not_have_permissions.php. It still didn't ended on account.php.

I'm having a great Saturdayafternoon here. ;-)
  Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)