From 5ddc454ff3a1c66d98259968e6185bc67620e342 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Thu, 20 Mar 2003 18:08:05 +0000 Subject: [PATCH] added host list --- lam/lib/listhosts.php | 53 +++++++++++++++++++++++++++++++++++ lam/templates/main_header.php | 4 +-- 2 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 lam/lib/listhosts.php diff --git a/lam/lib/listhosts.php b/lam/lib/listhosts.php new file mode 100644 index 00000000..3414c514 --- /dev/null +++ b/lam/lib/listhosts.php @@ -0,0 +1,53 @@ +"; + +// Samba hosts have the attribute "sambaAccount" and end with "$" +$filter = "(&(objectClass=sambaAccount) (uid=*$))"; +$attrs = array("cn", "rid"); +$sr = ldap_search($_SESSION["ldap"]->server(), + $_SESSION["config"]->get_HostSuffix(), + $filter, $attrs); +$info = ldap_get_entries($_SESSION["ldap"]->server, $sr); +ldap_free_result($sr); + +// print host table +echo "\n"; +echo ""; +echo ""; +echo ""; +echo ""; +for ($i = 0; $i < sizeof($info); $i++) { + echo(""); + echo (""); + echo (""); + echo(""); +} +echo ("
" . _("Host Name") . "RID
" . $info["cn"][$i] . "" . $info["rid"][$i] . "
"); +?> \ No newline at end of file diff --git a/lam/templates/main_header.php b/lam/templates/main_header.php index 9ad2f441..43629049 100644 --- a/lam/templates/main_header.php +++ b/lam/templates/main_header.php @@ -39,8 +39,8 @@ $Id$ - - + +