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
account.php - 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: account.php (/showthread.php?tid=493)

Pages: 1 2


account.php - nessinits - 03-09-2017

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


account.php - mudmin - 03-09-2017

Yep. Go to usersc/scripts/custom_login_script.php
You can edit wherever your user goes after login.


account.php - nessinits - 03-10-2017

Thanks for the answer, but I've changed it into
Redirect::to($us_url_root."/");

But it doesn't work.


account.php - mudmin - 03-10-2017

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.



account.php - nessinits - 03-11-2017

Nope, still doesn't have any effect and I'm really working with a clean install.


account.php - nessinits - 03-11-2017

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>



account.php - mudmin - 03-11-2017

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.


account.php - nessinits - 03-11-2017

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. ;-)


account.php - mudmin - 03-11-2017

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.



account.php - nessinits - 03-11-2017

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. ;-)