Pas encore désolé, je travail dessus...
EDIT:
ça y est j'ai enfin trouvé 
je prépare un message complet et je le poste aujourd'hui...
EDIT 2:
Voici donc la procédure pour mettre en place une authentification automatique avec GLPI v0.70, Active Directory et des postes en Windows. (pour plus d'infos -> http://glpi-project.org/wiki/doku.php?i
authautoad)
Il y a donc toujours 2 fichiers à modifier, index.php et login.php :
index.php
CHERCHER :
if (!empty($CFG_GLPI["cas_host"])&&!isset($_GET["noCAS"])) {
glpi_header("login.php");
}
AJOUTER APRES :
// Authentification Automatique HTTP
if (isset($_SERVER["REMOTE_USER"])) {
$pos = stripos($_SERVER["REMOTE_USER"],"\\");
if (!$pos === false) {
$login = substr($_SERVER["REMOTE_USER"], $pos + 1);
if ($login != '') {
header("Location: login.php?login_name=".$login);
}
}
}
login.php
CHERCHER :
if (isset ($_POST['login_password'])) {
$_POST['login_password'] = unclean_cross_side_scripting_deep($_POST['login_password']);
}
REMPLACER PAR :
if (isset ($_POST['login_password'])) {
$http_auth = false;
$_POST['login_password'] = unclean_cross_side_scripting_deep($_POST['login_password']);
}
elseif (!isset($_POST['login_password']) && isset($_SERVER["REMOTE_USER"])) {
$http_auth = false;
$pos = stripos($_SERVER["REMOTE_USER"],"\\");
if (!$pos === false) {
$login = substr($_SERVER["REMOTE_USER"], $pos + 1);
if ($login != '') {
$_POST['login_name'] = $login;
$http_auth = true;
}
}
}
CHERCHER :
if (empty ($_POST['login_name']) || empty ($_POST['login_password'])) {
$identificat->addToError($LANG["login"][8]);
REMPLACER PAR :
if ((empty($_POST['login_name']) || empty($_POST['login_password'])) && !$http_auth){
$identificat->addToError($LANG["login"][8]);
CHERCHER :
// exists=0 -> no exist
// exists=1 -> exist with password
// exists=2 -> exist without password
$exists = $identificat->userExists($_POST['login_name']);
// Pas en premier car sinon on ne fait pas le blankpassword
// First try to connect via le DATABASE
if ($exists == 1) {
REMPLACER PAR :
// exists=0 -> no exist
// exists=1 -> exist with password
// exists=2 -> exist without password
$exists = $identificat->userExists($_POST['login_name']);
// Authentification Automatique HTTP
if ($http_auth && $exists == 2) {
$identificat->user->getFromDBbyName(addslashes($_POST['login_name']));
$config_ldap = $identificat->auth_methods["ldap"][$identificat->user->fields["id_auth"]];
//Connect to the directory
$ds = connect_ldap($config_ldap['ldap_host'], $config_ldap['ldap_port'], $config_ldap['ldap_rootdn'], $config_ldap['ldap_pass'], $config_ldap['ldap_use_tls']);
$user_dn = ldap_search_user_dn($ds, $config_ldap['ldap_basedn'], $config_ldap['ldap_login'], stripslashes($_POST['login_name']), $config_ldap['ldap_condition']);
if ($user_dn != false) {
$identificat->auth_succeded = true;
}
}
// Pas en premier car sinon on ne fait pas le blankpassword
// First try to connect via le DATABASE
elseif ($exists == 1) {
Voilà, normalement ça devrait fonctionner...
Last edited by Met@lnono (2008-05-18 22:22:38)
OCS Inventory NG: v1.02.1 / GLPI: v0.72.3
Server OS: Microsoft Windows Server 2003 Standard Edition
Server Hardware: bi-processeur Intel(R) Pentium(R) XEON 2.8GHz / 4096 MB RAM / RAID 5
Inventoried computers: 270