[ Index ] |
|
Code source de SPIP 1.9.2c |
1 <?php 2 3 /***************************************************************************\ 4 * SPIP, Systeme de publication pour l'internet * 5 * * 6 * Copyright (c) 2001-2007 * 7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * 8 * * 9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * 10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * 11 \***************************************************************************/ 12 13 14 // http://doc.spip.org/@inc_install_ldap2 15 function install_etape_ldap2_dist() 16 { 17 global $adresse_ldap, $login_ldap, $pass_ldap, $port_ldap, $tls_ldap, $protocole_ldap, $spip_lang_right; 18 19 echo install_debut_html('AUTO', ' onLoad="document.getElementById(\'suivant\').focus();return false;"'); 20 21 $port_ldap = intval($port_ldap); 22 $ldap_link = @ldap_connect($adresse_ldap, $port_ldap); 23 $erreur = "ldap_connect($adresse_ldap, $port_ldap)"; 24 25 if ($ldap_link) { 26 if ( !@ldap_set_option($ldap_link, LDAP_OPT_PROTOCOL_VERSION, $protocole_ldap) ) { 27 $protocole_ldap = 2 ; 28 @ldap_set_option($ldap_link, LDAP_OPT_PROTOCOL_VERSION, $protocole_ldap); 29 } 30 if ($tls_ldap == 'oui') { 31 if (!@ldap_start_tls($ldap_link)) { 32 $erreur = "ldap_start_tls($ldap_link) $adresse_ldap, $port_ldap"; 33 $ldap_link = false; 34 } 35 } 36 if ($ldap_link) { 37 $ldap_link = @ldap_bind($ldap_link, $login_ldap, $pass_ldap); 38 $erreur = "ldap_bind('$ldap_link', '$login_ldap', '$pass_ldap'): $adresse_ldap, $port_ldap"; 39 } 40 } 41 42 if ($ldap_link) { 43 echo info_etape(_T('titre_connexion_ldap'),_T('info_connexion_ldap_ok')); 44 45 echo generer_url_post_ecrire('install'); 46 echo "<input type='hidden' name='etape' value='ldap3' />"; 47 echo "<input type='hidden' name='adresse_ldap' value=\"$adresse_ldap\" />"; 48 echo "<input type='hidden' name='port_ldap' value=\"$port_ldap\" />"; 49 echo "<input type='hidden' name='login_ldap' value=\"$login_ldap\" />"; 50 echo "<input type='hidden' name='pass_ldap' value=\"$pass_ldap\" />"; 51 echo "<input type='hidden' name='protocole_ldap' value=\"$protocole_ldap\" />"; 52 echo "<input type='hidden' name='tls_ldap' value=\"$tls_ldap\" />"; 53 54 echo bouton_suivant(); 55 echo "</form>"; 56 } 57 else { 58 echo info_etape(_T('titre_connexion_ldap'), 59 _T('avis_connexion_ldap_echec_1'). 60 "<p>"._T('avis_connexion_ldap_echec_2'). 61 "<br />\n"._T('avis_connexion_ldap_echec_3') . 62 '<br /><br />'. $erreur. '<b> ?</b></p>' 63 ); 64 } 65 66 echo install_fin_html(); 67 } 68 69 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Wed Nov 21 10:20:27 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |