[ Index ]
 

Code source de SPIP 1.9.2c

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/ecrire/install/ -> etape_ldap3.php (source)

   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_ldap3
  15  function install_etape_ldap3_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();
  20  
  21      echo info_etape(_T('info_chemin_acces_1'),_T('info_chemin_acces_2'));
  22  
  23      $ldap_link = @ldap_connect("$adresse_ldap", "$port_ldap");
  24      @ldap_bind($ldap_link, "$login_ldap", "$pass_ldap");
  25  
  26      $result = @ldap_read($ldap_link, "", "objectclass=*", array("namingContexts"));
  27      $info = @ldap_get_entries($ldap_link, $result);
  28  
  29      echo generer_url_post_ecrire('install');
  30      echo "<input type='hidden' name='etape' value='ldap4' />";
  31      echo "<input type='hidden' name='adresse_ldap' value=\"$adresse_ldap\" />";
  32      echo "<input type='hidden' name='port_ldap' value=\"$port_ldap\" />";
  33      echo "<input type='hidden' name='login_ldap' value=\"$login_ldap\" />";
  34      echo "<input type='hidden' name='pass_ldap' value=\"$pass_ldap\" />";
  35      echo "<input type='hidden' name='protocole_ldap' value=\"$protocole_ldap\" />";
  36      echo "<input type='hidden' name='tls_ldap' value=\"$tls_ldap\" />";
  37  
  38      echo "<fieldset>";
  39  
  40      $checked = false;
  41  
  42      if (is_array($info) AND $info["count"] > 0) {
  43          echo "<p>"._T('info_selection_chemin_acces')."</p>";
  44          echo "<ul>";
  45          $n = 0;
  46          for ($i = 0; $i < $info["count"]; $i++) {
  47              $names = $info[$i]["namingcontexts"];
  48              if (is_array($names)) {
  49                  for ($j = 0; $j < $names["count"]; $j++) {
  50                      $n++;
  51                      echo "<li><input name=\"base_ldap\" value=\"".htmlspecialchars($names[$j])."\" type='radio' id='tab$n'";
  52                      if (!$checked) {
  53                          echo " checked=\"checked\"";
  54                          $checked = true;
  55                      }
  56                      echo " />";
  57                      echo "<label for='tab$n'>".htmlspecialchars($names[$j])."</label></li>\n";
  58                  }
  59              }
  60          }
  61          echo "</ul>";
  62          echo _T('info_ou')." ";
  63      }
  64      echo "<input name=\"base_ldap\" value=\"\" type='radio' id='manuel'";
  65      if (!$checked) {
  66          echo " checked=\"checked\"";
  67          $checked = true;
  68      }
  69      echo " />";
  70      echo "<label for='manuel'>"._T('entree_chemin_acces')."</label> ";
  71      echo "<input type='text' name='base_ldap_text' class='formo' value=\"ou=users, dc=mon-domaine, dc=com\" size='40' />";
  72      echo "</fieldset>";
  73  
  74      echo bouton_suivant();
  75      echo "</form>";
  76  
  77      echo install_fin_html();
  78  }
  79  
  80  
  81  ?>


Généré le : Wed Nov 21 10:20:27 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics