summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 966a556)
raw | patch | inline | side by side (parent: 966a556)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 26 Jul 2006 13:16:58 +0000 (13:16 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 26 Jul 2006 13:16:58 +0000 (13:16 +0000) |
* Added global catch all acl
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4318 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4318 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/include/class_acl.inc b/include/class_acl.inc
index 8103ba16e8e4a756dfbf215a447f9113d656eeef..dbb17540841721f9fc73cdbc88b7a52f4879aab2 100644 (file)
--- a/include/class_acl.inc
+++ b/include/class_acl.inc
var $currentIndex= 0;
var $wasNewEntry= FALSE;
var $ocMapping= array();
- var $multiClass= array();
var $savedAclContents= array();
/* Only feed categories */
if (isset($acls['plCategory'])){
- /* Find multi homed classes */
- if (count($acls['plCategory']) > 1){
- $this->multiClass[$class]= $class;
- }
-
/* Walk through supplied list and feed only translated categories */
foreach($acls['plCategory'] as $idx => $data){
if (is_array($data['objectClass'])){
foreach($data['objectClass'] as $objectClass){
if (in_array_ics($objectClass, $oc)){
- if (isset($this->multiClass[$class])){
- $this->myAclObjects[$idx.'/'.$class]= $acls['plDescription'];
- } else {
- $this->myAclObjects[$class]= $acls['plDescription'];
- }
+ $this->myAclObjects[$idx.'/'.$class]= $acls['plDescription'];
break;
}
}
} else {
if (in_array_ics($data['objectClass'], $oc)){
- if (isset($this->multiClass[$class])){
- $this->myAclObjects[$idx.'/'.$class]= $acls['plDescription'];
- } else {
- $this->myAclObjects[$class]= $acls['plDescription'];
- }
+ $this->myAclObjects[$idx.'/'.$class]= $acls['plDescription'];
}
}
}
}
}
}
+ $this->aclObjects['all']= '* '._("All categories");
+ $this->ocMapping['all']= array('0' => '0');
/* Sort categories */
asort($this->aclObjects);
$smarty->assign('headline', sprintf(_("Edit ACL for '%s', scope is '%s'"), $this->aclObjects[$this->aclObject], $this->aclTypes[$this->aclType]));
/* Collect objects for selected category */
- $aclObjects= array();
foreach ($this->ocMapping[$this->aclObject] as $idx => $class){
if ($idx == 0){
continue;
}
- if (isset($this->multiClass[$class])){
- $aclObjects[$this->aclObject.'/'.$class]= $plist[$class]['plDescription'];
- } else {
- $aclObjects[$class]= $plist[$class]['plDescription'];
- }
+ $aclObjects[$this->aclObject.'/'.$class]= $plist[$class]['plDescription'];
+ }
+ if ($this->aclObject == 'all'){
+ $aclObjects['all']= _("All objects in current subtree");
}
$smarty->assign('aclSelector', $this->buildAclSelector($aclObjects));
}
index 81048f1489f1ebbab93de532877844fa1e989752..c29dfde116dffe04c1fbd6f56ce917609ff0a3ea 100644 (file)
$this->info[$cname]= @call_user_func(array($cname, 'plInfo'));
}
}
+
+ /* Provide field for 'all' */
+ $this->info['all']= array();
+ $this->info['all']['plProvidedAcls']= array();
+ $this->info['all']['plDescription']= _("All objects in this category");
+ $this->info['all']['plSelfModify']= FALSE;
}
function get_plugins($list, $config)
diff --git a/include/class_tabs.inc b/include/class_tabs.inc
index 777c87426e2bc6cb27017eb2f84182c2cc00daed..78147cd0fa6332c23b400a2319e017b6d90e3f28 100644 (file)
--- a/include/class_tabs.inc
+++ b/include/class_tabs.inc
var $by_object= array();
var $SubDialog = false;
- function tabs($config, $data, $dn)
+ function tabs($config, $data, $dn, $acl_category= "")
{
/* Save dn */
$this->dn= $dn;
$this->by_name[$tab['CLASS']]= $tab['NAME'];
$this->by_object[$tab['CLASS']]= new $tab['CLASS']($this->config, $this->dn);
$this->by_object[$tab['CLASS']]->parent= &$this;
+ $this->by_object[$tab['CLASS']]->set_acl_category($acl_category);
/* Initialize current */
if ($this->current == ""){
$this->current= $tab['CLASS'];
}
}
-
}
function execute()
index 737bde73f22221a1750de0b1f5180b2571a73e13..20c48209b71ac4c6758286d5017793afa2891d45 100644 (file)
function get_permissions($dn, $object, $attribute, $skip_write= FALSE)
{
- $acl= array("r" => "", "w" => "", "c" => "", "d" => "", "m" => "");
+ $acl= array("r" => "", "w" => "", "c" => "", "d" => "", "m" => "", "a" => "");
/* Build dn array */
$path= split(',', $dn);
}
/* Global ACL? */
- if (isset($subacl['acl'][0])){
- $acl= $this->mergeACL($acl, $subacl['type'], preg_replace('/[cdm]/', '', $subacl['acl'][0]));
+ if (isset($subacl['acl']['all'])){
+ $acl= $this->mergeACL($acl, $subacl['type'], preg_replace('/[cdm]/', '', $subacl['acl']['all'][0]));
continue;
}
$ldap->cd($this->config->current['BASE']);
$ldap->search('objectClass=gosaDepartment', array('dn'));
while ($attrs= $ldap->fetch()){
- $acl= array("r" => "", "w" => "", "c" => "", "d" => "", "m" => "");
+ $acl= array("r" => "", "w" => "", "c" => "", "d" => "", "m" => "", "a" => "");
/* Build dn array */
$path= split(',', $attrs['dn']);
index c3d726f1e9a92dd596ec1488fa549c2d83b5fdcc..ce7cf00fbc4b33c54b84e9b1cd67895fa7cec1cb 100644 (file)
function usertabs($config, $data, $dn)
{
- tabs::tabs($config, $data, $dn);
+ tabs::tabs($config, $data, $dn, 'users');
$this->base= $this->by_object['user']->base;
/* Add references/acls/snapshots */
$this->addSpecialTabs();
$this->set_acl_base();
-
- /* Set category for environment tab */
- if (isset($this->by_object['environment'])){
- $this->by_object['environment']->set_acl_category('users');
- }
}
function save_object($save_current= FALSE)