summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bc145d1)
raw | patch | inline | side by side (parent: bc145d1)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 17 Jul 2008 09:18:41 +0000 (09:18 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 17 Jul 2008 09:18:41 +0000 (09:18 +0000) |
-Updated ACL checks and freezed object handling.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11699 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11699 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplate.inc b/gosa-plugins/fai/admin/fai/class_faiTemplate.inc
index 76fdcfaec749128fc9f4c3b0b8e39600c4baac65..75ee77434948fb8f7fcae7108fac6ade8be0e479 100644 (file)
if($dn != "new"){
$this->dn =$dn;
- /* Get FAIstate
- */
- if(isset($this->attrs['FAIstate'][0])){
- $this->FAIstate = $this->attrs['FAIstate'][0];
- }
-
/* Read all leaf objects of this object (For FAIscript this would be FAIscriptEntry)
*/
$ldap = $this->config->get_ldap_link();
}
$this->dialog= new $this->subClassName($this->config,$this->dn,$obj);
$this->dialog->set_acl_base($this->acl_base);
+ $this->dialog->FAIstate = $this->FAIstate;
$this->dialog->set_acl_category("fai");
session::set('objectinfo',$obj['dn']);
$this->is_dialog=true;
}
}
- if(preg_match("/^deletescript_/",$name)&&($once)){
+ if(preg_match("/^deletescript_/",$name)&&($once) && !preg_match("/freeze/",$this->FAIstate)){
$once = false;
$entry = preg_replace("/^deletescript_/","",$name);
$entry = base64_decode(preg_replace("/_.*/","",$entry));
$obj = $this->get_object_attributes($obj,$this->sub_Load_Later);
}
$this->dialog= new $this->subClassName($this->config,$this->dn,$obj);
+ $this->dialog->FAIstate = $this->FAIstate;
$this->dialog->acl = $this->acl;
session::set('objectinfo',$obj['dn']);
$this->dialog->parent = &$this;
}
/* Add new sub object */
- if(isset($_POST['AddSubObject'])){
+ if(isset($_POST['AddSubObject']) && !preg_match("/freeze/",$this->FAIstate)){
$acl_dn = "cn=dummy,".$this->acl_base_for_current_object($this->dn);
$acl = $this->ui->get_permissions($acl_dn,"fai/faiTemplateEntry");
if(preg_match("/c/",$acl)){
$this->dialog= new $this->subClassName($this->config,"new");
$this->dialog->set_acl_base($this->acl_base);
+ $this->dialog->FAIstate = $this->FAIstate;
$this->dialog->set_acl_category("fai");
$this->dialog->parent = &$this;
$this->is_dialog=true;
!preg_match("/freeze/",$this->FAIstate));
foreach($this->attributes as $attr){
- $smarty->assign($attr."ACL",$this->getacl($attr));
+ $smarty->assign($attr."ACL",$this->getacl($attr, preg_match("/freeze/",$this->FAIstate)));
}
$display.= $smarty->fetch(get_template_path('faiTemplate.tpl', TRUE));
diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc b/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc
index 0d288b1bc1107623e4f77b45fc1b6e99da0bb410..85f3ea6f818af26621377961690a58dabae6e966 100644 (file)
$oname = $name;
$this->$oname=$value;
}
-
- if(isset($this->attrs['FAIstate'][0])){
- $this->FAIstate = $this->attrs['FAIstate'][0];
- }
-
}else{
$this->status = "new";
$this->orig_cn= false;
/* We now split cn/FAItemplatePath to make things more clear... */
$smarty->assign("cn", basename($this->FAItemplatePath));
$smarty->assign("templatePath", dirname($this->FAItemplatePath));
+ $smarty->assign("freeze", preg_match("/freeze/i",$this->FAIstate));;
$display.= $smarty->fetch(get_template_path('faiTemplateEntry.tpl', TRUE));
return($display);
}
if(!preg_match('/^\//', $this->FAItemplatePath)){
- $message[]= msgPool::invalid(_("Destination path"),$this->FAItemplatePath,'/^\//');
+ $message[]= msgPool::invalid(_("Destination path"),"","","/path");
}
$b = basename($this->FAItemplatePath);
diff --git a/gosa-plugins/fai/admin/fai/faiTemplateEntry.tpl b/gosa-plugins/fai/admin/fai/faiTemplateEntry.tpl
index a6a1dd4165d261a01ca8f19cbb73cce5e0670702..e13d95c0a886a60546da02b075b4bf8d54771ad7 100644 (file)
<p class="seperator"> </p>
<br>
<div style="align:right;" align="right">
+{if !$freeze}
<input type="submit" value="{msgPool type=applyButton}" name="SaveSubObject">
+{/if}
<input type="submit" value="{msgPool type=cancelButton}" name="CancelSubObject">
</div>
</td>