summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e6523e6)
raw | patch | inline | side by side (parent: e6523e6)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 17 Jul 2008 09:04:51 +0000 (09:04 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 17 Jul 2008 09:04:51 +0000 (09:04 +0000) |
-Updated ACL handling for Hooks && profiles
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11698 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11698 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-plugins/fai/admin/fai/class_faiHook.inc b/gosa-plugins/fai/admin/fai/class_faiHook.inc
index eb9d837fef25a8301bbd6cbf0c5f7967c9130974..6dbbf3ad326ce2b2f363e0f5f653273b1265d8a5 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->FAIstate = $this->FAIstate;
$this->dialog->set_acl_base($this->acl_base_for_current_object($obj['dn']));
$this->dialog->set_acl_category("fai");
$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;
$c_dn = $this->acl_base_for_current_object($this->dn);
$this->dialog= new $this->subClassName($this->config,"new");
$this->dialog->set_acl_base($c_dn);
+ $this->dialog->FAIstate = $this->FAIstate;
$this->dialog->set_acl_category("fai");
$this->dialog->parent = &$this;
$this->is_dialog=true;
diff --git a/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc b/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc
index fd983aecaf50d8859f5cdf5b8985c687f15a1557..2fcff5700f066bb83405e6d4f740d552236d8506 100644 (file)
$oname = $name;
$this->$oname=$value;
}
-
- if(isset($this->attrs['FAIstate'][0])){
- $this->FAIstate = $this->attrs['FAIstate'][0];
- }
-
}elseif(is_array($object)){
if(count($object)){
$this->orig_cn= $object['cn'];
$tmp = $this->plInfo();
foreach($tmp['plProvidedAcls'] as $name => $translated){
- $acl = $this->getacl($name);
- if($this->FAIstate == "freezed"){
- $acl = preg_replace("/w/","",$acl);
- }
+ $acl = $this->getacl($name, preg_match("/freeze/",$this->FAIstate));
$smarty->assign($name."ACL",$acl);
}
}else{
$smarty->assign("FAIscript" , htmlentities($this->FAIscript));
}
+ $smarty->assign("freeze" , preg_match("/freeze/",$this->FAIstate));
$display.= $smarty->fetch(get_template_path('faiHookEntry.tpl', TRUE));
return($display);
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiProfile.inc b/gosa-plugins/fai/admin/fai/class_faiProfile.inc
index b7792ca1004cdbafab82373cb82e1faed394ff9e..9465d1e4b94be81f6388a1845a35e3b246743320 100644 (file)
}
}
- if(isset($this->attrs['FAIstate'][0])){
- $this->FAIstate = $this->attrs['FAIstate'][0];
- }
-
/* Sort assigned classes */
if(is_array($tmp2)){
foreach($tmp2 as $class){
/* Remove class name From list */
$sort_once = false;
- foreach($_POST as $name => $post){
- if(preg_match("/DEL_/i",$name) && $this->acl_is_writeable("FAIclass")){
- $s_action = "delete";
- $s_entry = preg_replace("/DEL_/","",$name);
- $s_entry = base64_decode(preg_replace("/_.*$/","",$s_entry));
- }elseif(preg_match("/Add_class/i",$name)&& $this->acl_is_writeable("FAIclass")){
- $s_action = "add";
- }elseif(preg_match("/DelClass/i",$name) && $this->acl_is_writeable("FAIclass")){
- $s_action = "delete";
- $s_entry = $_POST['FAIclass'];
- }elseif(preg_match("/AddClass/i",$name) && $this->acl_is_writeable("FAIclass")){
- $s_action = "add";
- }
+ if(!preg_match("/freeze/",$this->FAIstate)){
+ foreach($_POST as $name => $post){
+ if(preg_match("/DEL_/i",$name) && $this->acl_is_writeable("FAIclass")){
+ $s_action = "delete";
+ $s_entry = preg_replace("/DEL_/","",$name);
+ $s_entry = base64_decode(preg_replace("/_.*$/","",$s_entry));
+ }elseif(preg_match("/Add_class/i",$name)&& $this->acl_is_writeable("FAIclass")){
+ $s_action = "add";
+ }elseif(preg_match("/DelClass/i",$name) && $this->acl_is_writeable("FAIclass")){
+ $s_action = "delete";
+ $s_entry = $_POST['FAIclass'];
+ }elseif(preg_match("/AddClass/i",$name) && $this->acl_is_writeable("FAIclass")){
+ $s_action = "add";
+ }
- /* Check if a list element should be pushed one position up */
- if((preg_match("/sortup_/",$name))&&(!$sort_once) && $this->acl_is_writeable("FAIclass")){
- $sort_once = true;
- $val = preg_replace("/sortup_/","",$name);
- $val = preg_replace("/_.*$/","",$val);
- $val = base64_decode($val);
- $this->catUp($val);
- }
-
- /* Check if a list element should be pushed one position down */
- if((preg_match("/sortdown_/",$name))&&(!$sort_once) && $this->acl_is_writeable("FAIclass")){
- $sort_once = true;
- $val = preg_replace("/sortdown_/","",$name);
- $val = preg_replace("/_.*$/","",$val);
- $val = base64_decode($val);
- $this->catDown($val);
- }
+ /* Check if a list element should be pushed one position up */
+ if((preg_match("/sortup_/",$name))&&(!$sort_once) && $this->acl_is_writeable("FAIclass")){
+ $sort_once = true;
+ $val = preg_replace("/sortup_/","",$name);
+ $val = preg_replace("/_.*$/","",$val);
+ $val = base64_decode($val);
+ $this->catUp($val);
+ }
- }
+ /* Check if a list element should be pushed one position down */
+ if((preg_match("/sortdown_/",$name))&&(!$sort_once) && $this->acl_is_writeable("FAIclass")){
+ $sort_once = true;
+ $val = preg_replace("/sortdown_/","",$name);
+ $val = preg_replace("/_.*$/","",$val);
+ $val = base64_decode($val);
+ $this->catDown($val);
+ }
- if($s_action == "delete" && $this->acl_is_writeable("FAIclass")){
- unset($this->FAIclasses[$s_entry]);
- }
+ }
- if($s_action == "add" && $this->acl_is_writeable("FAIclass")){
- $this->dialog = new faiProfileEntry($this->config,$this->dn,$this->FAIclasses,$this->parent->parent->fai_release);
- $this->is_dialog =true;
- }
+ if($s_action == "delete" && $this->acl_is_writeable("FAIclass")){
+ unset($this->FAIclasses[$s_entry]);
+ }
- /* Save Dialog */
- if(isset($_POST['SaveSubObject'])){
- $this->dialog->save_object();
- $msgs= $this->dialog->check();
- if(count($msgs)){
- msg_dialog::display(_("Error"), $msgs, ERROR_DIALOG);
- }else{
- $ret = $this->dialog->save();
- foreach($ret as $class){
- $this->FAIclasses[$class] =$class;
+ if($s_action == "add" && $this->acl_is_writeable("FAIclass")){
+ $this->dialog = new faiProfileEntry($this->config,$this->dn,$this->FAIclasses,$this->parent->parent->fai_release);
+ $this->is_dialog =true;
+ }
+
+ /* Save Dialog */
+ if(isset($_POST['SaveSubObject'])){
+ $this->dialog->save_object();
+ $msgs= $this->dialog->check();
+ if(count($msgs)){
+ msg_dialog::display(_("Error"), $msgs, ERROR_DIALOG);
+ }else{
+ $ret = $this->dialog->save();
+ foreach($ret as $class){
+ $this->FAIclasses[$class] =$class;
+ }
+ $this->is_dialog=false;
+ unset($this->dialog);
+ $this->dialog=FALSE;
+ //ksort($this->FAIclasses);
}
- $this->is_dialog=false;
- unset($this->dialog);
- $this->dialog=FALSE;
- //ksort($this->FAIclasses);
}
}
}
}
+ $smarty->assign("freeze", preg_match("/freeze/i",$this->FAIstate));
+
$smarty->assign("FAIclasses" ,$this->FAIclasses);
$smarty->assign("divlist" ,$divlist->DrawList());
$tmp = $this->plInfo();
foreach($tmp['plProvidedAcls'] as $name => $translated){
- $smarty->assign($name."ACL",$this->getacl($name));
+ $smarty->assign($name."ACL",$this->getacl($name, preg_match("/freeze/",$this->FAIstate)));
}
$display.= $smarty->fetch(get_template_path('faiProfile.tpl', TRUE));
*/
function save_object()
{
- plugin::save_object();
+ if(!preg_match("/freeze/",$this->FAIstate)){
+ plugin::save_object();
+ }
}
diff --git a/gosa-plugins/fai/admin/fai/faiHookEntry.tpl b/gosa-plugins/fai/admin/fai/faiHookEntry.tpl
index e8d2b14db4646c79ca8373a37df08fb96441c597..2040cba682b7c23fc115b2dddbe2b2c0e5687749 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>
<!-- Place cursor -->