Ver Mensaje Individual
  #3 (permalink)  
Antiguo 15/02/2013, 10:28
Montes28
 
Fecha de Ingreso: septiembre-2010
Mensajes: 1.853
Antigüedad: 13 años, 7 meses
Puntos: 6
Respuesta: autenticar usuarios contra Directory Active o gmail

Triby gracias por responder y se lo que dice el manual pero no me funciona.

Código HTML:
Ver original
  1. <form action="activo.php" method="post">
  2. <input name="email" type="text" />
  3. <input name="password" type="text" />
  4. <input type="submit" value="enviar" />
  5. </form>

Código PHP:
Ver original
  1. session_start(); #make sure this is at the top of your PHP file.
  2. $adServer = "172.25.1.24"; #replace with your AD server ip/hostname
  3. $ldapconn = ldap_connect($adServer)
  4. or $this->msg = "Could not connect to LDAP server.";
  5.  
  6.  
  7. $ldaprdn = $adServer . "\\" . $_POST["email"];
  8. $ldapbind = ldap_bind($ldapconn, $ldaprdn, $_POST["password"]);
  9.  
  10.  
  11. if ($ldapbind) {
  12. $msg = "Successfully Authenticated";
  13. $_SESSION['email'] = $email;
  14. $_SESSION['password'] = $password;
  15. return true;
  16. } else {
  17. $msg = "Invalid email address / password";
  18. return false;
  19. }


y obtengo este error
Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Can't contact LDAP server in C:\websites\activo\activo.php on line 9


y la linea 9 es $ldapbind = ldap_bind($ldapconn, $ldaprdn, $_POST["password"]);

nota le pregunte al administrador del DA acerca del ip y me respondio "debe configurar para que se conecte en conexión segura" a que se refiere?