summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e611f26)
raw | patch | inline | side by side (parent: e611f26)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 23 Oct 2006 03:51:47 +0000 (03:51 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 23 Oct 2006 03:51:47 +0000 (03:51 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4913 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/admin/fai/class_faiPartitionTable.inc b/plugins/admin/fai/class_faiPartitionTable.inc
index 5aecea0650639d962e4f3bcab7baab549dede221..5ace0cba5429e5f82528e969096116d8f6fbeec7 100644 (file)
var $dialog = NULL; // a dialog, e.g. new disk dialog
var $FAIstate = "";
+ var $ui;
function faiPartitionTable ($config, $dn= NULL)
{
$this->acl ="#all#";
+ $this->ui = get_userinfo();
+
/* If "dn==new" we try to create a new entry
* Else we must read all objects from ldap which belong to this entry.
* First read disks from ldap ... and then the partition definitions for the disks.
if($dn != "new"){
$this->dn =$dn;
- /* Set acls
- */
- $ui = get_userinfo();
- $acl = get_permissions ($this->dn, $ui->subtreeACL);
- $acli = get_module_permission($acl, "FAIclass", $this->dn);
- $this->acl=$acli;
-
/* Get FAIstate
*/
if(isset($this->attrs['FAIstate'][0])){
ksort($this->disks);
}
+
+ function acl_base_for_current_object($dn)
+ {
+ if($dn == "new"){
+ if($this->dn == "new"){
+ $dn= $_SESSION['CurrentMainBase'];
+ }else{
+ $dn = $this->dn;
+ }
+ }
+ return($dn);
+ }
+
+
function execute()
{
/* Call parent execute */
$usedDiskNames[]= $key;
}
$this->dialog = new faiPartitionTableEntry($this->config,$this->dn,$usedDiskNames);
- $this->dialog->acl = $this->acl;
+ $this->dialog->set_acl_base($this->acl_base_for_current_object($obj['dn']));
+ $this->dialog->set_acl_category("fai");
$this->dialog->FAIstate = $this->FAIstate;
$this->is_dialog = true;
}
}
}
$this->dialog = new faiPartitionTableEntry($this->config,$this->dn,$usedDiskNames,$this->disks[$Udisk]);
- $this->dialog->acl = $this->acl;
+ $this->dialog->set_acl_base($this->acl_base_for_current_object($obj['dn']));
+ $this->dialog->set_acl_category("fai");
$this->dialog->FAIstate = $this->FAIstate;
/* Set object info string, which will be displayed in plugin info line */
}
}
- foreach($this->attributes as $attr){
- $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
+ $dn = $this->acl_base_for_current_object($this->dn);
+ $smarty->assign("sub_object_is_addable",
+ preg_match("/c/",$this->ui->get_permissions($dn,"fai/faiScriptEntry")) &&
+ !preg_match("/freeze/",$this->FAIstate));
+
+ $tmp = $this->plInfo();
+ foreach($tmp['plProvidedAcls'] as $name => $translated){
+ $smarty->assign($name."ACL",$this->getacl($name));
}
$disks = $this->getDisks();
"plSection" => array("administration"),
"plCategory" => array("fai"),
"plProvidedAcls" => array(
- "cn" => _("Name"),
- "FAIpartitionType" => _("Partition type"),
- "FAIpartitionNr" => _("Partition no."),
- "FAIfsType" => _("File system type"),
- "FAImountPoint" => _("Mount point"),
- "FAIpartitionSize" => _("Partition size"),
- "FAImountOptions" => _("Mount options"),
- "FAIfsOptions" => _("File system options"),
- "FAIpartitionFlags" => _("Partition flags"))
+ "cn" => _("Name")." ("._("Read only").")",
+ "description" => _("Description"))
));
}
}
diff --git a/plugins/admin/fai/class_faiPartitionTableEntry.inc b/plugins/admin/fai/class_faiPartitionTableEntry.inc
index cc2c0619c966a059d67f13eb06aaa35dfa0fda1a..9a3804a7e5b3a42d0204bb13b0492e547223a729 100644 (file)
return ($message);
}
+
+
+
+ /* Return plugin informations for acl handling */
+ function plInfo()
+ {
+ return (array(
+ "plShortName" => _("Partition table entry"),
+ "plDescription" => _("FAI partition table entry"),
+ "plSelfModify" => FALSE,
+ "plDepends" => array(),
+ "plPriority" => 27,
+ "plSection" => array("administration"),
+ "plCategory" => array("fai"),
+ "plProvidedAcls" => array(
+ "cn" => _("Name"),
+ "description" => _("Description"),
+ "FAIpartitionType" => _("Partition type"),
+ "FAIpartitionNr" => _("Partition no."),
+ "FAIfsType" => _("File system type"),
+ "FAImountPoint" => _("Mount point"),
+ "FAIpartitionSize" => _("Partition size"),
+ "FAImountOptions" => _("Mount options"),
+ "FAIfsOptions" => _("File system options"),
+ "FAIpartitionFlags" => _("Partition flags"))
+ ));
+ }
+
}
diff --git a/plugins/admin/fai/class_faiTemplateEntry.inc b/plugins/admin/fai/class_faiTemplateEntry.inc
index 24bab5d1311f3d4239325e13b4e5de9c06ffd68d..b2a70eec483c172d8a1b654bd46c8c7644446a19 100644 (file)
$smarty->assign($attr."ACL",$this->getacl($attr,preg_match("/freeze/",$this->FAIstate)));
}
- $display.= "<h2><font color='red'>Fix / problen and ensure that size and content are correct if you download this template. Revision > 4582 (gosa-2.5 is already patched)</font></h2>".$smarty->fetch(get_template_path('faiTemplateEntry.tpl', TRUE));
+ $display.= $smarty->fetch(get_template_path('faiTemplateEntry.tpl', TRUE));
return($display);
}