1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| <?php
//============================================================
// PARAMETRES DE CONFIGURATION
//============================================================
$cfg['adm_login'] = 'admin'; // Le login d'administrateur
$cfg['adm_pass'] = 'pass'; // Le mot de passe d'administrateur
//============================================================
// FORMULAIRE ET TEST D'AUTHENTIFICATION
//============================================================
if((!isset($_SERVER['PHP_AUTH_USER']) ||
!isset($_SERVER['PHP_AUTH_PW'])) &&
preg_match('/Basic\s+(.*)$/i',$_SERVER['REMOTE_USER'],$matches)){
list($name,$pass)=explode(':',base64_decode($matches[1]));
$_SERVER['PHP_AUTH_USER']=strip_tags($name);
$_SERVER['PHP_AUTH_PW']=strip_tags($pass);
}
if($_SERVER['PHP_AUTH_USER']!=$cfg['adm_login'] ||
$_SERVER['PHP_AUTH_PW']!=$cfg['adm_pass']){
header('WWW-Authenticate: Basic realm="Connexion..."');
header('HTTP/1.0 401 Unauthorized');
die('Erreur : Identification incorrecte !');
}
//============================================================
// AUTHENTIFICATION ACCEPTEE
//============================================================
echo 'Authentification acceptée.';
//============================================================
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Lunnatick</title>
<style type="text/css">
<!--
.Style1 {
font-size: xx-large;
font-weight: bold;
color: #0099FF;
}
-->
</style>
</head>
<body bgcolor="#000066" text="#339933" link="#33FF00" vlink="#666666" alink="#666600">
<div align="center" class="Style1">
<p>Site bientot tansféré </p>
<p><img src="lunnatick.jpg" width="454" height="454"></p>
</div>
</body>
</html> |