From fe030b22bb09d7a717b8baab13e2c113d1443f2f Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 14 Jul 2006 11:05:44 +0000 Subject: [PATCH] * Corrected class name * added support for multiple object class dependencies git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4158 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_acl.inc | 83 ++++++++++++++++--- .../environment/class_environment.inc | 2 +- 2 files changed, 73 insertions(+), 12 deletions(-) diff --git a/include/class_acl.inc b/include/class_acl.inc index cbd8a0c19..91a5dc569 100644 --- a/include/class_acl.inc +++ b/include/class_acl.inc @@ -102,12 +102,27 @@ class acl extends plugin if (isset($acls['plDescription'])){ /* Only feed categories */ if (isset($acls['plDepends']['description'])){ - $this->aclObjects[$acls['plDepends']['objectClass']]= $acls['plDepends']['description']; + if (is_array($acls['plDepends']['objectClass'])){ + foreach($acls['plDepends']['objectClass'] as $oc){ + $this->aclObjects[$oc]= $acls['plDepends']['description']; + } + } else { + $this->aclObjects[$acls['plDepends']['objectClass']]= $acls['plDepends']['description']; + } } /* Additionally filter the classes we're interested in in "self edit" mode */ - if (in_array_ics($acls['plDepends']['objectClass'], $oc)){ - $this->myAclObjects[$class]= $acls['plDescription']; + if (is_array($acls['plDepends']['objectClass'])){ + foreach($acls['plDepends']['objectClass'] as $hoc){ + if (in_array_ics($hoc, $oc)){ + $this->myAclObjects[$class]= $acls['plDescription']; + break; + } + } + } else { + if (in_array_ics($acls['plDepends']['objectClass'], $oc)){ + $this->myAclObjects[$class]= $acls['plDescription']; + } } } } @@ -118,12 +133,20 @@ class acl extends plugin /* Generate mapping object */ foreach ($plist as $oc => $pl){ if (isset($pl['plDepends']['objectClass'])){ - $class= $pl['plDepends']['objectClass']; - if (!isset($this->ocMapping[$class])){ - $this->ocMapping[$class]= array(); - $this->ocMapping[$class][]= '0'; + if (is_array($pl['plDepends']['objectClass'])){ + foreach($pl['plDepends']['objectClass'] as $class){ + if (!isset($this->ocMapping[$class])){ + $this->ocMapping[$class]= array(); + } + $this->ocMapping[$class][]= $oc; + } + } else { + $class= $pl['plDepends']['objectClass']; + if (!isset($this->ocMapping[$class])){ + $this->ocMapping[$class]= array(); + } + $this->ocMapping[$class][]= $oc; } - $this->ocMapping[$class][]= $oc; } } @@ -423,8 +446,19 @@ class acl extends plugin $aclObjects= array(); foreach ($plist as $class => $acls){ - if (isset($acls['plDepends']['objectClass']) && $acls['plDepends']['objectClass'] == $this->aclObject){ - $aclObjects[$class]= $acls['plDescription']; + if (isset($acls['plDepends']['objectClass'])){ + if (is_array($acls['plDepends']['objectClass'])){ + foreach($acls['plDepends']['objectClass'] as $coc){ + if ($coc == $this->aclObject){ + $aclObjects[$class]= $acls['plDescription']; + break; + } + } + } else { + if ($acls['plDepends']['objectClass'] == $this->aclObject){ + $aclObjects[$class]= $acls['plDescription']; + } + } } } @@ -441,11 +475,38 @@ class acl extends plugin function buildAclSelector($list) { $display= ""; - $cols= 4; + $cols= 3; $tmp= get_global('plist'); $plist= $tmp->info; asort($plist); + /* Generate global options */ +# $key= "global"; +# $display.= ""; +# +# $spc= "  "; +# if ($this->isContainer && $this->aclType != 'base'){ +# $options= $this->mkchkbx($key."_0_c", _("Create objects"), preg_match('/c/', $currentAcl[0])).$spc; +# $options.= $this->mkchkbx($key."_0_m", _("Move objects"), preg_match('/m/', $currentAcl[0])).$spc; +# $options.= $this->mkchkbx($key."_0_d", _("Remove objects"), preg_match('/d/', $currentAcl[0])).$spc; +# if ($plist[$key]['plSelfModify']){ +# $options.= $this->mkchkbx($key."_0_s", _("Modifyable by owner"), preg_match('/s/', $currentAcl[0])).$spc; +# } +# } else { +# $options= $this->mkchkbx($key."_0_m", _("Move object"), preg_match('/m/', $currentAcl[0])).$spc; +# $options.= $this->mkchkbx($key."_0_d", _("Remove object"), preg_match('/d/', $currentAcl[0])).$spc; +# if ($plist[$key]['plSelfModify']){ +# $options.= $this->mkchkbx($key."_0_s", _("Modifyable by owner"), preg_match('/s/', $currentAcl[0])).$spc; +# } +# } +# +# /* Global options */ +# $more_options= $this->mkchkbx($key."_0_r", _("read"), preg_match('/r/', $currentAcl[0])).$spc; +# $more_options.= $this->mkchkbx($key."_0_w", _("write"), preg_match('/w/', $currentAcl[0])); +# +# $display.= "
"._("All objects of this category")."
$options ".("Complete object:")." $more_options

"; + + /* Build general objects */ foreach ($list as $key => $name){ /* Create sub acl if it does not exist */ diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index b46079a63..784fca967 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -1251,7 +1251,7 @@ function printOutHotPlugDevices() { return (array("plDescription" => _("Environment settings"), "plSelfModify" => TRUE, - "plDepends" => array("objectClass" => "gotoAccount"), + "plDepends" => array("objectClass" => array("gosaAccount", "posixGroup")), "gotoProfileServer" => _("Profile server") , "gotoProfileFlag_L" => "FIXME"._("Resolution changeable during session") , // These variable are flags -- 2.30.2