From 81113273c370e172802a8c3248119e9625021645 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 9 Sep 2005 05:09:15 +0000 Subject: [PATCH] Added import to scripts git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1335 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/FAI/class_faiScriptEntry.inc | 14 ++++++++++++++ plugins/admin/FAI/faiHookEntry.tpl | 4 ++-- plugins/admin/FAI/faiScriptEntry.tpl | 6 ++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/plugins/admin/FAI/class_faiScriptEntry.inc b/plugins/admin/FAI/class_faiScriptEntry.inc index 3ffc67a7d..43793ebac 100644 --- a/plugins/admin/FAI/class_faiScriptEntry.inc +++ b/plugins/admin/FAI/class_faiScriptEntry.inc @@ -42,6 +42,20 @@ class faiScriptEntry extends plugin /* Fill templating stuff */ $smarty = get_smarty(); $display = ""; + + if(isset($_POST['ImportUpload'])){ + if(($_FILES['ImportFile']['error']!=0)){ + print_red(_("Please select a valid file.")); + }else + if(($_FILES['ImportFile']['size']==0)){ + print_red(_("Selected file is empty.")); + }else{ + $str = file_get_contents($_FILES['ImportFile']['tmp_name']); + $this->Object_FAIscript = $str; + } + } + + foreach($this->attributes as $attrs){ $smarty->assign($attrs,stripslashes($this->$attrs)); diff --git a/plugins/admin/FAI/faiHookEntry.tpl b/plugins/admin/FAI/faiHookEntry.tpl index fba769e15..2dd86e4fc 100644 --- a/plugins/admin/FAI/faiHookEntry.tpl +++ b/plugins/admin/FAI/faiHookEntry.tpl @@ -35,7 +35,7 @@ - + @@ -45,7 +45,7 @@ - + diff --git a/plugins/admin/FAI/faiScriptEntry.tpl b/plugins/admin/FAI/faiScriptEntry.tpl index 674994abd..e5d7a7018 100644 --- a/plugins/admin/FAI/faiScriptEntry.tpl +++ b/plugins/admin/FAI/faiScriptEntry.tpl @@ -50,6 +50,12 @@ {t}Script{/t} +
+ {t}Import script{/t}   +   + +
+
-- 2.30.2