Umfragen
Main Page
Related Pages
Data Structures
Files
File List
Globals
check_login.php
Go to the documentation of this file.
1
<?php
2
3
if
( !isset($config_included) ){
4
die(
"please include configfile!"
);
5
}
6
function
redirect_to_login
(){
7
header(
"location: "
.APP_ROOT.
"/login.php"
);
8
exit();
9
}
10
11
12
function
check_login
(){
13
if
( !isset($_SESSION)){
14
session_start();
15
}
16
// PERMISSIONS !! IMPORTANT
17
if
( !isset($_SESSION[
"user"
]->is_auth) ){
18
$_SESSION[
"previous_url"
] = $_SERVER[
'PHP_SELF'
].
"?"
.$_SERVER[
'QUERY_STRING'
];
19
redirect_to_login
();
20
}
21
if
($_SESSION[
"user"
]->is_auth !==
true
){
22
$_SESSION[
"previous_url"
] = $_SERVER[
'PHP_SELF'
].
"?"
.$_SERVER[
'QUERY_STRING'
];
23
redirect_to_login
();
24
}
25
}
26
27
// ! no ending newLine
28
?>
demo
inc
check_login.php
Generated on Sat Nov 30 2013 14:28:43 for Umfragen by
1.8.1.2