From 7e4d9b054abfbc77a957dbc7b5a20a63eefe42cb Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 23 Jan 2008 09:42:53 +0000 Subject: [PATCH] Udpated FAI object downloading. -Will no longer use getFAIscript.php. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8554 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-plugins/fai/admin/fai/class_faiHook.inc | 11 ++++++++++- gosa-plugins/fai/admin/fai/class_faiHookEntry.inc | 7 ++++++- gosa-plugins/fai/admin/fai/class_faiScript.inc | 11 ++++++++++- gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc | 11 ++++++++--- gosa-plugins/fai/admin/fai/class_faiTemplate.inc | 11 ++++++++++- 5 files changed, 44 insertions(+), 7 deletions(-) diff --git a/gosa-plugins/fai/admin/fai/class_faiHook.inc b/gosa-plugins/fai/admin/fai/class_faiHook.inc index fb64e5d3c..f1fec85fc 100644 --- a/gosa-plugins/fai/admin/fai/class_faiHook.inc +++ b/gosa-plugins/fai/admin/fai/class_faiHook.inc @@ -198,6 +198,15 @@ class faiHook extends plugin } } + /* File download requested */ + if(isset($_GET['getFAIHook'])){ + if(isset($this->SubObjects[$_GET['getFAIHook']])){ + $obj = $this->SubObjects[$_GET['getFAIHook']]; + $obj = $this->get_object_attributes($obj,$this->sub_Load_Later); + send_binary_content($obj['FAIscript'],$obj['cn'].".FAIhook"); + } + } + /* Edit entries via GET */ if(isset($_GET['act']) && isset($_GET['id'])){ if($_GET['act'] == "edit" && isset($this->SubObjects[$_GET['id']])){ @@ -325,7 +334,7 @@ class faiHook extends plugin if(($this->SubObjects[$key]['status'] == "new") || ($this->SubObjects[$key]['dn'] == "new") || !preg_match("/r/",$s_acl)){ $down = ""; }else{ - $down = " + $down = " "._("Download")." "; } diff --git a/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc b/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc index cab96dbf2..282dbcf90 100644 --- a/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc @@ -78,9 +78,14 @@ class faiHookEntry extends plugin } } + /* File download requested */ + if(isset($_GET['getFAIHook'])){ + send_binary_content($this->FAIscript,$this->cn.".FAIhook"); + } + /* Create download button*/ if($this->dn != "new" && $this->acl_is_readable("FAIscript")){ - $smarty->assign("DownMe"," + $smarty->assign("DownMe"," "._("Download")." "); }else{ diff --git a/gosa-plugins/fai/admin/fai/class_faiScript.inc b/gosa-plugins/fai/admin/fai/class_faiScript.inc index 2233b6ae6..d47ed33c3 100644 --- a/gosa-plugins/fai/admin/fai/class_faiScript.inc +++ b/gosa-plugins/fai/admin/fai/class_faiScript.inc @@ -164,6 +164,15 @@ class faiScript extends plugin session::set('objectinfo',$this->dn); } + /* File download requested */ + if(isset($_GET['getFAIscript'])){ + if(isset($this->SubObjects[$_GET['getFAIscript']])){ + $obj = $this->SubObjects[$_GET['getFAIscript']]; + $obj = $this->get_object_attributes($obj,$this->sub_Load_Later); + send_binary_content($obj['FAIscript'],$obj['cn'].".FAIscript"); + } + } + /* Handle posts */ $s_action = $s_entry = ""; foreach($_POST as $name => $value){ @@ -361,7 +370,7 @@ class faiScript extends plugin if(($this->SubObjects[$key]['status'] == "new") || ($this->SubObjects[$key]['dn'] == "new") || !preg_match("/r/",$s_acl)){ $down = ""; }else{ - $down = " + $down = " "._("Download")." "; } diff --git a/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc b/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc index 032132920..ab3b589f1 100644 --- a/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiScriptEntry.inc @@ -83,10 +83,15 @@ class faiScriptEntry extends plugin } } - /* Create download button*/ + /* File download requested */ + if(isset($_GET['getFAIScript'])){ + send_binary_content($this->FAIscript,$this->cn.".FAIscript"); + } + + /* Create download button*/ if($this->dn != "new" && $this->acl_is_readable("FAIscript")){ - $smarty->assign("DownMe"," - + $smarty->assign("DownMe"," + "._("Download")." "); }else{ $smarty->assign("DownMe",""); diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplate.inc b/gosa-plugins/fai/admin/fai/class_faiTemplate.inc index 54bd83267..50add1a37 100644 --- a/gosa-plugins/fai/admin/fai/class_faiTemplate.inc +++ b/gosa-plugins/fai/admin/fai/class_faiTemplate.inc @@ -176,6 +176,15 @@ class faiTemplate extends plugin } } + /* File download requested */ + if(isset($_GET['getFAItemplate'])){ + if(isset($this->SubObjects[$_GET['getFAItemplate']])){ + $obj = $this->SubObjects[$_GET['getFAItemplate']]; + $obj = $this->get_object_attributes($obj,$this->sub_Load_Later); + send_binary_content($obj['FAItemplateFile'],$obj['cn'].".FAItemplate"); + } + } + /* Edit entries via GET */ if(isset($_GET['act']) && isset($_GET['id'])){ if($_GET['act'] == "edit" && isset($this->SubObjects[$_GET['id']])){ @@ -302,7 +311,7 @@ class faiTemplate extends plugin if(($this->SubObjects[$key]['status'] == "new") || ($this->SubObjects[$key]['dn'] == "new") || !preg_match("/r/",$s_acl)){ $down = ""; }else{ - $down = " + $down = " "._("Download")." "; } -- 2.30.2