From 47f45f247c547999858874eac073796ce4d6e30b Mon Sep 17 00:00:00 2001 From: cajus Date: Thu, 3 Aug 2006 04:12:09 +0000 Subject: [PATCH] ACL updates git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4369 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_MultiSelectWindow.inc | 8 +++-- include/class_config.inc | 3 +- include/class_userinfo.inc | 12 +++++++- include/functions.inc | 29 +++++++++++-------- plugins/admin/acl/class_aclManagement.inc | 2 +- plugins/admin/acl/class_divListACL.inc | 2 +- .../class_applicationManagement.inc | 2 +- .../applications/class_divListApplication.inc | 2 +- .../class_departmentManagement.inc | 4 +-- .../departments/class_divListDepartment.inc | 2 +- plugins/admin/fai/class_askClassName.inc | 4 +-- plugins/admin/fai/class_divListFai.inc | 2 +- plugins/admin/groups/class_divListGroup.inc | 2 +- .../admin/groups/class_groupApplication.inc | 2 +- plugins/admin/groups/class_groupMail.inc | 3 +- .../admin/groups/class_groupManagement.inc | 10 +++---- .../mimetypes/class_divListMimeTypes.inc | 2 +- .../mimetypes/class_mimetypeManagement.inc | 2 +- plugins/admin/ogroups/class_divListOGroup.inc | 2 +- .../admin/ogroups/class_ogroupManagement.inc | 4 +-- .../admin/systems/class_baseSelectDialog.inc | 4 ++- plugins/admin/systems/class_divListSystem.inc | 6 +++- .../systems/class_divListSystemService.inc | 2 +- .../admin/systems/class_glpiSelectUser.inc | 4 +-- .../admin/systems/class_systemManagement.inc | 6 ++-- plugins/admin/users/class_divListUsers.inc | 6 +++- plugins/admin/users/class_userManagement.inc | 4 +-- .../blocklists/class_blocklistManagement.inc | 8 ++--- .../blocklists/class_divListBlocklists.inc | 2 +- .../gofax/faxaccount/class_gofaxAccount.inc | 3 +- .../conference/class_divListConferences.inc | 2 +- .../class_phoneConferenceManagment.inc | 2 +- plugins/gofon/macro/class_divListMacros.inc | 2 +- .../macro/class_gofonMacroManagement.inc | 2 +- plugins/personal/mail/class_mailAccount.inc | 2 +- plugins/personal/posix/class_posixAccount.inc | 9 ++---- plugins/personal/samba/class_sambaAccount.inc | 3 +- 37 files changed, 92 insertions(+), 74 deletions(-) diff --git a/include/class_MultiSelectWindow.inc b/include/class_MultiSelectWindow.inc index 9dd83864c..29d455edb 100644 --- a/include/class_MultiSelectWindow.inc +++ b/include/class_MultiSelectWindow.inc @@ -34,6 +34,7 @@ class MultiSelectWindow{ var $HideFilterPart = false; var $SaveAdditionalVars = array(); // Additional Post vars to store + var $module= ""; function ClearElementsList() { @@ -72,9 +73,10 @@ class MultiSelectWindow{ } /* Contrucktion */ - function MultiSelectWindow($config,$filterName) + function MultiSelectWindow($config, $filterName, $module) { $this->config = $config; + $this->module = $module; $this->SaveButtonString = _("Save"); $this->CloseButtonString = _("Close"); $this->filterName = $filterName; @@ -552,8 +554,8 @@ class MultiSelectWindow{ $this->departments = array(); /* Get all departments within this subtree */ - $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->ui->subtreeACL, - $base, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT); + $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, + array("ou", "description"), GL_SIZELIMIT | GL_CONVERT); /* Edit delete link for system types */ diff --git a/include/class_config.inc b/include/class_config.inc index 473319751..13c87c11d 100644 --- a/include/class_config.inc +++ b/include/class_config.inc @@ -670,7 +670,8 @@ class config { $return = array(); $ui = get_userinfo(); $base = $config->current['BASE']; - $res = get_list("(&(objectClass=goShareServer)(goExportEntry=*))",$ui->subtreeACL,$base,array("goExportEntry","cn"),GL_SUBSEARCH); +echo "Need to adapt share list loading
"; + $res= get_list("(&(objectClass=goShareServer)(goExportEntry=*))", "all", $base,array("goExportEntry","cn"),GL_SUBSEARCH); foreach($res as $entry){ if(isset($entry['goExportEntry']['count'])){ unset($entry['goExportEntry']['count']); diff --git a/include/class_userinfo.inc b/include/class_userinfo.inc index b8a2fa737..f082e1f6c 100644 --- a/include/class_userinfo.inc +++ b/include/class_userinfo.inc @@ -207,8 +207,15 @@ class userinfo continue; } - } + /* If attribute is "", we want to know, if we've *any* permissions here... */ + if ($attribute == "" && isset($subacl['acl'][$object])){ + foreach($subacl['acl'][$object] as $attr => $dummy){ + $acl= $this->mergeACL($acl, $subacl['type'], $subacl['acl'][$object][$attr]); + } + continue; + } + } } } @@ -238,6 +245,9 @@ class userinfo /* Extract all relevant objects for this module from plist */ foreach ($plist->info as $object => $info){ + if (!isset($info['plCategory'])){ + continue; + } foreach ($info['plCategory'] as $idx => $data){ if (preg_match('/^[0-9]+$/', $idx)){ if ($data == $module){ diff --git a/include/functions.inc b/include/functions.inc index 4c909b7d1..5f1d386f7 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -582,12 +582,10 @@ function get_lock ($object) } -function get_list($filter, $subtreeACL, $base= "", $attributes= array(), $flags= GL_SUBSEARCH) +function get_list($filter, $object, $base= "", $attributes= array(), $flags= GL_SUBSEARCH) { global $config, $ui; - echo "get_list called. Replace it, it doesn't support new acls"; - /* Get LDAP link */ $ldap= $config->get_ldap_link($flags & GL_SIZELIMIT); @@ -598,12 +596,6 @@ function get_list($filter, $subtreeACL, $base= "", $attributes= array(), $flags= $ldap->cd ($base); } - /* Strict filter for administrative units? */ - if ($ui->gosaUnitTag != "" && isset($config->current['STRICT_UNITS']) && - preg_match('/TRUE/i', $config->current['STRICT_UNITS'])){ - $filter= "(&(gosaUnitTag=".$ui->gosaUnitTag.")$filter)"; - } - /* Perform ONE or SUB scope searches? */ if ($flags & GL_SUBSEARCH) { $ldap->search ($filter, $attributes); @@ -619,12 +611,26 @@ function get_list($filter, $subtreeACL, $base= "", $attributes= array(), $flags= /* Crawl through reslut entries and perform the migration to the result array */ $result= array(); + while($attrs = $ldap->fetch()) { $dn= $ldap->getDN(); - foreach ($subtreeACL as $key => $value){ - if (preg_match("/$key/", $dn)){ + /* Sort in every value that fits the permissions */ + if (is_array($object)){ + foreach ($object as $o){ + if ($ui->get_permissions($dn, $o, "") != ""){ + if ($flags & GL_CONVERT){ + $attrs["dn"]= convert_department_dn($dn); + } else { + $attrs["dn"]= $dn; + } + /* We found what we were looking for, break speeds things up */ + $result[]= $attrs; + } + } + } else { + if ($ui->get_permissions($dn, $object, "") != ""){ if ($flags & GL_CONVERT){ $attrs["dn"]= convert_department_dn($dn); } else { @@ -633,7 +639,6 @@ function get_list($filter, $subtreeACL, $base= "", $attributes= array(), $flags= /* We found what we were looking for, break speeds things up */ $result[]= $attrs; - break; } } } diff --git a/plugins/admin/acl/class_aclManagement.inc b/plugins/admin/acl/class_aclManagement.inc index a7c7215dd..4bbab22ea 100644 --- a/plugins/admin/acl/class_aclManagement.inc +++ b/plugins/admin/acl/class_aclManagement.inc @@ -329,7 +329,7 @@ class aclManagement extends plugin } /* Get objects */ - $res= get_list($Filter, $this->ui->subtreeACL,$base, $Attrs, $Flags); + $res= get_list($Filter, "acl", $base, $Attrs, $Flags); $this->list = $res; } diff --git a/plugins/admin/acl/class_divListACL.inc b/plugins/admin/acl/class_divListACL.inc index 446fd3e0b..6e839bcc4 100644 --- a/plugins/admin/acl/class_divListACL.inc +++ b/plugins/admin/acl/class_divListACL.inc @@ -22,7 +22,7 @@ class divListACL extends MultiSelectWindow function divListACL ($config,$parent) { - MultiSelectWindow::MultiSelectWindow($config,"ACLs"); + MultiSelectWindow::MultiSelectWindow($config, "ACLs", "acls"); $this->parent = $parent; $this->ui = get_userinfo(); diff --git a/plugins/admin/applications/class_applicationManagement.inc b/plugins/admin/applications/class_applicationManagement.inc index 7f6ee679e..6c35f6526 100644 --- a/plugins/admin/applications/class_applicationManagement.inc +++ b/plugins/admin/applications/class_applicationManagement.inc @@ -418,7 +418,7 @@ class applicationManagement extends plugin $Flags |= GL_SUBSEARCH; } - $res= get_list($Filter, $this->ui->subtreeACL,$use_base, array("cn","description","dn","objectClass"), $Flags); + $res= get_list($Filter, "application", $use_base, array("cn","description","dn","objectClass"), $Flags); foreach ($res as $val){ $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val; } diff --git a/plugins/admin/applications/class_divListApplication.inc b/plugins/admin/applications/class_divListApplication.inc index 8487f9b4d..f1bf26342 100755 --- a/plugins/admin/applications/class_divListApplication.inc +++ b/plugins/admin/applications/class_divListApplication.inc @@ -20,7 +20,7 @@ class divListApplication extends MultiSelectWindow function divListApplication ($config,$parent) { - MultiSelectWindow::MultiSelectWindow($config,"Application"); + MultiSelectWindow::MultiSelectWindow($config,"Application", "application"); $this->selectedRelease = "ou=apps,".$_SESSION['CurrentMainBase']; diff --git a/plugins/admin/departments/class_departmentManagement.inc b/plugins/admin/departments/class_departmentManagement.inc index 018e2e38a..42fefdfcb 100644 --- a/plugins/admin/departments/class_departmentManagement.inc +++ b/plugins/admin/departments/class_departmentManagement.inc @@ -342,10 +342,10 @@ class departmentManagement extends plugin if($this->DivListDepartment->SubSearch){ $res= get_list("(&(|(ou=$Regex)(description=$Regex))(objectClass=gosaDepartment))", - $this->ui->subtreeACL, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH); + "department", $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH); }else{ $res= get_list("(&(|(ou=$Regex)(description=$Regex))(objectClass=gosaDepartment))", - $this->ui->subtreeACL, $base, array("ou", "description"), GL_SIZELIMIT ); + "department", $base, array("ou", "description"), GL_SIZELIMIT ); } $this->departments= array(); diff --git a/plugins/admin/departments/class_divListDepartment.inc b/plugins/admin/departments/class_divListDepartment.inc index ebbb7ac3f..f83a561d1 100755 --- a/plugins/admin/departments/class_divListDepartment.inc +++ b/plugins/admin/departments/class_divListDepartment.inc @@ -18,7 +18,7 @@ class divListDepartment extends MultiSelectWindow function divListDepartment ($config,$parent) { - MultiSelectWindow::MultiSelectWindow($config,"Department"); + MultiSelectWindow::MultiSelectWindow($config, "Department", "department"); $this->parent = $parent; $this->ui = get_userinfo(); diff --git a/plugins/admin/fai/class_askClassName.inc b/plugins/admin/fai/class_askClassName.inc index c45d9996d..b9f854f75 100644 --- a/plugins/admin/fai/class_askClassName.inc +++ b/plugins/admin/fai/class_askClassName.inc @@ -51,13 +51,13 @@ class askClassName extends plugin } $ldap = $this->config->get_ldap_link(); - $res= get_list("(&(objectClass=organizationalUnit)(!(objectClass=FAIbranch)))", $this->ui->subtreeACL, $base, + $res= get_list("(&(objectClass=organizationalUnit)(!(objectClass=FAIbranch)))", "fai", $base, array("cn","description","objectClass"), GL_SIZELIMIT ); $delete = array(); $used = array(); foreach($res as $objecttypes){ - $res2= get_list("(objectClass=*)", $this->ui->subtreeACL, $objecttypes['dn'], + $res2= get_list("(objectClass=*)", "fai", $objecttypes['dn'], array("cn","description","objectClass","FAIclass","FAIstate"), GL_SIZELIMIT | GL_CONVERT ); foreach($res2 as $object){ diff --git a/plugins/admin/fai/class_divListFai.inc b/plugins/admin/fai/class_divListFai.inc index f8826637a..56a0d2bb4 100644 --- a/plugins/admin/fai/class_divListFai.inc +++ b/plugins/admin/fai/class_divListFai.inc @@ -28,7 +28,7 @@ class divListFai extends MultiSelectWindow function divListFai ($config,$parent) { - MultiSelectWindow::MultiSelectWindow($config,"Fai"); + MultiSelectWindow::MultiSelectWindow($config, "Fai", "fai"); $this->parent = $parent; $this->ui = get_userinfo(); diff --git a/plugins/admin/groups/class_divListGroup.inc b/plugins/admin/groups/class_divListGroup.inc index 1605e4cf1..ffac98134 100644 --- a/plugins/admin/groups/class_divListGroup.inc +++ b/plugins/admin/groups/class_divListGroup.inc @@ -26,7 +26,7 @@ class divListGroup extends MultiSelectWindow function divListGroup ($config,$parent) { - MultiSelectWindow::MultiSelectWindow($config,"Groups"); + MultiSelectWindow::MultiSelectWindow($config, "Groups", "groups"); $this->parent = $parent; $this->ui = get_userinfo(); diff --git a/plugins/admin/groups/class_groupApplication.inc b/plugins/admin/groups/class_groupApplication.inc index 722864249..f16e89cc1 100644 --- a/plugins/admin/groups/class_groupApplication.inc +++ b/plugins/admin/groups/class_groupApplication.inc @@ -613,7 +613,7 @@ class appgroup extends plugin /* get departments */ $ui = get_userinfo(); $departments = array(); - $res = get_list("(objectClass=gosaDepartment)",$ui->subtreeACL,$this->curbase,array("description","cn","ou"),GL_SIZELIMIT); + $res = get_list("(objectClass=gosaDepartment)", "department", $this->curbase,array("description","cn","ou"),GL_SIZELIMIT); foreach($res as $value){ $fdn= @LDAP::fix($value['dn']); if($value["description"][0]!=".."){ diff --git a/plugins/admin/groups/class_groupMail.inc b/plugins/admin/groups/class_groupMail.inc index 18bff5100..9d6797aaa 100644 --- a/plugins/admin/groups/class_groupMail.inc +++ b/plugins/admin/groups/class_groupMail.inc @@ -470,8 +470,7 @@ class mailgroup extends plugin $filter.= "(!(|$exclude))"; } - $acl= array($this->config->current['BASE'] => ":all"); - $res= get_list("(&(objectClass=gosaMailAccount)$filter)", $acl, $gmailfilter['depselect'], + $res= get_list("(&(objectClass=gosaMailAccount)$filter)", "users", $gmailfilter['depselect'], array("sn", "mail", "givenName"), GL_SUBSEARCH | GL_SIZELIMIT); $ldap->cd($gmailfilter['depselect']); $ldap->search ("(&(objectClass=gosaMailAccount)$filter)", array("sn", "mail", "givenName")); diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc index 637abae5b..4f6c74ad2 100644 --- a/plugins/admin/groups/class_groupManagement.inc +++ b/plugins/admin/groups/class_groupManagement.inc @@ -432,8 +432,8 @@ class groupManagement extends plugin /* Collect primary groupIDs to show primary groups if this option is enabled in gosa conf && the checkbox is checked */ if ($this->ShowPrimaryCheckBox){ - $res = get_list("(&(uid=$Regex)(!(uid=*$))(objectClass=posixAccount)(gidNumber=*))", $this->ui->subtreeACL, - $base,array("gidNumber", "cn"), GL_SUBSEARCH); + $res = get_list("(&(uid=$Regex)(!(uid=*$))(objectClass=posixAccount)(gidNumber=*))", + "groups", $base,array("gidNumber", "cn"), GL_SUBSEARCH); foreach ($res as $attrs){ $primaries[$attrs['gidNumber'][0]]= $attrs['cn'][0]; } @@ -442,7 +442,7 @@ class groupManagement extends plugin /* Collect all GroupIDs from those groups which are functional. Only perfrom this search if ShowFunctionalGroups is unchecked, else leave arre empty */ $ff = "(&(cn=$Regex)(objectClass=posixGroup)(!(|(objectClass=gosaMailAccount)(objectClass=gosaApplicationGroup)$sfilter)))"; - $res = get_list($ff,$this->ui->subtreeACL,$base,array("gidNumber", "cn", "description"), GL_SUBSEARCH); + $res = get_list($ff, "groups", $base,array("gidNumber", "cn", "description"), GL_SUBSEARCH); foreach($res as $attrs){ if (!isset($primaries[$attrs['gidNumber'][0]])){ $functional[$attrs['gidNumber'][0]]= $attrs['gidNumber'][0]; @@ -458,9 +458,9 @@ class groupManagement extends plugin $attrs = array("cn", "description", "gidNumber", "objectClass","FAIrelease"); if ($SubSearch){ - $res= get_list($filter, $this->ui->subtreeACL, $base, $attrs, GL_SIZELIMIT| GL_SUBSEARCH); + $res= get_list($filter, "groups", $base, $attrs, GL_SIZELIMIT| GL_SUBSEARCH); } else { - $res= get_list($filter, $this->ui->subtreeACL, get_groups_ou().$base, $attrs, GL_SIZELIMIT); + $res= get_list($filter, "groups", get_groups_ou().$base, $attrs, GL_SIZELIMIT); } /* Sort values into grouplist*/ diff --git a/plugins/admin/mimetypes/class_divListMimeTypes.inc b/plugins/admin/mimetypes/class_divListMimeTypes.inc index eea9f505e..2fd85ecb3 100755 --- a/plugins/admin/mimetypes/class_divListMimeTypes.inc +++ b/plugins/admin/mimetypes/class_divListMimeTypes.inc @@ -23,7 +23,7 @@ class divListMimeTypes extends MultiSelectWindow function divListMimeTypes ($config,$parent) { /* Create divlist and setup */ - MultiSelectWindow::MultiSelectWindow($config,"Mimetypes"); + MultiSelectWindow::MultiSelectWindow($config, "Mimetypes", "mimetypes"); /* initialize required attributes */ $this->selectedRelease = "ou=mime,".$_SESSION['CurrentMainBase']; diff --git a/plugins/admin/mimetypes/class_mimetypeManagement.inc b/plugins/admin/mimetypes/class_mimetypeManagement.inc index 52f91ddc8..a4da4d430 100755 --- a/plugins/admin/mimetypes/class_mimetypeManagement.inc +++ b/plugins/admin/mimetypes/class_mimetypeManagement.inc @@ -415,7 +415,7 @@ class mimetypeManagement extends plugin } /* Get results and create index */ - $res= get_list($Filter, $this->ui->subtreeACL,$use_base, array("cn","description","dn","objectClass"), $Flags); + $res= get_list($Filter, "mimetypes", $use_base, array("cn","description","dn","objectClass"), $Flags); foreach ($res as $val){ $tmp[strtolower($val['cn'][0]).$val['cn'][0]]=$val; } diff --git a/plugins/admin/ogroups/class_divListOGroup.inc b/plugins/admin/ogroups/class_divListOGroup.inc index 861ffe2e9..415a6b964 100755 --- a/plugins/admin/ogroups/class_divListOGroup.inc +++ b/plugins/admin/ogroups/class_divListOGroup.inc @@ -29,7 +29,7 @@ class divListOGroup extends MultiSelectWindow function divListOGroup ($config,$parent) { - MultiSelectWindow::MultiSelectWindow($config,"OGroups"); + MultiSelectWindow::MultiSelectWindow($config, "OGroups", "ogroups"); $this->parent = $parent; $this->ui = get_userinfo(); diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc index b30a4f146..8dafd74e5 100644 --- a/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/plugins/admin/ogroups/class_ogroupManagement.inc @@ -450,9 +450,9 @@ class ogroupManagement extends plugin $filter= "(&(cn=$Regex)(objectClass=gosaGroupOfNames)(|$filter))"; if($this->DivListOGroup->SubSearch){ - $res= get_list($filter, $this->ui->subtreeACL, $base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT | GL_SUBSEARCH); + $res= get_list($filter, "ogroups", $base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT | GL_SUBSEARCH); }else{ - $res= get_list($filter, $this->ui->subtreeACL, get_groups_ou().$base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT ); + $res= get_list($filter, "ogroups", get_groups_ou().$base, array("cn","objectClass","gosaGroupObjects"), GL_SIZELIMIT ); } $this->ogrouplist= $res; diff --git a/plugins/admin/systems/class_baseSelectDialog.inc b/plugins/admin/systems/class_baseSelectDialog.inc index 50fb1204d..fe3ccd755 100644 --- a/plugins/admin/systems/class_baseSelectDialog.inc +++ b/plugins/admin/systems/class_baseSelectDialog.inc @@ -12,7 +12,9 @@ class baseSelectDialog extends MultiSelectWindow function baseSelectDialog ($config,$parent,$onlyAllowThisBases = array()) { - MultiSelectWindow::MultiSelectWindow($config,"BASEselectWindow"); + echo "Need to pass module via parameter!
"; + $module= "all"; + MultiSelectWindow::MultiSelectWindow($config, "BASEselectWindow", $module); $this->parent = $parent; diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc index fe125e2aa..bf73c5504 100644 --- a/plugins/admin/systems/class_divListSystem.inc +++ b/plugins/admin/systems/class_divListSystem.inc @@ -28,7 +28,11 @@ class divListSystem extends MultiSelectWindow function divListSystem ($config,$parent) { - MultiSelectWindow::MultiSelectWindow($config,"System"); + MultiSelectWindow::MultiSelectWindow($config, "System", array("server", + "workstation", + "terminal", + "phone", + "printer")); $this->parent = $parent; $this->ui = get_userinfo(); diff --git a/plugins/admin/systems/class_divListSystemService.inc b/plugins/admin/systems/class_divListSystemService.inc index 25e2ed552..3d6fc5087 100644 --- a/plugins/admin/systems/class_divListSystemService.inc +++ b/plugins/admin/systems/class_divListSystemService.inc @@ -8,7 +8,7 @@ class divListSystemService extends MultiSelectWindow function divListSystemService ($config,$parent) { - MultiSelectWindow::MultiSelectWindow($config,"SystemService"); + MultiSelectWindow::MultiSelectWindow($config,"SystemService", "server"); $this->parent = $parent; $this->ui = get_userinfo(); diff --git a/plugins/admin/systems/class_glpiSelectUser.inc b/plugins/admin/systems/class_glpiSelectUser.inc index 4d8e2d41a..8e7eff7e3 100644 --- a/plugins/admin/systems/class_glpiSelectUser.inc +++ b/plugins/admin/systems/class_glpiSelectUser.inc @@ -209,7 +209,7 @@ class glpiSelectUser extends plugin */ $res3= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", - $this->ui->subtreeACL, $base, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT); + "glpi", $base, array("ou", "description"), GL_SIZELIMIT | GL_CONVERT); $this->departments= array(); $tmp = array(); @@ -228,7 +228,7 @@ class glpiSelectUser extends plugin /* END NEW LIST MANAGMENT */ $ou = get_people_ou(); - $res2= get_list("(&(|(cn=$regex)(sn=$regex))(objectClass=person))", $this->ui->subtreeACL, + $res2= get_list("(&(|(cn=$regex)(sn=$regex))(objectClass=person))", "glpi", $ou.$base, array("cn", "sn", "uid", "givenName", "description"), GL_SUBSEARCH | GL_SIZELIMIT); diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc index 0f86b327e..ac7f6efbf 100644 --- a/plugins/admin/systems/class_systemManagement.inc +++ b/plugins/admin/systems/class_systemManagement.inc @@ -610,14 +610,14 @@ class systems extends plugin if($this->DivListSystem->SubSearch){ if($oc['CLASS'] != ""){ $filter = "(|(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex.")))"; - $res = array_merge($res,get_list($filter,$this->ui->subtreeACL, $base, + $res = array_merge($res,get_list($filter, array("terminal", "workstation", "server", "phone" ,"printer"), $base, array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate"), GL_NONE | GL_SUBSEARCH | GL_SIZELIMIT)); } }else{ /* User filter? */ if($oc['CLASS'] != ""){ $filter = "(|(&".$userregex."(objectClass=".$oc['CLASS'].")(cn=".$this->DivListSystem->Regex.")))"; - $res = array_merge($res,get_list($filter,$this->ui->subtreeACL, $oc['TREE'].$base, + $res = array_merge($res,get_list($filter,array("terminal", "workstation", "server", "phone" ,"printer"),$oc['TREE'].$base, array("cn", "description", "macAddress", "objectClass", "sambaDomainName", "FAIstate"), GL_NONE | GL_SIZELIMIT)); } } @@ -626,7 +626,7 @@ class systems extends plugin /* Search for incoming objects */ $filter = "(|(&".$userregex."(objectClass=goHard)(cn=".$this->DivListSystem->Regex.")))"; - $res = array_merge($res,get_list($filter,$this->ui->subtreeACL, "ou=incoming,".$base, + $res = array_merge($res,get_list($filter,array("terminal", "workstation", "server", "phone" ,"printer"),"ou=incoming,".$base, array("cn", "description", "macAddress", "objectClass", "sambaDomainName"), GL_NONE | GL_SIZELIMIT)); /* Get all gotoTerminal's */ diff --git a/plugins/admin/users/class_divListUsers.inc b/plugins/admin/users/class_divListUsers.inc index 4ff03c562..699780812 100644 --- a/plugins/admin/users/class_divListUsers.inc +++ b/plugins/admin/users/class_divListUsers.inc @@ -26,7 +26,7 @@ class divListUsers extends MultiSelectWindow function divListUsers ($config,$parent) { - MultiSelectWindow::MultiSelectWindow($config,"Users"); + MultiSelectWindow::MultiSelectWindow($config, "Users", "users"); $this->parent = $parent; $this->ui = get_userinfo(); @@ -79,6 +79,10 @@ class divListUsers extends MultiSelectWindow which are shown in the listbox on top of the listbox */ $options= ""; +#print_a($this->config->idepartments); +#$ui= get_userinfo(); +#$t= $ui->get_module_departments("users"); +#print_a($t); foreach ($this->config->idepartments as $key => $value){ if ($this->selectedBase == $key){ $options.= ""; diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index e8540af7f..8e7f6415f 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -717,11 +717,11 @@ class userManagement extends plugin $ldap= $this->config->get_ldap_link(TRUE); if ($SubSearch){ - $ListTemp = get_list($filter, $this->ui->subtreeACL, $base, + $ListTemp = get_list($filter, "users", $base, array("uid", "givenName", "sn", "objectClass"), GL_SUBSEARCH | GL_SIZELIMIT); } else { $base= get_people_ou().$base; - $ListTemp = get_list($filter, $this->ui->subtreeACL, $base, + $ListTemp = get_list($filter, "users", $base, array("uid", "givenName", "sn", "objectClass"), GL_SIZELIMIT); } $SortTemp = array(); diff --git a/plugins/gofax/blocklists/class_blocklistManagement.inc b/plugins/gofax/blocklists/class_blocklistManagement.inc index 9cb8958be..9b946ee97 100644 --- a/plugins/gofax/blocklists/class_blocklistManagement.inc +++ b/plugins/gofax/blocklists/class_blocklistManagement.inc @@ -29,10 +29,6 @@ class blocklist extends plugin $this->dn = ""; $this->config = $config; - $ui = get_userinfo(); - $acl = get_permissions ($ui->dn, $ui->subtreeACL); - $this->acl = get_module_permission($acl, "blocklists", $ui->dn); - $this->DivListBlocklist = new divListBlocklist($this->config,$this); } @@ -383,11 +379,11 @@ class blocklist extends plugin /* Create filter */ if ($ShowSendBocklists){ $filter = "(&(objectClass=goFaxSBlock)(|(cn=".$Regex.")(goFaxSBlocklist=".$Regex.")))"; - $res= get_list($filter, $this->ui->subtreeACL, $base,array("*"), $Flags); + $res= get_list($filter, "gofax", $base,array("*"), $Flags); } if ($ShowReceiveBlocklists){ $filter2= "(&(objectClass=goFaxRBlock)(|(cn=".$Regex.")(goFaxRBlocklist=".$Regex.")))"; - $res2= get_list($filter2, $this->ui->subtreeACL, $base,array("*"), $Flags); + $res2= get_list($filter2, "gofax", $base,array("*"), $Flags); } $this->blocklists = array_merge($res,$res2); diff --git a/plugins/gofax/blocklists/class_divListBlocklists.inc b/plugins/gofax/blocklists/class_divListBlocklists.inc index fc024a1d4..bada73d0a 100755 --- a/plugins/gofax/blocklists/class_divListBlocklists.inc +++ b/plugins/gofax/blocklists/class_divListBlocklists.inc @@ -22,7 +22,7 @@ class divListBlocklist extends MultiSelectWindow function divListBlocklist ($config,$parent) { - MultiSelectWindow::MultiSelectWindow($config,"Blocklists"); + MultiSelectWindow::MultiSelectWindow($config, "Blocklists", "gofax"); $this->parent = $parent; $this->ui = get_userinfo(); diff --git a/plugins/gofax/faxaccount/class_gofaxAccount.inc b/plugins/gofax/faxaccount/class_gofaxAccount.inc index 78102e860..5aa2b8bc2 100644 --- a/plugins/gofax/faxaccount/class_gofaxAccount.inc +++ b/plugins/gofax/faxaccount/class_gofaxAccount.inc @@ -337,8 +337,7 @@ class gofaxAccount extends plugin } $base= $faxfilter['depselect']; - $acl= array($this->config->current['BASE'] => ":all"); - $res= get_list("(&(objectClass=goFaxAccount)$filter)", $acl, $base, + $res= get_list("(&(objectClass=goFaxAccount)$filter)", "gofax", $base, array("sn", "givenName", "facsimileTelephoneNumber"), GL_SIZELIMIT | GL_SUBSEARCH); foreach ($res as $attrs){ diff --git a/plugins/gofon/conference/class_divListConferences.inc b/plugins/gofon/conference/class_divListConferences.inc index 8d40cba52..37912ed17 100755 --- a/plugins/gofon/conference/class_divListConferences.inc +++ b/plugins/gofon/conference/class_divListConferences.inc @@ -22,7 +22,7 @@ class divListConference extends MultiSelectWindow function divListConference ($config,$parent) { - MultiSelectWindow::MultiSelectWindow($config,"Conferences"); + MultiSelectWindow::MultiSelectWindow($config,"Conferences", "gofon"); $this->parent = $parent; $this->ui = get_userinfo(); diff --git a/plugins/gofon/conference/class_phoneConferenceManagment.inc b/plugins/gofon/conference/class_phoneConferenceManagment.inc index 0be3ec8e6..1bfb9b2f8 100644 --- a/plugins/gofon/conference/class_phoneConferenceManagment.inc +++ b/plugins/gofon/conference/class_phoneConferenceManagment.inc @@ -299,7 +299,7 @@ class phoneConferenceManagment extends plugin $Flags |= GL_SUBSEARCH; } - $this->conferences= get_list($Filter, $this->ui->subtreeACL, $Base, $Attrs, $Flags); + $this->conferences= get_list($Filter, "gofon", $Base, $Attrs, $Flags); } function remove_from_parent() diff --git a/plugins/gofon/macro/class_divListMacros.inc b/plugins/gofon/macro/class_divListMacros.inc index 284c939ad..5ffdd1447 100755 --- a/plugins/gofon/macro/class_divListMacros.inc +++ b/plugins/gofon/macro/class_divListMacros.inc @@ -22,7 +22,7 @@ class divListMacro extends MultiSelectWindow function divListMacro ($config,$parent) { - MultiSelectWindow::MultiSelectWindow($config,"Macros"); + MultiSelectWindow::MultiSelectWindow($config,"Macros", "gofon"); $this->parent = $parent; $this->ui = get_userinfo(); diff --git a/plugins/gofon/macro/class_gofonMacroManagement.inc b/plugins/gofon/macro/class_gofonMacroManagement.inc index aab1648bd..1f3bd1e3e 100755 --- a/plugins/gofon/macro/class_gofonMacroManagement.inc +++ b/plugins/gofon/macro/class_gofonMacroManagement.inc @@ -323,7 +323,7 @@ class gofonMacro extends plugin } /* Generate macro list */ - $res= get_list($Filter, $this->ui->subtreeACL,$base, $Attrs, $Flags); + $res= get_list($Filter, "gofon", $base, $Attrs, $Flags); $tmp=array(); foreach($res as $tkey => $val ){ diff --git a/plugins/personal/mail/class_mailAccount.inc b/plugins/personal/mail/class_mailAccount.inc index 3742daba5..6b9ae99fa 100644 --- a/plugins/personal/mail/class_mailAccount.inc +++ b/plugins/personal/mail/class_mailAccount.inc @@ -441,7 +441,7 @@ class mailAccount extends plugin } $acl= array($this->config->current['BASE'] => ":all"); - $res= get_list("(&(objectClass=gosaMailAccount)$filter)", $acl, $mailfilter['depselect'], + $res= get_list("(&(objectClass=gosaMailAccount)$filter)", "users", $mailfilter['depselect'], array("sn", "mail", "givenName"), GL_SIZELIMIT | GL_SUBSEARCH); $ldap->cd($mailfilter['depselect']); $ldap->search ("(&(objectClass=gosaMailAccount)$filter)", array("sn", "mail", "givenName")); diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc index a67d03b95..d2fa156ae 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -226,8 +226,6 @@ class posixAccount extends plugin /* execute generates the html output for this node */ function execute($isCopyPaste = false) { - echo "Fix get_list for group add"; - /* Call parent execute */ plugin::execute(); $display= ""; @@ -377,10 +375,9 @@ class posixAccount extends plugin if ($exclude != ""){ $exclude= "(!(|$exclude))"; } - $acl= array($this->config->current['BASE'] => ":all"); $regex= $sysfilter['regex']; $filter= "(&(|(objectClass=goServer)(objectClass=gotoWorkstation)(objectClass=gotoTerminal))$exclude(cn=*)(cn=$regex))"; - $res= get_list($filter, $acl, $sysfilter['depselect'], array("cn"), GL_SUBSEARCH | GL_SIZELIMIT); + $res= get_list($filter, "groups", $sysfilter['depselect'], array("cn"), GL_SUBSEARCH | GL_SIZELIMIT); $wslist= array(); foreach ($res as $attrs){ $wslist[]= preg_replace('/\$/', '', $attrs['cn'][0]); @@ -530,6 +527,7 @@ class posixAccount extends plugin } } else { if ($_SESSION['js']){ +#FIXME: whats up here. remove acl? if($this->acl != "#none#") $smarty->assign("forceMode", "disabled"); } @@ -1134,8 +1132,7 @@ class posixAccount extends plugin $base = get_groups_ou().$base; } - - $res= get_list($filter, $this->ui->subtreeACL, $base,$attrs, $Flags); + $res= get_list($filter, "groups", $base,$attrs, $Flags); /* check sizelimit */ if (preg_match("/size limit/i", $ldap->error)){ diff --git a/plugins/personal/samba/class_sambaAccount.inc b/plugins/personal/samba/class_sambaAccount.inc index 219866734..2d851a2cc 100644 --- a/plugins/personal/samba/class_sambaAccount.inc +++ b/plugins/personal/samba/class_sambaAccount.inc @@ -324,10 +324,9 @@ class sambaAccount extends plugin if ($exclude != ""){ $exclude= "(!(|$exclude))"; } - $acl= array($this->config->current['BASE'] => ":all"); $regex= $sambafilter['regex']; $filter= "(&(objectClass=sambaSAMAccount)$exclude(uid=*$)(|(uid=$regex)(cn=$regex)))"; - $res= get_list($filter, $acl, $sambafilter['depselect'], array("uid"), GL_SUBSEARCH | GL_SIZELIMIT); + $res= get_list($filter, "workstation", $sambafilter['depselect'], array("uid"), GL_SUBSEARCH | GL_SIZELIMIT); $wslist= array(); foreach ($res as $attrs){ $wslist[]= preg_replace('/\$/', '', $attrs['uid'][0]); -- 2.30.2