From 5ac59875065a43f5c1d61afed40e068010d070ed Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 8 Apr 2008 08:14:50 +0000 Subject: [PATCH] Updated sudo stuff -Fixed problem with entries containing ' or " git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10272 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../sudo/admin/sudo/class_sudoGeneric.inc | 3 +++ .../sudo/admin/sudo/class_sudoOption.inc | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc b/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc index 0544cf64d..969598d9b 100644 --- a/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc +++ b/gosa-plugins/sudo/admin/sudo/class_sudoGeneric.inc @@ -645,6 +645,9 @@ class sudo extends plugin } + /*! \brief Force this entry to be handled and saved as 'default' + @param BOOL TRUE -force default FALSE -normal + */ public function set_default($state) { $this->is_default = TRUE; diff --git a/gosa-plugins/sudo/admin/sudo/class_sudoOption.inc b/gosa-plugins/sudo/admin/sudo/class_sudoOption.inc index 1280268aa..48d862f6a 100644 --- a/gosa-plugins/sudo/admin/sudo/class_sudoOption.inc +++ b/gosa-plugins/sudo/admin/sudo/class_sudoOption.inc @@ -271,12 +271,27 @@ class sudoOption extends plugin $smarty->assign("map", array("STRING" => _("string"), "BOOLEAN" => _("bool"), "INTEGER" => _("integer") , "BOOL_INTEGER" => _("integer")."-"._("bool") , "STRING_BOOL" => _("string")."-"._("bool"),"LISTS" => _("list"))); - $smarty->assign("sudoOption",$this->sudoOption); + $smarty->assign("sudoOption",$this->prepare_for_html($this->sudoOption)); $smarty->assign("options",$this->options); return($smarty->fetch(get_template_path('options.tpl', TRUE))); } + /*! \brief Prepare options array to be used in HTML. + @param Array The options array ($this->sudoOption) + @return Array HTML ready sudoOption. Can now be used in smarty templates + */ + function prepare_for_html($a_options) + { + foreach($a_options as $name => $options){ + foreach($options as $key => $option){ + $a_options[$name][$key]['VALUE'] = htmlentities($option['VALUE']); + } + } + return($a_options); + } + + /*! \brief Removes this plugin */ function remove_from_parent() -- 2.30.2