From 24ebfe3edf23f2ae073c752825a5abf449a37b11 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 4 Apr 2008 13:41:24 +0000 Subject: [PATCH] Reverted xmlentities changes Added xmlentities to gosa.conf generation. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10214 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 9 ++++++--- gosa-core/setup/class_setupStep_Config1.inc | 2 +- gosa-core/setup/class_setupStep_Config2.inc | 2 +- gosa-core/setup/class_setupStep_Config3.inc | 2 +- gosa-core/setup/class_setupStep_Feedback.inc | 2 +- gosa-core/setup/class_setupStep_Finish.inc | 2 +- gosa-core/setup/class_setupStep_Ldap.inc | 4 ++-- gosa-core/setup/class_setupStep_Migrate.inc | 6 +++--- 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index cbcebe94b..9ce2f2abf 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -2671,14 +2671,17 @@ function send_binary_content($data,$name,$type = "application/octet-stream") HTML output, without breaking quotes. @param The String we want to encode. @return The encoded String -*/ + */ function xmlentities($str) { if(is_string($str)){ return(htmlentities($str,ENT_QUOTES)); - }else{ - return($str); + }elseif(is_array($str)){ + foreach($str as $name => $value){ + $str[$name] = xmlentities($value); + } } + return($str); } diff --git a/gosa-core/setup/class_setupStep_Config1.inc b/gosa-core/setup/class_setupStep_Config1.inc index d418df863..1087b6a2b 100644 --- a/gosa-core/setup/class_setupStep_Config1.inc +++ b/gosa-core/setup/class_setupStep_Config1.inc @@ -87,7 +87,7 @@ class Step_Config1 extends setup_step $smarty->assign("pwd_rules",$this->pwd_rules); $smarty->assign("bool",array(FALSE => _("No"), TRUE => _("Yes"))); foreach($this->attributes as $attr){ - $smarty->assign($attr,xmlentities($this->$attr)); + $smarty->assign($attr,$this->$attr); } /* !!! Attention strict is inverse. If you change this, diff --git a/gosa-core/setup/class_setupStep_Config2.inc b/gosa-core/setup/class_setupStep_Config2.inc index 97a5c02e8..450fe81e1 100644 --- a/gosa-core/setup/class_setupStep_Config2.inc +++ b/gosa-core/setup/class_setupStep_Config2.inc @@ -161,7 +161,7 @@ class Step_Config2 extends setup_step $smarty->assign("samba_settings",$this->samba_settings); $smarty->assign("bool",array(FALSE => _("No"), TRUE => _("Yes"))); foreach($this->attributes as $attr){ - $smarty->assign($attr,xmlentities($this->$attr)); + $smarty->assign($attr,$this->$attr); } $smarty->assign("timezone" ,$this->timezone); $smarty->assign("timezones" ,$this->timezones); diff --git a/gosa-core/setup/class_setupStep_Config3.inc b/gosa-core/setup/class_setupStep_Config3.inc index 7712c7055..cd62785e3 100644 --- a/gosa-core/setup/class_setupStep_Config3.inc +++ b/gosa-core/setup/class_setupStep_Config3.inc @@ -93,7 +93,7 @@ class Step_Config3 extends setup_step $smarty->assign("optional", $this->optional); foreach($this->attributes as $attr){ - $smarty->assign($attr,xmlentities($this->$attr)); + $smarty->assign($attr,$this->$attr); } $smarty->assign("login_attributes",$this->login_attributes); return($smarty -> fetch (get_template_path("../setup/setup_config3.tpl"))); diff --git a/gosa-core/setup/class_setupStep_Feedback.inc b/gosa-core/setup/class_setupStep_Feedback.inc index 0863e1fd0..cf89cf6d2 100644 --- a/gosa-core/setup/class_setupStep_Feedback.inc +++ b/gosa-core/setup/class_setupStep_Feedback.inc @@ -164,7 +164,7 @@ class Step_Feedback extends setup_step $smarty = get_smarty(); foreach($this->attributes as $attr){ - $smarty->assign($attr, xmlentities($this->$attr)); + $smarty->assign($attr, $this->$attr); } $smarty->assign("years",$years); $smarty->assign("features_used",$this->features_used); diff --git a/gosa-core/setup/class_setupStep_Finish.inc b/gosa-core/setup/class_setupStep_Finish.inc index aecc280c0..2d64638dc 100644 --- a/gosa-core/setup/class_setupStep_Finish.inc +++ b/gosa-core/setup/class_setupStep_Finish.inc @@ -43,7 +43,7 @@ class Step_Finish extends setup_step function get_conf_data() { $smarty = get_smarty(); - $smarty->assign("cv",$this->parent->captured_values); + $smarty->assign("cv",xmlentities($this->parent->captured_values)); $str = $smarty->fetch(CONFIG_TEMPLATE_DIR.$this->gosa_conf_contrib); return($str); } diff --git a/gosa-core/setup/class_setupStep_Ldap.inc b/gosa-core/setup/class_setupStep_Ldap.inc index 855a4a8d3..e831ec105 100644 --- a/gosa-core/setup/class_setupStep_Ldap.inc +++ b/gosa-core/setup/class_setupStep_Ldap.inc @@ -60,7 +60,7 @@ class Step_Ldap extends setup_step { $smarty = get_smarty(); foreach($this->attributes as $attr){ - $smarty->assign($attr,xmlentities($this->$attr)); + $smarty->assign($attr,$this->$attr); } /* Assign connection status */ @@ -84,7 +84,7 @@ class Step_Ldap extends setup_step $base_to_append = $this->base; if(strlen($base_to_append) > 20){ - $base_to_append = xmlentities(substr($base_to_append,0,17)."..."); + $base_to_append = substr($base_to_append,0,17)."..."; } $smarty->assign("base_to_append",$base_to_append); return($smarty -> fetch (get_template_path("../setup/setup_ldap.tpl"))); diff --git a/gosa-core/setup/class_setupStep_Migrate.inc b/gosa-core/setup/class_setupStep_Migrate.inc index cec90017e..7e45ca33e 100644 --- a/gosa-core/setup/class_setupStep_Migrate.inc +++ b/gosa-core/setup/class_setupStep_Migrate.inc @@ -1407,9 +1407,9 @@ class Step_Migrate extends setup_step $uid = $_POST['new_user_uid']; } - $smarty->assign("new_user_uid", xmlentities($uid)); - $smarty->assign("new_user_password",xmlentities(@$_POST['new_user_password'])); - $smarty->assign("new_user_password2",xmlentities(@$_POST['new_user_password2'])); + $smarty->assign("new_user_uid",$uid); + $smarty->assign("new_user_password",@$_POST['new_user_password']); + $smarty->assign("new_user_password2",@$_POST['new_user_password2']); $smarty->assign("method","create_acls"); $smarty->assign("acl_create_selected",$this->acl_create_selected); $smarty->assign("what_will_be_done_now",$this->acl_create_changes); -- 2.30.2