The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
Is this page private? - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: General (https://userspice.com/forums/forumdisplay.php?fid=20) +--- Forum: New to UserSpice? (https://userspice.com/forums/forumdisplay.php?fid=22) +--- Thread: Is this page private? (/showthread.php?tid=400) |
Is this page private? - thenumbernine - 12-19-2016 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? Is this page private? - mudmin - 12-19-2016 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. |