LDAP pokusy

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

"; //$heslo="1pepan1"; //$heslo=$_POST["password"]; //echo "heslo=$heslo
"; //echo "LDAP Connect ... "; //if ($id = LDAP_Connect("172.16.1.5","389")) echo "ok id=$id
"; //else echo "XXX
"; echo "LDAP Connect ... ".( ($id = LDAP_Connect("172.16.1.5","389")) ? "ok id=$id" : "XXX" )."
"; echo "LDAP Bind ... ".( (LDAP_Bind($id,"cn=klimes99,ou=z,o=SPSE",$heslo)) ? "ok" : "XXX" )."
"; echo "LDAP List (zatim nevim k cemu)... ". ( ($vysledek = LDAP_List($id,"ou=u,o=spse","sn=v*",Array("cn"))) ? "ok" : "XXX" )."
"; echo "LDAP Search ... "; if ($vysledek = LDAP_Search($id,"ou=klimes99,ou=z,o=spse","sn=*",Array("sn","fullname","givenname","cn","title", "uid","homeDirectory","loginShell","guid","ndsHomeDirectory","uidNum", "description","gidNum","telephone","initials","generationQualifier","LoginScript"))) echo "ok
"; else echo "XXX
"; echo "
Zpracovani :
"; $x = LDAP_First_Entry($id,$vysledek); // echo "x=$x
"; while ($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[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 "y[LoginScript][0]='".$y["LoginScript"][0]."'
"; echo "
"; //echo "LDAP_N_E ... "; $x = LDAP_Next_Entry($id,$x); echo "
"; //echo "x=$x"; } echo "
"; /* echo "LDAP Unbind ... "; if (LDAP_Unbind("$id")): echo "ok
"; else: echo "XXX
"; endif; */ echo "LDAP Close ... ".( (LDAP_Close($id)) ? "ok" : "XXX" )."
"; ?>