diff --git a/lam/templates/lists/listgroups.php b/lam/templates/lists/listgroups.php index ba97ed70..890d6006 100644 --- a/lam/templates/lists/listgroups.php +++ b/lam/templates/lists/listgroups.php @@ -27,6 +27,7 @@ include_once ("../../lib/ldap.inc"); include_once ("../../lib/status.inc"); include_once("../../lib/account.inc"); include_once("../../lib/pdf.inc"); +include_once("../../lib/modules.inc"); // start session session_save_path("../../sess"); @@ -145,8 +146,8 @@ for ($k = 0; $k < sizeof($desc_array); $k++) { if (! $_GET['norefresh']) { // configure search filter - // Groups have the attribute "posixGroup" - $filter = "(&(objectClass=posixGroup)"; + $module_filter = get_ldap_filter("group"); // basic filter is provided by modules + $filter = "(&" . $module_filter; for ($k = 0; $k < sizeof($desc_array); $k++) { if (eregi("^([0-9a-z_\\*\\+\\-])+$", $_POST["filter" . strtolower($attr_array[$k])])) $filter = $filter . "(" . strtolower($attr_array[$k]) . "=" . diff --git a/lam/templates/lists/listhosts.php b/lam/templates/lists/listhosts.php index 44268358..f5cd5389 100644 --- a/lam/templates/lists/listhosts.php +++ b/lam/templates/lists/listhosts.php @@ -27,6 +27,7 @@ include_once ("../../lib/ldap.inc"); include_once ("../../lib/status.inc"); include_once("../../lib/account.inc"); include_once("../../lib/pdf.inc"); +include_once("../../lib/modules.inc"); // start session session_save_path("../../sess"); @@ -143,14 +144,8 @@ for ($k = 0; $k < sizeof($desc_array); $k++) { if (! $_GET['norefresh']) { // configure search filter - if ($_SESSION['config']->is_samba3()) { - // Samba hosts have the attribute "sambaSamAccount" and end with "$" - $filter = "(&(objectClass=sambaSamAccount) (uid=*$)"; - } - else { - // Samba hosts have the attribute "sambaAccount" and end with "$" - $filter = "(&(objectClass=sambaAccount) (uid=*$)"; - } + $module_filter = get_ldap_filter("host"); // basic filter is provided by modules + $filter = "(&(uid=*$)" . $module_filter; // hosts end with "$" for ($k = 0; $k < sizeof($desc_array); $k++) { if (eregi("^([0-9a-z_\\*\\+\\-])+$", $_POST["filter" . strtolower($attr_array[$k])])) $filter = $filter . "(" . strtolower($attr_array[$k]) . "=" . diff --git a/lam/templates/lists/listusers.php b/lam/templates/lists/listusers.php index 421a12d5..8e040fc4 100644 --- a/lam/templates/lists/listusers.php +++ b/lam/templates/lists/listusers.php @@ -26,6 +26,7 @@ include_once ("../../lib/config.inc"); include_once("../../lib/ldap.inc"); include_once("../../lib/pdf.inc"); include_once("../../lib/account.inc"); +include_once("../../lib/modules.inc"); // used to display status messages include_once ("../../lib/status.inc"); @@ -178,9 +179,9 @@ for ($k = 0; $k < sizeof($desc_array); $k++) { } } -// configure search filter -// Unix/Samba3 users have the attribute "posixAccount" and do not end with "$" -$filter = "(&(objectClass=posixAccount) (!(uid=*$))"; +// configure search filter for LDAP +$module_filter = get_ldap_filter("user"); // basic filter is provided by modules +$filter = "(&(!(uid=*$))" . $module_filter; // users do not end with "$" for ($k = 0; $k < sizeof($desc_array); $k++) { if (eregi("^([0-9a-z_\\*\\+\\-])+$", $_POST["filter" . strtolower($attr_array[$k])])) $filter = $filter . "(" . strtolower($attr_array[$k]) . "=" .