LDAP - výpis skupiny

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

"; echo "LDAP Connect ... "; if ($id = LDAP_Connect("172.16.1.6","389")): echo "ok id=$id
"; else: echo "XXX
"; endif; echo "LDAP Bind ... "; if (LDAP_Bind($id)): echo "ok
"; else: echo "XXX
"; endif; echo "LDAP Search ... "; // Attribute Map // OK : cn, sn, fullname, mail, givenName, groupMembership(pole),PwdAllowCh,PwdMinL // XXX: member, mailHost, hostServer,treeName,groupID,status, // ? : DetectIntruder, hdr, LoginDisabled, // objectClass=inetOrgPerson(=User), if ($vysledek = LDAP_Search($id,"ou=klimes,ou=pos,o=spse","sn=*",Array("cn","givenName"))): echo "ok
"; else: echo "XXX
"; endif; echo "Zpracovani :"; echo ""; $pocet=0; $x = LDAP_First_Entry($id,$vysledek); while ($x): $pocet++; $y = LDAP_Get_Attributes($id,$x); echo "
$pocet"; for ($i=0; $i<$y[count]; $i++): $attr = $y[$i]; echo "",$attr,"=",$y["$attr"][0]," "; endfor; echo "
"; $x = LDAP_Next_Entry($id,$x); endwhile; echo "
"; /* echo "LDAP Unbind ... "; if (LDAP_Unbind("$id")): echo "ok
"; else: echo "XXX
"; endif; */ echo "LDAP Close ... "; if (LDAP_Close($id)): echo "ok
"; else: echo "XXX
"; endif; ?>