Umfragen
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'];
20  }
21  if($_SESSION["user"]->is_auth !== true){
22  $_SESSION["previous_url"] = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
24  }
25 }
26 
27 // ! no ending newLine
28 ?>