mirror of
https://github.com/pierre42100/comunic
synced 2025-07-12 04:52:58 +00:00
First commit
This commit is contained in:
24
inc/core/system/checkAllowedHost.inc.php
Normal file
24
inc/core/system/checkAllowedHost.inc.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is useful to check we are
|
||||
* on an allowed host for Comunic
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
isset($_SESSION) OR exit("Invalid call - ".$_SERVER['PHP_SELF']);
|
||||
|
||||
/**
|
||||
* Getting list of allowed host
|
||||
*/
|
||||
include(websiteRelativePath("inc/config/listAllowedHosts.inc.php"));
|
||||
|
||||
/**
|
||||
* Performing security check
|
||||
*/
|
||||
if(!in_array($_SERVER['HTTP_HOST'], $liste_allowed_hosts))
|
||||
{
|
||||
//On redirige vers l'URL du site
|
||||
header('location: '.$urlsite);
|
||||
}
|
||||
|
Reference in New Issue
Block a user