witam
walczę już od kilku dni i nie daje rady
mam taki bład:
Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Invalid credentials in E:\WebServ\httpd-users\test1\ad_add4.php on line 22
Failed!
<?php
// mojanazwa.pl
$LDAPSERVER = "192.168.0.122";
$USER_OU="ou=user,dc=mojanazwa,dc=pl";
$loggin = False;
$ldap = ldap_connect
($LDAPSERVER) or
die("Could not connect to ldapserver");
$username = 'tutaj wpisuję login administratora domeny';
$password = 'tutaj wpisuję hasło administratora domeny';
{
echo "No username/password entered..."; }
$dn = "uid=" . $username . "," . $USER_OU;
$loggedin = ldap_bind($ldap,$dn,$password);
if ( $loggedin ){
$info["dn"] = "uid=jjhons,ou=User,dc=swteam,dc=local";
$info["uid"] = "jjhons";
$info["cn"] = "people";
$info["objectclass"] = "account";
$info["objectclass"] = "posixAccount";
$info["objectclass"] = "top";
$info["objectclass"] = "shadowAccount";
$info["userPassword"] = "jjhons";
$info["shadowLastChange"] = "13048";
$info["shadowMax"] = "99999";
$info["shadowWarning"] = "7";
$info["loginShell"] = "/bin/bash";
$info["uidNumber"] = "500";
$info["gidNumber"] = "500";
$info["homeDirectory"] = "home/jjhons";
$info["gecos"] = "jjhons";
$info["sn"] = "jjhons";
$info["mail"] = "jonj@example.com";
// add data to directory
$r = ldap_add($ldap, $dn, $info);
}
else
{
}
ldap_close($ldap);
?>
Proszę o pomoc