Skip to content

Instantly share code, notes, and snippets.

@Nasawa
Created May 21, 2014 05:04
Show Gist options
  • Save Nasawa/a6665e19be669f3364cd to your computer and use it in GitHub Desktop.
Save Nasawa/a6665e19be669f3364cd to your computer and use it in GitHub Desktop.
Just some auth / injection stuff
<?
if ($login)
{
$id = $_SESSION['user'];
if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 3600))
{
// last request was more than 30 minutes ago
session_unset(); // unset $_SESSION variable for the run-time
session_destroy(); // destroy session data in storage
?>
<script type='text/javascript'>
/*Authentication*/
</script>
<?
}
$_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp
?>
<script type='text/javascript'>
/*Authentication*/
</script>
<?
}
//-----------------------------HEADER---------------------------
echo (file_get_contents("partial/header.html",false,null,3));
//-----------------------------MANAGER ADD----------------------
if ($_SESSION['type'] == "Manager")
echo (file_get_contents("partial/manageradd.html",false,null,3));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment