X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fapplications%2Fclass_applicationGeneric.inc;h=58895c8eabd0283a5bf7e83a1084ac2220ecde25;hb=969b5c3e6fb3643d2b9b77bcb92b7c329f22512b;hp=7dd82fdc8b18a7e3969d656d6ce66564bb63105e;hpb=c4c75973b3593abef7f3d4613cde3a8000fef0ae;p=gosa.git
diff --git a/plugins/admin/applications/class_applicationGeneric.inc b/plugins/admin/applications/class_applicationGeneric.inc
index 7dd82fdc8..58895c8ea 100644
--- a/plugins/admin/applications/class_applicationGeneric.inc
+++ b/plugins/admin/applications/class_applicationGeneric.inc
@@ -58,17 +58,15 @@ class application extends plugin
}
- function generateTempalte(){
- $str= "# This code is part of GOsa (https://gosa.gonicus.de)\n".
- "#\n".
- "# This program is free software; you can redistribute it and/or modify\n".
- "# it under the terms of the GNU General Public License as published by\n".
- "# the Free Software Foundation; either version 2 of the License, or\n".
- "# (at your option) any later version.\n".
- "#\n";
-
- $names = $this->parent->by_object['applicationParameters']->option_name;
- $values = $this->parent->by_object['applicationParameters']->option_value;
+ function generateTemplate(){
+ $str= "# This code is part of GOsa (https://gosa.gonicus.de)\n#\n";
+
+ $values = array();
+ $names = array();
+ if($this->parent->by_object['applicationParameters']->is_account){
+ $names = $this->parent->by_object['applicationParameters']->option_name;
+ $values = $this->parent->by_object['applicationParameters']->option_value;
+ }
if (count($names)){
$str .="# This plugin handles these environment variables:\n";
@@ -79,13 +77,13 @@ class application extends plugin
foreach($names as $index => $name){
// Fix length
- if (strlen($name) < 35){
- $name= sprintf("%.35s", $name);
+ for($i = strlen($name) ; $i < 30 ; $i++){
+ $name= $name." ";
}
- if(isset($values[$index])){
- $str.= "# ".$name."\t\t(e.g. ".$values[$index].")\n";
+ if((isset($values[$index]))&&(!empty($values[$index]))){
+ $str.= "# ".$name."\t(e.g. '".$values[$index]."')\n";
}else{
- $str.= "# ".$name."\n";
+ $str.= "# ".$name."\t("._("no example").")\n";
}
}
$str .= "#\n".
@@ -97,6 +95,11 @@ class application extends plugin
function execute()
{
+ /* Call parent execute */
+ plugin::execute();
+
+ $smarty= get_smarty();
+
/* Do we represent a valid group? */
if (!$this->is_account && $this->parent == NULL){
$display= "
".
@@ -104,8 +107,8 @@ class application extends plugin
return ($display);
}
- if(isset($_POST['ScriptTemplate'])){
- $head = $this->generateTempalte();
+# if(isset($_POST['ScriptTemplate'])){
+ $head = $this->generateTemplate();
$scr = $this->gotoLogonScript;
if(preg_match("/### END HEADER ###/",$scr)){
@@ -115,7 +118,7 @@ class application extends plugin
}
$this->gotoLogonScript = $head.$scr;
- }
+# }
if((isset($_POST['upLoad']))&&(isset($_FILES['ScriptFile']))){
$str = file_get_contents($_FILES['ScriptFile']['tmp_name']);
@@ -123,7 +126,6 @@ class application extends plugin
}
/* Fill templating stuff */
- $smarty= get_smarty();
$smarty->assign("cn", $this->cn);
$smarty->assign("bases", $this->config->idepartments);
if ($this->dn == "new"){
@@ -139,13 +141,14 @@ class application extends plugin
$smarty->assign("rand", rand(0, 10000));
/* Variables */
- foreach(array("description", "gosaApplicationExecute", "gosaApplicationName") as $val){
+ foreach(array("description", "gosaApplicationExecute", "gosaApplicationName","cn") as $val){
$smarty->assign($val, $this->$val);
$smarty->assign($val."ACL", chkacl($this->acl, $val));
}
/* Checkboxes */
foreach (array("G" => "exec_for_groupmembers", "O" => "overwrite_config",
+ "L" => "place_on_kicker",
"D" => "place_on_desktop", "M" => "place_in_startmenu") as $key => $val){
if (preg_match("/$key/", $this->gosaApplicationFlags)){
$smarty->assign("$val", "checked");
@@ -203,6 +206,9 @@ class application extends plugin
if (isset($_POST['place_on_desktop']) && $_POST['place_on_desktop'] == 1){
$flag.= "D";
}
+ if (isset($_POST['place_on_kicker']) && $_POST['place_on_kicker'] == 1){
+ $flag.= "L";
+ }
if (isset($_POST['place_in_startmenu']) && $_POST['place_in_startmenu'] == 1){
$flag.= "M";
}