diff --git a/lam/lib/listgroups.php b/lam/lib/listgroups.php new file mode 100644 index 00000000..9b4dc07e --- /dev/null +++ b/lam/lib/listgroups.php @@ -0,0 +1,61 @@ +"; + +// Samba hosts have the attribute "sambaAccount" and end with "$" +$filter = "(objectClass=posixGroup)"; +$attrs = array("cn", "gidNumber", "memberUID", "description"); +$sr = ldap_search($_SESSION["ldap"]->server(), + $_SESSION["config"]->get_GroupSuffix(), + $filter, $attrs); +$info = ldap_get_entries($_SESSION["ldap"]->server, $sr); +ldap_free_result($sr); + +// print host table header +echo "
" . _("Grup Name") . " | "; +echo "" . _("GID Number") . " | "; +echo "" . _("Group Members") . " | "; +echo "" . _("Description") . " | "; +echo "
---|---|---|---|
" . $info[$i]["cn"][0] . " | "); + echo ("" . $info[$i]["gidnumber"][0] . " | "); + // create list of group members + array_shift($info[$i]["memberuid"]); // delete count entry + $grouplist = implode("; ", $info[$i]["memberuid"]); + echo ("" . $grouplist . " | "); + echo ("" . $info[$i]["description"][0] . " | "); + echo("