summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a529fe3)
raw | patch | inline | side by side (parent: a529fe3)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 Jan 2008 12:24:38 +0000 (12:24 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 Jan 2008 12:24:38 +0000 (12:24 +0000) |
-Not completely tested yet
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8172 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8172 594d385d-05f5-0310-b6e9-bd551577e9d8
index 763db832a0ccb88418a9d8f17d6beb3008a7d78b..1b39d79252f99116e2e8d907c9faabd1efaae0b1 100644 (file)
{
if (isset($_SESSION['config'])){
$cfg= $_SESSION['config'];
- if (isset($cfg->current['LDAPSTATS']) && preg_match('/true/i', $cfg->current['LDAPSTATS'])){
+ if (1 || isset($cfg->current['LDAPSTATS']) && preg_match('/true/i', $cfg->current['LDAPSTATS'])){
syslog (LOG_INFO, $string);
}
}
index 55ec06550e62382c6a1d1dce58c9c140e1270eec..e27fc0e65cead6050302359d62d49ac67bd2c65e 100644 (file)
@@ -740,6 +740,9 @@ function get_sub_list($filter, $category,$sub_base, $base= "", $attributes= arra
$ldap->cd ($base);
}
+ /* Remove , ("ou=1,ou=2.." => "ou=1") */
+ $sub_base = preg_replace("/,.*$/","",$sub_base);
+
/* Check if there is a sub department specified */
if($sub_base == ""){
trigger_error("Please specify a valid sub search base, like 'ou=apps'. Parameter 3");
{
global $config;
+ $map = array( "applicationou" => "ou=apps,",
+ "mimetypeou" => "ou=mime,");
+
/* Preset ou... */
if (isset($config->current[$name])){
$ou= $config->current[$name];
+ } elseif (isset($map[$name])) {
+ $ou = $map[$name];
+ return($ou);
} else {
return "";
}
-
+
+
if ($ou != ""){
if (!preg_match('/^[^=]+=[^=]+/', $ou)){
return @LDAP::convert("ou=$ou,");
diff --git a/gosa-core/plugins/admin/applications/class_applicationManagement.inc b/gosa-core/plugins/admin/applications/class_applicationManagement.inc
index 7736f1963c3ab76b8f278409c6afc46173a0eb63..1089c50e8a1d9f0cb9a4c027af8dc3e44a6458f9 100644 (file)
$Flags |= GL_SUBSEARCH;
}
- $res= get_list($Filter, "application", $use_base, array("cn","description","dn","objectClass"), $Flags);
+ $res= get_sub_list($Filter, "application",get_ou('applicationou'), $use_base, array("cn","description","dn","objectClass"), $Flags);
$tmp2 = array();
foreach ($res as $val){
$tmp[strtolower($val['cn'][0]).$val['cn'][0].$val['dn']]=$val;
diff --git a/gosa-core/plugins/admin/devices/class_deviceManagement.inc b/gosa-core/plugins/admin/devices/class_deviceManagement.inc
index 59e702ff481eb9bb3f66f89168f12fc32168f24c..61ea93afaa0a2a0d513f135e81ff8c4d4b508eda 100644 (file)
}
/* Get results and create index */
- $res= get_list($Filter, "devices", $base, array("cn","description","dn","objectClass"), $Flags);
+ $res= get_sub_list($Filter,"devices","ou=devices", $base, array("cn","description","dn","objectClass"), $Flags);
$tmp2 = array();
foreach ($res as $val){
$tmp2[strtolower($val['cn'][0]).$val['cn'][0].$val['dn']] = strtolower($val['cn'][0]).$val['cn'][0].$val['dn'];
reset ($this->devices);
}
+
function remove_lock()
{
if (isset($this->devicetabs->dn)){
diff --git a/gosa-core/plugins/admin/groups/class_groupManagement.inc b/gosa-core/plugins/admin/groups/class_groupManagement.inc
index f146ad689b672c320b67afd6b2eb3490d7dda58c..dbd073532ffe1a0961e61df3889a86f6917caf1b 100644 (file)
}
if ($SubSearch){
- $res= get_list($filter, "groups", $base, $attrs, GL_SIZELIMIT| GL_SUBSEARCH);
+ $res= get_sub_list($filter, "groups",get_groups_ou(), $base, $attrs, GL_SIZELIMIT| GL_SUBSEARCH);
} else {
- $res= get_list($filter, "groups", get_groups_ou().$base, $attrs, GL_SIZELIMIT);
+ $res= get_sub_list($filter, "groups",get_groups_ou(), get_groups_ou().$base, $attrs, GL_SIZELIMIT);
}
/* Sort values into grouplist*/
diff --git a/gosa-core/plugins/admin/mimetypes/class_mimetypeManagement.inc b/gosa-core/plugins/admin/mimetypes/class_mimetypeManagement.inc
index 6511103600da18e892c4a054d999ba7c22aa4515..6fe119d92cb2075f59889d62177bcbbd331fa851 100755 (executable)
}
/* Get results and create index */
- $res= get_list($Filter, "mimetypes", $use_base, array("cn","description","dn","objectClass"), $Flags);
+ $res= get_sub_list($Filter, "mimetypes",get_ou('mimetypeou'), $use_base, array("cn","description","dn","objectClass"), $Flags);
$tmp2 = array();
foreach ($res as $val){
$tmp[strtolower($val['cn'][0]).$val['cn'][0].$val['dn']]=$val;
diff --git a/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc b/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc
index 1e66866da642e4d1102580ea81cc25852a1a3537..dc0d3188a229560931fb6a37ef62efc4d88c7e78 100644 (file)
$filter= "(&(cn=$Regex)(objectClass=gosaGroupOfNames)(|$filter))";
if($this->DivListOGroup->SubSearch){
- $res= get_list($filter, "ogroups", $base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT | GL_SUBSEARCH);
+ $res= get_sub_list($filter, "ogroups",get_groups_ou(), $base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT | GL_SUBSEARCH);
}else{
- $res= get_list($filter, "ogroups", get_groups_ou().$base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT );
+ $res= get_sub_list($filter, "ogroups",get_groups_ou(), get_groups_ou().$base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT );
}
$this->ogrouplist= $res;
diff --git a/gosa-core/plugins/admin/systems/class_systemManagement.inc b/gosa-core/plugins/admin/systems/class_systemManagement.inc
index 03a3b83866754de78f1534565259b22105a28320..7b04844043762abcf7a8a8078b375f465babfead 100644 (file)
if($this->DivListSystem->SubSearch){
if($oc['CLASS'] != ""){
$filter = "(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex."))";
- $new_res = get_list($filter, $sys_categories , $base,$sys_attrs, GL_NONE | GL_SUBSEARCH | GL_SIZELIMIT);
+ $new_res = get_sub_list($filter, $sys_categories ,preg_replace("/,.*$/","",$base), $base,$sys_attrs, GL_NONE | GL_SUBSEARCH | GL_SIZELIMIT);
/* Remove all objects that are not in the expected sub department */
foreach($new_res as $key => $obj){
/* User filter? */
if($oc['CLASS'] != ""){
$filter = "(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex."))";
- $res = array_merge($res,get_list($filter,$sys_categories,$oc['TREE'].$base, $sys_attrs, GL_NONE | GL_SIZELIMIT));
+ $res = array_merge($res,get_sub_list($filter,$sys_categories,preg_replace("/,.*$/","",$oc['TREE']),$oc['TREE'].$base, $sys_attrs, GL_NONE | GL_SIZELIMIT));
}
}
}
/* Search for incoming objects */
$filter = "(|(&".$userregex."(objectClass=goHard)(cn=".$this->DivListSystem->Regex.")))";
- $res = array_merge($res,get_list($filter,$sys_categories,"ou=incoming,".$base,$sys_attrs, GL_NONE | GL_SIZELIMIT));
+ $res = array_merge($res,get_list($filter,$sys_categories,"ou=incoming","ou=incoming,".$base,$sys_attrs, GL_NONE | GL_SIZELIMIT));
/* Get all gotoTerminal's */
foreach ($res as $value){
diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc
index 977a26f6b1db3fdaa98c823b6004bf540be707b9..0b9e6ffad70c6e6451c0831fbedaaa17a87f38ad 100644 (file)
$ldap= $this->config->get_ldap_link(TRUE);
if ($SubSearch){
- $ListTemp = get_list($filter, "users", $base,
+ $ListTemp = get_sub_list($filter, "users", preg_replace("/,.*$/","",get_people_ou()),$base,
array("uid", "givenName", "sn", "objectClass","userPassword"), GL_SUBSEARCH | GL_SIZELIMIT);
} else {
$base= get_people_ou().$base;
- $ListTemp = get_list($filter, "users", $base,
+ $ListTemp = get_sub_list($filter, "users", preg_replace("/,.*$/","",get_people_ou()),$base,
array("uid", "givenName", "sn", "objectClass","userPassword"), GL_SIZELIMIT);
}
$SortTemp = array();