-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathauth_head.php
37 lines (32 loc) · 979 Bytes
/
auth_head.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
include("data/config.inc.php");
require('functions.php');
session_start();
// Call this function so your page
// can access session variables
$logout=@$_GET['logout'];
$username=$_SESSION['username'];
if($logout == 1)
{
if (isset($_COOKIE['sso']))
{
$dbc =newDbc();
mysql_select_db(DB_NAME, $dbc);
$query = "delete from cookie where sso='".$_COOKIE['sso']."'";
$result=mysql_query($query);
}
setcookie("sso", "", time()-3600);
$_SESSION['loggedin']=0;
$_SESSION['addInfo'] = 0;
}
$url=$_SERVER['PHP_SELF'];
if ($_SESSION['loggedin'] != 1) {
// If the 'loggedin' session variable
// is not equal to 1, then you must
// not let the user see the page.
// So, we'll redirect them to the
// login page (login.php).
header("Location: ../login.php?url=".$url);
exit;
}
?>