Guest User

Untitled

a guest
Sep 20th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. # Dados do servidor
  2. $server = '192.168.0.1';
  3. $domain = '@meudominio.dom';
  4. $port = 389;
  5.  
  6. # Dados para acesso
  7. $auth_user = 'rbz';
  8. $auth_pass = '123';
  9.  
  10. # Criando conexão
  11. $ldap_conn = ldap_connect($server, $port) or exit('Erro na conexão');
  12. if (!$ldap_conn) exit('Falha na conexão');
  13.  
  14. # Bind
  15. $bind = @ldap_bind($ldap_conn, $auth_user.$domain, $auth_pass) or exit("Erro em bind");
  16. if (!$bind) exit('Usuário e/ou senha incorreto(s)!');
Add Comment
Please, Sign In to add comment