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
Is this page private?
#1
I'm trying to do a conditional redirect after the user logs in. Essentially, if the page that referred the user to the login form is private, redirect them there after logging in. If they were referred from somewhere else, redirect them to the main account screen. But I haven't found in the documentation the method for determining whether or not a page is private. Any suggestions?
  Reply
#2
Well, you're the first person that has ever asked that. I've been thinking about your problem and I think the best way to handle it is with a $_GET variable. What I would do is something like this...

On each of the referring pages that are pointing you to the login page, I would make your link something like

...the rest of the link /users/login.php?code=1234
(or if you know where the site is you could do https://mydomain.com/users/login.php?code=1234)

And then if you want them to go somewhere else, you could do
/users/login.php?code=5678

Then, I would go to usersc/scripts/custom_login_script.php and I would do something like this...
http://pastebin.com/vgnewtna

Now obviously that's just a framework of how to do the redirects. There's a lot you could do from there. You could have that link auto-generated by querying the database...you could use the securePage function to do the check for you. My main thought is that people don't usually change whether or not a page is private very often, so you should just be able to put the link there statically.

  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)