From: hickert Date: Thu, 7 Sep 2006 08:59:34 +0000 (+0000) Subject: Fixed acls. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3e973a214a452b441eba19f743a02cb10679ccfc;p=gosa.git Fixed acls. Fixed picture and script download, they work together now. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4615 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/applications/class_applicationGeneric.inc b/plugins/admin/applications/class_applicationGeneric.inc index 0d4d5ea88..c483bb97d 100644 --- a/plugins/admin/applications/class_applicationGeneric.inc +++ b/plugins/admin/applications/class_applicationGeneric.inc @@ -128,9 +128,21 @@ class application extends plugin return ($display); } - $_SESSION['binary'] = $this->gotoLogonScript; - $_SESSION['binarytype'] = "octet-stream"; - $_SESSION['binaryfile'] = $this->cn.".gosaApplication"; + /* Download requested */ + foreach($_POST as $name => $value){ + if(preg_match("/^downloadScript/",$name)){ + $_SESSION['binary'] = $this->gotoLogonScript; + $_SESSION['binarytype'] = "octet-stream"; + $_SESSION['binaryfile'] = $this->cn.".gosaApplication"; + header("location: getbin.php "); + exit(); + } + } + + /* Reassign picture data, sometimes its corrupt cause we started a download of application scripts */ + $_SESSION['binary'] = $this->iconData; + $_SESSION['binarytype'] = "image/jpeg"; + $smarty->assign("rand", rand(0, 10000)); $head = $this->generateTemplate(); $this->gotoLogonScript= $this->generateTemplate().preg_replace('/.*### END HEADER ###/s', '', $this->gotoLogonScript); @@ -509,7 +521,6 @@ class application extends plugin "gosaApplicationIcon" => _("Icon"), "gosaApplicationFlags" => _("Flag"), "gotoLogonScript" => _("Script content"), - "gosaApplicationParameter"=> _("Application parameter"), "exec_for_groupmembers" => _("Only executable for members"), // G "place_on_desktop" => _("Place icon on members desktop"), // D diff --git a/plugins/admin/applications/class_applicationParameters.inc b/plugins/admin/applications/class_applicationParameters.inc index 0de056040..d65636b2e 100644 --- a/plugins/admin/applications/class_applicationParameters.inc +++ b/plugins/admin/applications/class_applicationParameters.inc @@ -90,14 +90,38 @@ class applicationParameters extends plugin $this->option_name[]= ""; $this->option_value[]= ""; } + + + $acl = $this->getacl("gosaApplicationParameter") ; $table= ""; if (count ($this->option_name)){ + for ($i= 0; $i < count($this->option_name); $i++){ - $table.=""; + $name = $this->option_name[$i]; + $value= $this->option_value[$i]; + + $tag = ""; + if(!preg_match("/w/",$acl)){ + $tag = " disabled "; + } + + if(!preg_match("/r/",$acl)){ + $name = ""; + $value= ""; + } + + $table.="". + " ". + " ". + " ". + ""; } } $table.= "
"._("Variable").""._("Default value")."
option_name[$i]."\">option_value[$i]."\">
". - "
". + " ". + " ". + " ". + "
". + "
". + " ". + "
"; @@ -105,6 +129,11 @@ class applicationParameters extends plugin /* Show main page */ $smarty= get_smarty(); + $tmp = $this->plInfo(); + foreach($tmp['plProvidedAcls'] as $name => $translation){ + $smarty->assign($name."ACL",$this->getacl($name)); + } + $smarty->assign("table", $table); $display.= $smarty->fetch(get_template_path('parameters.tpl', TRUE)); $this->parent->by_object['application']->generateTemplate(); @@ -193,6 +222,25 @@ class applicationParameters extends plugin $this->handle_post_events('modify'); } + /* Return plugin informations for acl handling + #FIXME FAIscript seams to ununsed within this class... */ + function plInfo() + { + return (array( + "plShortName" => _("Parameter"), + "plDescription" => _("Parameter configuration"), + "plSelfModify" => FALSE, + "plDepends" => array(), + "plPriority" => 0, + "plSection" => array("administration"), + "plCategory" => array("application"), + + "plProvidedAcls"=> array( + "gosaApplicationParameter" => _("Application parameter settings")) + )); + } + + } ?> diff --git a/plugins/admin/applications/generic.tpl b/plugins/admin/applications/generic.tpl index 78ee97f97..8628945b5 100644 --- a/plugins/admin/applications/generic.tpl +++ b/plugins/admin/applications/generic.tpl @@ -132,7 +132,7 @@ {render acl=$gotoLogonScriptACL} {/render} - {t}Download{/t} +