From d24f7243e0898ecfaea78eb0e70f67236728e658 Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 25 Oct 2006 07:39:54 +0000 Subject: [PATCH] Updated files git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4937 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../blocklists/class_blocklistManagement.inc | 2 +- .../macro/class_gofonMacroParameters.inc | 89 +++++++++++-------- plugins/gofon/macro/parameter.tpl | 5 +- 3 files changed, 57 insertions(+), 39 deletions(-) diff --git a/plugins/gofax/blocklists/class_blocklistManagement.inc b/plugins/gofax/blocklists/class_blocklistManagement.inc index efe792ca8..ef2332d83 100644 --- a/plugins/gofax/blocklists/class_blocklistManagement.inc +++ b/plugins/gofax/blocklists/class_blocklistManagement.inc @@ -295,7 +295,7 @@ class blocklist extends plugin } /* Fill templating stuff */ - $smarty->assign("bases", $this->config->idepartments); + $smarty->assign("bases", $this->get_allowed_bases()); $smarty->assign("base_select", $this->base); $smarty->assign("types", array(0 => _("send"), 1 => _("receive"))); if ($this->dn == "new" || preg_match ("/,ou=incoming,/", $this->dn)){ diff --git a/plugins/gofon/macro/class_gofonMacroParameters.inc b/plugins/gofon/macro/class_gofonMacroParameters.inc index 4815c6e22..5a1aacfc0 100755 --- a/plugins/gofon/macro/class_gofonMacroParameters.inc +++ b/plugins/gofon/macro/class_gofonMacroParameters.inc @@ -175,14 +175,20 @@ class macroParameter extends plugin */ function execute() { - /* Call parent execute */ - plugin::execute(); + /* Call parent execute */ + plugin::execute(); /* Variables */ $vars = ""; $tmp = array(); $number = 0; - + + /* Get acls for this tab, + there is only one attribute to write, + so we use the acls from gofon/marco */ + $ACLs = $this->ui->get_permissions($this->dn,"gofon/macro","goFonMarcoContent"); + + /* get current content */ $content = $_SESSION['macroManagment']->macrotabs->by_object['macro']->goFonMacroContent; if(strstr($content,"ARG")){ @@ -200,13 +206,8 @@ class macroParameter extends plugin /* Fill templating stuff */ $smarty= get_smarty(); - /* Assign all vars to Smarty */ - foreach($this->attributes as $ar){ - $smarty->assign($ar, $this->$ar); - } - /* Add an empty Parameter */ - if(isset($_POST['addvar'])){ + if(isset($_POST['addvar']) && preg_match("/w/",$ACLs)){ if(!is_array($this->goFonMacroParameter)){ $vars = $this->goFonMacroParameter; $this->goFonMacroParameter = array(); @@ -223,36 +224,50 @@ class macroParameter extends plugin /* Sort by Parameterid, and keep keys */ ksort($FonParas); - foreach($FonParas as $key=>$para) { + - /* Select correct item of combobox */ - if(isset($para['type'])){ - list($sel1, $sel2, $sel3)= $this->type_shortcut[$para['type']]; - }else{ - list($sel1, $sel2, $sel3)= array("", "", ""); - } + if(!preg_match("/r/",$ACLs)){ + $smarty->assign("readable",false); + }else{ + $smarty->assign("readable",true); + foreach($FonParas as $key=>$para) { + + /* Select correct item of combobox */ + if(isset($para['type'])){ + list($sel1, $sel2, $sel3)= $this->type_shortcut[$para['type']]; + }else{ + list($sel1, $sel2, $sel3)= array("", "", ""); + } + + /* Disable all input fields if we are not allowed to change the parameters */ + $disabled = ""; + if(!preg_match("/w/",$ACLs)){ + $key = ""; + $disabled = " disabled "; + } - /* Assemble output table */ - $vars .=" - - - ARG".$key." - - - - - - -  "; - if($para['check']==false) { - $vars.=""; - } + /* Assemble output table */ + $vars .=" + + + ARG".$key." + + + + + + +  "; + if($para['check']==false) { + $vars.=""; + } - $vars.=" "; + $vars.=" "; + } } /* Checkboxes */ @@ -300,7 +315,7 @@ class macroParameter extends plugin /* Set Post vars */ $key = $_POST[$name]; - + $this->goFonMacroParameter[$key]['var'] = $_POST["var".$key]; $this->goFonMacroParameter[$key]['name'] = $_POST["varname".$key]; $this->goFonMacroParameter[$key]['type'] = $_POST["vartype".$key]; diff --git a/plugins/gofon/macro/parameter.tpl b/plugins/gofon/macro/parameter.tpl index 79c50c642..cf17055bd 100755 --- a/plugins/gofon/macro/parameter.tpl +++ b/plugins/gofon/macro/parameter.tpl @@ -1,3 +1,4 @@ +{if $readable} {$vars}
{t}Argument{/t} @@ -14,7 +15,9 @@
- +{else} +

{t}You are not allowed to view the marco parameter settings{/t}

+{/if} -- 2.30.2