lists use now LDAP filters from modules

This commit is contained in:
Roland Gruber 2004-02-23 16:54:42 +00:00
parent 95fdb7b1a5
commit be304a2bde
3 changed files with 10 additions and 13 deletions

View File

@ -27,6 +27,7 @@ include_once ("../../lib/ldap.inc");
include_once ("../../lib/status.inc"); include_once ("../../lib/status.inc");
include_once("../../lib/account.inc"); include_once("../../lib/account.inc");
include_once("../../lib/pdf.inc"); include_once("../../lib/pdf.inc");
include_once("../../lib/modules.inc");
// start session // start session
session_save_path("../../sess"); session_save_path("../../sess");
@ -145,8 +146,8 @@ for ($k = 0; $k < sizeof($desc_array); $k++) {
if (! $_GET['norefresh']) { if (! $_GET['norefresh']) {
// configure search filter // configure search filter
// Groups have the attribute "posixGroup" $module_filter = get_ldap_filter("group"); // basic filter is provided by modules
$filter = "(&(objectClass=posixGroup)"; $filter = "(&" . $module_filter;
for ($k = 0; $k < sizeof($desc_array); $k++) { for ($k = 0; $k < sizeof($desc_array); $k++) {
if (eregi("^([0-9a-z_\\*\\+\\-])+$", $_POST["filter" . strtolower($attr_array[$k])])) if (eregi("^([0-9a-z_\\*\\+\\-])+$", $_POST["filter" . strtolower($attr_array[$k])]))
$filter = $filter . "(" . strtolower($attr_array[$k]) . "=" . $filter = $filter . "(" . strtolower($attr_array[$k]) . "=" .

View File

@ -27,6 +27,7 @@ include_once ("../../lib/ldap.inc");
include_once ("../../lib/status.inc"); include_once ("../../lib/status.inc");
include_once("../../lib/account.inc"); include_once("../../lib/account.inc");
include_once("../../lib/pdf.inc"); include_once("../../lib/pdf.inc");
include_once("../../lib/modules.inc");
// start session // start session
session_save_path("../../sess"); session_save_path("../../sess");
@ -143,14 +144,8 @@ for ($k = 0; $k < sizeof($desc_array); $k++) {
if (! $_GET['norefresh']) { if (! $_GET['norefresh']) {
// configure search filter // configure search filter
if ($_SESSION['config']->is_samba3()) { $module_filter = get_ldap_filter("host"); // basic filter is provided by modules
// Samba hosts have the attribute "sambaSamAccount" and end with "$" $filter = "(&(uid=*$)" . $module_filter; // hosts end with "$"
$filter = "(&(objectClass=sambaSamAccount) (uid=*$)";
}
else {
// Samba hosts have the attribute "sambaAccount" and end with "$"
$filter = "(&(objectClass=sambaAccount) (uid=*$)";
}
for ($k = 0; $k < sizeof($desc_array); $k++) { for ($k = 0; $k < sizeof($desc_array); $k++) {
if (eregi("^([0-9a-z_\\*\\+\\-])+$", $_POST["filter" . strtolower($attr_array[$k])])) if (eregi("^([0-9a-z_\\*\\+\\-])+$", $_POST["filter" . strtolower($attr_array[$k])]))
$filter = $filter . "(" . strtolower($attr_array[$k]) . "=" . $filter = $filter . "(" . strtolower($attr_array[$k]) . "=" .

View File

@ -26,6 +26,7 @@ include_once ("../../lib/config.inc");
include_once("../../lib/ldap.inc"); include_once("../../lib/ldap.inc");
include_once("../../lib/pdf.inc"); include_once("../../lib/pdf.inc");
include_once("../../lib/account.inc"); include_once("../../lib/account.inc");
include_once("../../lib/modules.inc");
// used to display status messages // used to display status messages
include_once ("../../lib/status.inc"); include_once ("../../lib/status.inc");
@ -178,9 +179,9 @@ for ($k = 0; $k < sizeof($desc_array); $k++) {
} }
} }
// configure search filter // configure search filter for LDAP
// Unix/Samba3 users have the attribute "posixAccount" and do not end with "$" $module_filter = get_ldap_filter("user"); // basic filter is provided by modules
$filter = "(&(objectClass=posixAccount) (!(uid=*$))"; $filter = "(&(!(uid=*$))" . $module_filter; // users do not end with "$"
for ($k = 0; $k < sizeof($desc_array); $k++) { for ($k = 0; $k < sizeof($desc_array); $k++) {
if (eregi("^([0-9a-z_\\*\\+\\-])+$", $_POST["filter" . strtolower($attr_array[$k])])) if (eregi("^([0-9a-z_\\*\\+\\-])+$", $_POST["filter" . strtolower($attr_array[$k])]))
$filter = $filter . "(" . strtolower($attr_array[$k]) . "=" . $filter = $filter . "(" . strtolower($attr_array[$k]) . "=" .