Created
September 25, 2015 11:19
-
-
Save blizzz/8bb7146ef69f0132a3d9 to your computer and use it in GitHub Desktop.
PHP script that add's an email to an LDAP user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dn = 'uid=zombie27755,ou=zombies,dc=owncloud,dc=bzoc'; | |
$adn = 'uid=owncloudagent,ou=Users,dc=owncloud,dc=bzoc'; | |
$apwd = '*******'; | |
$mail = '[email protected]'; | |
$host = 'ldap.owncloud.bzoc'; | |
$port = 389; | |
$kv = array('mail' => $mail); | |
$cr = ldap_connect($host, $port); | |
ldap_set_option($cr, LDAP_OPT_PROTOCOL_VERSION, 3); | |
ldap_bind($cr, $adn, $apwd); | |
ldap_mod_add($cr, $dn, $kv); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment