LDAP - read,modify

",Date("H:i:s",Time()),"

"; echo "LDAP Connect ... "; if ($id = LDAP_Connect("172.16.1.6","389")) echo "ok id=$id
"; else echo "XXX
"; $heslo="1pepan1"; echo "LDAP Bind ... "; if (LDAP_Bind($id,"cn=_klimes,ou=z,o=SPSE",$heslo)) echo "ok
"; else echo "XXX
"; echo "LDAP Search (LDAP_Read mi nejde) ... "; //if ($vysledek = LDAP_Search($id,"ou=z,o=spse","sn=_klimes",Array("sn","fullname","givenname","cn","title", if ($vysledek = LDAP_Search($id,"cn=anika,ou=klimes,ou=pos,o=spse","cn=*",Array("sn","fullname","givenname","cn","title", "uid","homeDirectory","loginShell","guid","ndsHomeDirectory","uidNum", "description","oguid","gidNum","telephone","initials","generationQualifier"))) echo "ok vysledek=$vysledek
"; else echo "XXX
"; echo "

"; // $x = LDAP_Get_Values($id,$vysledek,"gidNum"); $x = LDAP_First_Entry($id,$vysledek); echo "x=$x
"; $y = LDAP_Get_Attributes($id,$x); echo "y=$y
"; for ($i=0;$i<=15;$i++) echo "$i=$y[$i] "; echo "
"; echo "y[cn][0]=".$y[cn][0]."
"; echo "y[givenname][0]=".$y["givenname"][0]."
"; echo "y[sn][0]=".$y["sn"][0]."
"; echo "y[fullname][0]=".$y["fullname"][0]."
"; echo "y[title]: ".$y['title'][0]." ".$y['title'][1]." ".$y['title'][2]." ".$y['title'][3]."
"; echo "y[uid][0]=".$y["uid"][0]."
"; echo "y[homeDirectory][0]=".$y["homeDirectory"][0]."
"; echo "y[loginShell][0]=".$y["loginShell"][0]."
"; echo "y[guid][0]=".$y["guid"][0]."
"; echo "y[ndsHomeDirectory][0]=".$y["ndsHomeDirectory"][0]."
"; echo "y[uidNum][0]=".$y["uidNum"][0]."
"; echo "y[gidNum][0]=".$y["gidNum"][0]."
"; echo "y[description][0]=".$y["description"][0]."
"; echo "y[initials][0]=".$y["initials"][0]."
"; echo "y[generationQualifier][0]=".$y["generationQualifier"][0]."
"; echo "
"; echo "LDAP Modify ... "; $zmena["generationQualifier"] = $y["generationQualifier"][0]+1; if ($vysledek = LDAP_Modify($id,"cn=anika,ou=klimes,ou=pos,o=spse",$zmena)) echo "ok
"; else echo "XXX
"; echo "
"; /* echo "LDAP Unbind ... "; if (LDAP_Unbind($id)) echo "ok
"; else echo "XXX
"; */ echo "LDAP Close ... "; if (LDAP_Close($id)) echo "ok
"; else echo "XXX
"; ?>