lists use now LDAP filters from modules
This commit is contained in:
parent
95fdb7b1a5
commit
be304a2bde
|
@ -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]) . "=" .
|
||||
|
|
|
@ -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]) . "=" .
|
||||
|
|
|
@ -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]) . "=" .
|
||||
|
|
Loading…
Reference in New Issue