Hello.
When you log into the revcms housekeeping and then say you go to the me page and then back to the housekeeping it takes you to the log in page to sign in but you don't need to you just go to dash how do i make it so it checks if you are logged in and if you are it redirects you?
Login page for hk
PHP Code:
<?php if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; }
if (!isset($_SESSION['user']['id']) || $_SESSION['user']['rank'] < 5) { header("Location: ../index"); die(); } ?>
<div id="main"> <div class="header" id="login"></div> <div id="content" class="login"> <h1>{hotelName} ASE</h1><hr/> Welcome to the {hotelName} Hotel All Seeing Eye. Your IP has been logged (<?php echo $_SERVER["REMOTE_ADDR"]; ?>) Please note if you are not an officially ranked staff member at {hotelName} Hotel, you could get into trouble for being here..
<?php if (isset($template->form->error)) { echo '<br/><br/><div class="alert alert-error" align="center">'.$template->form->error.'</div>'; } ?>
<hr/> <center> <form method="post" action="index.php?url=login"> <div id="login_username"><div id="title">Username:</div><input type="text" name="username" style="width:195px"; placeholder="Username"; autocomplete="off" /> <div id="ledenlijstpb_box" style="display:none;" > <div id="ledenlijstpb_mid"><table width='100% border='0' cellpadding='0' cellspacing='0'></table> </div></div><br /> <div id="login_password"><div id="title">Password:</div><input type="password" name="password" style="width:195px"; placeholder="Password"; autocomplete="off" /> <div id="ledenlijstpb_box" style="display:none;" > <div id="ledenlijstpb_mid"><table width='100% border='0' cellpadding='0' cellspacing='0'></table> </div></div><br /> <div id="login_pincode"><div id="title">Pin Code:</div><input type="password" name="pincode" style="width:195px"; placeholder="Pin Code"; autocomplete="off" /> <div id="ledenlijstpb_box" style="display:none;" > <div id="ledenlijstpb_mid"><table width='100% border='0' cellpadding='0' cellspacing='0'></table> </div></div><br /></br> <td></td> <td><input type="submit" value="Log into Housekeeping" name="login" /></td> </tr> </form> </center> <hr/> </div></div>