backoffice/html/network/index.php
2011-06-21 13:28:10 +00:00

63 lines
1.7 KiB
PHP

<?
/**
* Inclusion du fichier de configuration des includes Métiers de S&D
*/
include '/var/www/includes/config.php';
/**
* Inclusion du Framework
*/
if( !defined('FWK_PATH') )
include '/var/www/framework/fwk.php';
$t1=microtime_float();
include_once(INCLUDE_PATH.'insee/classMInsee.php');
include_once(INCLUDE_PATH.'bodacc/classMBodacc.php');
include_once(FWK_PATH.'common/dates.php');
$iDb=new WDB('jo');
$iDb2=new WDB('sdv1');
session_start();
$tabSirenPC=array();
$authorized = false;
if(isset($_GET['logout']) && ($_SESSION['auth'])) {
$_SESSION['auth'] = null;
session_destroy();
echo "logging out...";
}
if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
$user=addslashes(trim($_SERVER['PHP_AUTH_USER']));
$pwd =addslashes(trim($_SERVER['PHP_AUTH_PW']));
$tabTmp=$iDb2->select( 'utilisateurs',
'id, email',
"login='$user' AND password='$pwd' AND idClient=1 AND actif=1 AND deleted=0");
$_SESSION['userId']=$tabTmp[0][0];
$_SESSION['userMail']=$tabTmp[0][1];
if ( $_SESSION['userId'] ) {//&& $_SESSION['auth']) {
$authorized = true;
}
} else {
//if (isset($_GET["login"]) && (! $authorized)) {
header('WWW-Authenticate: Basic Realm="Login please"');
header('HTTP/1.0 401 Unauthorized');
$_SESSION['auth'] = true;
print('Login now or forever hold your clicks...');
exit;
}
if (!$authorized) {
?><h1>you have <? echo ($authorized) ? '' : 'not'; ?> logged!</h1><?
die();
}
?>
<h3>SALLE MACHINE PARIS</h3>
<a href="./armoire_reseau_paris.pdf">Armoire réseau</a><br/>
<a href="./armoire_serveur1_paris.pdf">Armoire serveur 1 (Petite)</a><br/>
<a href="./armoire_serveur2_paris.pdf">Armoire serveur 2 (Grande)</a><br/>