× 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?
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?
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

Then, I would go to usersc/scripts/custom_login_script.php and I would do something like this...

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.


Forum Jump:

Users browsing this thread: 1 Guest(s)