Active Directory/Connect: Difference between revisions

Content added Content deleted
m (Omitting MIPS assembly)
No edit summary
Line 19: Line 19:
$ldap = ldap_connect($hostname, $port);
$ldap = ldap_connect($hostname, $port);
$success = ldap_bind($ldap, $username, $password);</lang>
$success = ldap_bind($ldap, $username, $password);</lang>

=={{header|Python}}==
{{works with|Python|2.6}}
{{libheader|python-ldap}}

<lang python>import ldap

l = ldap.initialize("ldap://server")
try:
l.protocol_version = ldap.VERSION3
l.set_option(ldap.OPT_REFERRALS, 0)

bind = l.simple_bind_s("me@domain.com", "password")
finally:
l.unbind()
</lang>

Output:
<pre>
(1, 2, 3)
(1, 3, 2)
(2, 1, 3)
(2, 3, 1)
(3, 1, 2)
(3, 2, 1)
</pre>


=={{header|Ruby}}==
=={{header|Ruby}}==