Je dispose d'un intranet sous Apache (debian) en php.
Mes utilisateur s'authentifie avec cette page:
<?php session_start();
include ("php/fonction.bdd.php");
include ("php/fonction.site.php");
$ua = $_SERVER['HTTP_USER_AGENT'];
//echo '<br/>>>>>>>>>>>>> '.$ua.'<<<<<<<<<<<<<<<<<<br/>';
if (preg_match('/\bmsie 6/i', $ua) && !preg_match('/\bopera/i', $ua))
{
<br/><br/><br/><br/><br/><br/>
Cordialement";
}
else
{
If(isset($_POST['mdp']) && isset($_POST['login']))
{
function stripgpc($value) {
if(get_magic_quotes_gpc()) $value = stripslashes($value);
return $value;
}
$mdp = isset($_POST['mdp']) ? (stripgpc($_POST['mdp'])) : '';
$login = isset($_POST['login']) ? stripgpc($_POST['login']) : '';
//echo $mdp;
//echo $login;
if(!empty($mdp) && !empty($login))
{
connexion_mysql();
$resultat= auth_ad_php("1555555");
//$resultat=1;
if($resultat==1)
{
$selection = sprintf("select * FROM users WHERE users_disabled='0' AND login ='%s'",mysql_real_escape_string($login));
//echo "select * FROM users WHERE users_disabled='0' AND login ='%s'";
$query = mysql_query($selection) or die(mysql_error());
$total_reponse = mysql_num_rows($query);
$field = mysql_num_fields($query );
$totalReponse = mysql_fetch_array($query);
if ($total_reponse == 1 )
{
for ( $i = 0; $i < $field; $i++ )
{
$_SESSION[mysql_field_name($query, $i)] = $totalReponse[$i];
}
print_r($_SESSION);
header("Location: index.php");
exit();
}
else
{
header("Location: index.php");
exit();
}
}
else
{
echo 'kkkkkkkkkkkkkkkkkkkk';
header("Location: index.php");
exit();
}
}
else
{
$message = 'login ou mot de passe manquant';
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Intranet Groupe Amplitude</title>
<link rel="shortcut icon" type="image/png" href="img/favicon.png" />
<link rel="stylesheet" type="text/css" href="css/site.css" media="screen" />
<link href="http://fonts.googleapis.com/css?family=Loved by the King" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="conteneur">
<h1 id="header"><a href="index.php"></a></h1>
<?php
if(!isset($_SESSION['login']) OR !isset($_SESSION['id_users']))
{
echo '
<form method="post" action="index.php">
<table id="login">
<tr><td colspan="2" align="left"><img src="img/identifiant.png" alt="ico" style="font-size: 12px;"/> IDENTIFIANT DE CONNEXION </td></tr>
<tr><td><input type="text" name="login" maxlength="32" size="26" value=" login" class="gris" onfocus="javascript:this.value=\'\';"/></td><td><input type="password" name="mdp" size="26" maxlength="32" value=" Mot de passe" onfocus="javascript:this.value=\'\';" class="gris"/></td></tr>
<tr><td colspan="2" align="right"><input type="image" src="img/valider.png" alt="Envoyer" name="validation" onclick="submit"/></td></tr>
</table>
</form>';
}
else
{
echo ' <table id="login"><tr><td>Bienvenue: '.$_SESSION["nom"].' '.$_SESSION["prenom"].'</td></tr></table>';
}
?>
<div id="contenu"> <span class="policeLovedbytheKing" >BIENVENUE SUR L INTRANET GROUPE AMPLITUDE</span><br/>
<?php
if(isset($_SESSION['login']) ) {
if($_SESSION["bc_application"]==1) { echo '<p><img src="img/file.png" alt="ok" /><a href="bc/index.php"> Accès à l\'application Bon de Commande </a></p>';}
if($_SESSION["f_application"]==1) { echo '<p><img src="img/file.png" alt="ok" /><a href="f/index.php"> Accès à l\'application "Facture" </a></p>';}
if($_SESSION["rh_application"]==1) { echo '<p><img src="img/file.png" alt="ok" /><a href="rh/index.php"> application RH </a></p>';}
if($_SESSION["com_application"]==1) { echo '<p><img src="img/file.png" alt="ok" /><a href="com/index.php"> application Commerciale </a></p>';}
}
else
{
echo '<p>veuillez vous identifier pour accerder aux applications extranet</p>';
}
?>
</div>
</div>
<div id="footer"> <?php footer(); ?> <a href="fichiers/"> fichiers </a> </div>
</body>
</html>
<?php
//print_r($_SESSION);
//foreach($_POST as $key => $val) echo '$_POST["'.$key.'"]='.$val.'<br />';
}
?>
les utilisateurs s'authentifie avec ceci:
Code : Tout sélectionner
auth_ad_php("10.22.55.44",$login,$mdp,"@local.lan");Je voudrais savoir si il y a un moyen de faire du SSO? la personne ouvre la page depuis Internet explorer il récupère l'information pour s'authentifie l'utilisateur sur le poste en question et vérifie ces informations dans AD ...
Est-ce réalisable ?
Merci d'avance pour votre aide
guigui69