09-13-2016, 01:59 AM
Thanks for the quick reply.
I'm close to to getting a good solution working.
I'm setting a Session variable using
This variable is set on the private page I'm sending in an email. That piece of code is near the top of the page, just after require init.php, but before require header.
This allows the variable to be set, but the user still has to login to view the page.
After testing, it does look like the variable is being set correctly.
I'm now trying to send the user to that page in the custom_login_script.php but it's not working. The user just stays on an empty page after login.
This is what I have so Far
I tried doing the following in my custom login script and directly in my login page:
<pre></pre>
Translating this code:
I have three levels of permissions
1 = user
2 = member
3 = Administrator
If person is a user take them to mainhomepage.php
If person is a member or admin take them to userhome.php
If person is a member or admin and they clicked on my emailed link, send them to the emailed link
Thanks for taking the time to read my notes!!
I'm close to to getting a good solution working.
I'm setting a Session variable using
Code:
$_SESSION['actual_link'] = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
This variable is set on the private page I'm sending in an email. That piece of code is near the top of the page, just after require init.php, but before require header.
This allows the variable to be set, but the user still has to login to view the page.
After testing, it does look like the variable is being set correctly.
I'm now trying to send the user to that page in the custom_login_script.php but it's not working. The user just stays on an empty page after login.
This is what I have so Far
Code:
"User clicks on link to page_1 -> page_1 sets var to http://page_1 -> User is directed to login page -> User stays on a limbo page"
I tried doing the following in my custom login script and directly in my login page:
<pre>
Code:
if($user->data()->permissions !='2' || $user->data()->permissions !='3')
{
if ($_SESSION['actual_link'] !=NULL){Redirect::to($_SESSION['actual_link'])}
}
{ Redirect::to('userhome.php'); }
else{header( 'Location: mainhomepage.php' );}
Translating this code:
I have three levels of permissions
1 = user
2 = member
3 = Administrator
If person is a user take them to mainhomepage.php
If person is a member or admin take them to userhome.php
If person is a member or admin and they clicked on my emailed link, send them to the emailed link
Thanks for taking the time to read my notes!!