ldap server can not replace the order of login, why?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

$ldaprdn="uid=root, ou=People, dc=aitc, dc=com, dc=tw";

        echo "connect to ".$ldapServer." successfully \n<br>";
      echo "can't connect to LDAP server!\n<br>";
   if ($ldapconn) {
      // binding to ldap server to give update access
      $ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);
      // verify binding
      if ($ldapbind) {
          echo "LDAP binding successful...\n";
      } else {
          echo "LDAP binding failed...\n";
   //data preparation
   //I am not very sure what attribute should be filled
   $data["cn"]="Tester 1";
   $data["gecos"]="Tester 1";
   // Before ldap_add(), should check the user already exists or not
   if(!ldap_add($ldapconn,"uid=tester, ou=People, dc=aitc, dc=com,
dc=tw", $data)){
     echo "There is a problem to create the account\n";
     echo "Please contact your administrator!\n";
     echo "account creation successfully";

I used ldapbrowser to connect LDAP server(openldap), and I can see all
the user&#65292;but I can not Add Entry&#65292;but I can Delete Entry
Then I wrote the php code above to add a new user tester&#65288;the
$data fields are all the fields of LDAP, but some fields were filled
by me randomly&#65292;like uidnumber&#21644;gidnumber&#65289;, but if
I do not fill those fields, it will occurs the following warning

Warning: ldap_add(): Add: Object class violation in
p on line 74
There is a problem to create the account
Please contact your administrator!

But I found the biggest problem is : my ldap server can not replace
the login order, i.e, I want to build accounts/passwords in openldap
server, then users can use the account/password in ldap server and
login freebsd server. But when I use the above php code to create a
tester account, the user "tester" still can not use tester/tester to
login freebsd host, why? Could you tell me.

Thanks in advanced.


Site Timeline