summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d9c698a)
raw | patch | inline | side by side (parent: d9c698a)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 8 Jul 2010 16:22:19 +0000 (16:22 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 8 Jul 2010 16:22:19 +0000 (16:22 +0000) |
-There is no need to handle add_slashes/strip_slashes , encoding anymore.
I've replaced all occurences by set_post and get_post and voila, it also work wioth utf9 chars.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18970 594d385d-05f5-0310-b6e9-bd551577e9d8
I've replaced all occurences by set_post and get_post and voila, it also work wioth utf9 chars.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18970 594d385d-05f5-0310-b6e9-bd551577e9d8
15 files changed:
diff --git a/gosa-plugins/fai/admin/fai/class_askClassName.inc b/gosa-plugins/fai/admin/fai/class_askClassName.inc
index 945c0d54f4a3dd7c23e43592494a3c756580b7c3..2203198ea2d0d6688bb468eb541f80a9ab1c68c6 100644 (file)
{
if(isset($_POST['classSelector']) && $_POST['classSelector'] == 1
&& isset($_POST['edit_continue'])){
- $this->ClassName = $_POST['UseTextInputName'];
+ $this->ClassName = get_post('UseTextInputName');
$this->ClassAlreadyExists = true;
}
if(isset($_POST['classSelector']) && $_POST['classSelector'] == 2
&& isset($_POST['edit_continue'])){
$this->ClassAlreadyExists = false;
- $this->ClassName = $_POST['SelectedClass'];
+ $this->ClassName = get_post('SelectedClass');
}
}
diff --git a/gosa-plugins/fai/admin/fai/class_debconfTemplate.inc b/gosa-plugins/fai/admin/fai/class_debconfTemplate.inc
index ef20d1346adf2f91a7c01a1508c1390ef5aadbe7..f5bb9ad758bd1bfc7c9ecfab1a72e9b94b6a8711 100644 (file)
$str = preg_replace("/\,\ $/","",$str);
$this->template[$post_name]['Default'] = $str;
}else{
- $this->template[$post_name]['Default'] = $_POST[$entry['post_name']];
+ $this->template[$post_name]['Default'] = get_post($entry['post_name']);
}
}
}
$defs = explode(", ",$data['Default']);
foreach($choices as $value){
if(in_array($value,$defs)){
- $result.="\n<input name='".$post_name."-multi-".$value."' type='checkbox' value='".htmlentities($value)."' checked>".$value."<br>";
+ $result.="\n<input name='".$post_name."-multi-".$value."' type='checkbox' value='".set_post($value)."' checked>".$value."<br>";
}else{
- $result.="\n<input name='".$post_name."-multi-".$value."' type='checkbox' value='".htmlentities($value)."'>".$value."<br>";
+ $result.="\n<input name='".$post_name."-multi-".$value."' type='checkbox' value='".set_post($value)."'>".$value."<br>";
}
}
foreach($choices as $value){
if($data['Default'] == $value){
- $result.="\n<input type='radio' name='".$post_name."' value='".htmlentities($value)."' checked >".htmlentities($value)."<br>";
+ $result.="\n<input type='radio' name='".$post_name."' value='".set_post($value)."' checked >".set_post($value)."<br>";
}else{
- $result.="\n<input type='radio' name='".$post_name."' value='".htmlentities($value)."'>".htmlentities($value)."<br>";
+ $result.="\n<input type='radio' name='".$post_name."' value='".set_post($value)."'>".set_post($value)."<br>";
}
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc b/gosa-plugins/fai/admin/fai/class_faiDiskEntry.inc
index 3beb2426f8a9afbe5c00240b7784ad1a2cd99113..965bdb2422feacadae43688fba3099b7bfe43221 100644 (file)
// Remove partition from lvm compilation.
if(isset($_POST['delLvmPartition']) && isset($_POST['physicalPartition'])){
- $names = $_POST['physicalPartition'];
+ $names = get_post('physicalPartition');
foreach($names as $name){
if(isset($this->lvmDevices[$name])){
unset($this->lvmDevices[$name]);
// Assign checkbox related values.
foreach($this->attributes as $attrs){
- $smarty->assign($attrs,$this->$attrs);
+ $smarty->assign($attrs,set_post($this->$attrs));
if($this->$attrs){
$smarty->assign($attrs."CHK"," ");
}else{
$smarty->assign("fstabkeys", array("device" => _("Device"), "label" => _("Label"), "uuid" => _("UUID")));
$smarty->assign("disklabels", array("msdos" => "MSDOS", "gpt" => "GPT"));
$smarty->assign("fstabkey", $this->fstabkey);
- $smarty->assign("disklabel", $this->disklabel);
+ $smarty->assign("disklabel", set_post($this->disklabel));
$smarty->assign("FAIdiskType", $this->FAIdiskType);
$smarty->assign("plist", $this->getPartitionList());
$smarty->assign("physicalPartitionList", $this->getAvailablePartitions());
- foreach($this->attributes as $attr){
- $smarty->assign($attr,$this->$attr);
- }
-
// Assign partitions
$tmp = $this->plInfo();
$sacl = "";
// Save posted disk label and fstab key
if (isset($_POST['disklabel']) && preg_match("/^(msdos|gpt)$/", $_POST['disklabel'])){
- $this->disklabel= $_POST['disklabel'];
+ $this->disklabel= get_post('disklabel');
}
if (isset($_POST['fstabkey']) && preg_match("/^(device|label|uuid)$/", $_POST['fstabkey'])){
- $this->fstabkey= $_POST['fstabkey'];
+ $this->fstabkey= get_post('fstabkey');
}
}
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiHook.inc b/gosa-plugins/fai/admin/fai/class_faiHook.inc
index 7b4b5d14e0612750dcacf4bffcce73ddeb14044f..950ee0c75e7c350b5eeb53af9069f67d57d6565a 100644 (file)
$var = $ldap->get_attribute($object['dn'], $attrs,$r_array=0);
}
- /* Fix slashes */
- $var = addslashes($var);
$object[$attrs] = $var;
}
}
* If we post the escaped strings they will be escaped again
*/
foreach($this->attributes as $attrs){
- if(get_magic_quotes_gpc()){
- $smarty->assign($attrs,stripslashes($this->$attrs));
- }else{
- $smarty->assign($attrs,($this->$attrs));
- }
+ $smarty->assign($attrs,set_post($this->$attrs));
}
$tmp = $this->plInfo();
return($display);
}
- /* Generate listbox friendly SubObject list
- */
- function getList($use_dns=false){
- $a_return=array();
- foreach($this->SubObjects as $obj){
- if($obj['status'] != "delete"){
-
- $cn = stripslashes($obj['cn']);
- $desc = "";
-
- if((isset($obj['description']))&&(!empty($obj['description']))){
- $desc = " [".stripslashes($obj['description'])."]";
- }
-
- if($use_dns){
- $a_return[$obj['cn']]['name']= $cn.$desc;
- $a_return[$obj['cn']]['dn']= $obj['dn'];
- }else{
- $a_return[$obj['cn']] = $cn.$desc;
- }
- }
- }
- return($a_return);
- }
-
/* Delete me, and all my subtrees
*/
foreach($Objects as $name => $obj){
foreach($this->sub64coded as $codeIt){
- $obj[$codeIt]=base64_encode(stripslashes($obj[$codeIt]));
+ $obj[$codeIt]=base64_encode($obj[$codeIt]);
}
$tmp = array();
if($obj[$attrs] == ""){
$obj[$attrs] = array();
}
- if(!is_array($obj[$attrs])){
- $tmp[$attrs] = stripslashes($obj[$attrs]);
- }else{
- $tmp[$attrs] = $obj[$attrs];
- }
+ $tmp[$attrs] = $obj[$attrs];
}
$tmp['objectClass'] = $this->subClasses;
{
$vars = array("cn");
$smarty = get_smarty();
- $smarty->assign("cn", htmlentities($this->cn));
+ $smarty->assign("cn", set_post($this->cn));
$str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
$ret = array();
$ret['string'] = $str;
diff --git a/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc b/gosa-plugins/fai/admin/fai/class_faiHookEntry.inc
index c6003f604db6f2dd142f79fc4995837f17a3ba01..850a07a005d0e9ff45d5edde10e7b9af68345a21 100644 (file)
if(($_FILES['ImportFile']['size']==0)){
msg_dialog::display(_("Error"), msgPool::incorrectUpload(_("file is empty")), ERROR_DIALOG);
}else{
- $str = utf8_encode(file_get_contents($_FILES['ImportFile']['tmp_name']));
- $this->FAIscript = addslashes ($str);
+ $str = file_get_contents($_FILES['ImportFile']['tmp_name']);
+ $this->FAIscript = $str;
}
}
/* File download requested */
if(isset($_POST['download'])){
- send_binary_content(stripslashes($this->FAIscript),$this->cn.".FAIhook");
+ send_binary_content($this->FAIscript,$this->cn.".FAIhook");
}
/* Create download button*/
* If we post the escaped strings they will be escaped again
*/
foreach($this->attributes as $attrs){
- if(get_magic_quotes_gpc()){
- $smarty->assign($attrs,(stripslashes($this->$attrs)));
- }else{
- $smarty->assign($attrs,($this->$attrs));
- }
+ $smarty->assign($attrs,set_post($this->$attrs));
}
$tmp = $this->plInfo();
$smarty->assign($name."ACL",$acl);
}
- if(get_magic_quotes_gpc()){
- $smarty->assign("FAIscript" , htmlentities(stripslashes($this->FAIscript)));
- }else{
- $smarty->assign("FAIscript" , htmlentities($this->FAIscript));
- }
+ $smarty->assign("FAIscript" , set_post($this->FAIscript));
$smarty->assign("freeze" , preg_match("/freeze/",$this->FAIstate));
$display.= $smarty->fetch(get_template_path('faiHookEntry.tpl', TRUE));
return($display);
foreach($this->attributes as $attrs){
if($this->acl_is_writeable($attrs)){
if(isset($_POST[$attrs])){
- $this->$attrs = $_POST[$attrs];
+ $this->$attrs = get_post($attrs);
}else{
$this->$attrs = "";
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc
index 0c77ef80ae04264c2df25debe86d5654214e7fe9..2ac9586db93d7bc8e0891d4766888e0cea1acdb6 100644 (file)
$this->dispNewFreeze=false;
$smarty->assign("iframe",false);
if(isset($_POST['BranchName'])){
- $smarty->assign("BranchName", $_POST['BranchName']);
+ $smarty->assign("BranchName", get_post('BranchName'));
}else{
$smarty->assign("BranchName","");
}
$this->dispNewBranch=false;
$smarty->assign("iframe",false);
if(isset($_POST['BranchName'])){
- $smarty->assign("BranchName", $_POST['BranchName']);
+ $smarty->assign("BranchName", get_post('BranchName'));
}else{
$smarty->assign("BranchName","");
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiPackage.inc b/gosa-plugins/fai/admin/fai/class_faiPackage.inc
index 2e17931d31e810904e9d4013624614fa293196f6..0d797a13d3f0475c6233f05d028db44efcbf8f65 100644 (file)
$lData[$usedName] = array('data'=>
array(
$configured." ".$removal,
- $usedName ,$version,htmlentities($description), $actions));
+ $usedName ,$version,set_post($description), $actions));
}
}
$this->packageList->setAcl($this->getacl("FAIpackage",preg_match('/^freeze/', $this->FAIstate)));
/* Assign variables */
foreach($this->attributes as $attrs){
- $smarty->assign($attrs,$this->$attrs);
+ $smarty->assign($attrs,set_post($this->$attrs));
}
$smarty->assign( "FAIinstallMethods", $this->FAIinstallMethods );
{
$vars = array("cn");
$smarty = get_smarty();
- $smarty->assign("cn", htmlentities($this->cn));
+ $smarty->assign("cn", set_post($this->cn));
$str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
$ret = array();
$ret['string'] = $str;
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartition.inc b/gosa-plugins/fai/admin/fai/class_faiPartition.inc
index 2f3999eba51dcdf82394c49b804edb3a925d014e..73f201c1c2fe4ce51f7e135b23468456b27f8379 100644 (file)
// Remove partition
if(isset($_POST['addPhysicalPartition']) && isset($_POST['physicalPartitionAdd'])){
- $name = $_POST['physicalPartitionAdd'];
+ $name =get_post('physicalPartitionAdd');
$this->raidDevices[$name] = array("name" => $name,"spare"=>false,"missing"=>false);
}
$smarty->assign("sizeStart_Type", $this->sizeStart_Type);
$smarty->assign("sizeStop_Type", $this->sizeStop_Type);
- $smarty->assign("sizeStart", $this->sizeStart);
- $smarty->assign("sizeStop", $this->sizeStop);
+ $smarty->assign("sizeStart", set_post($this->sizeStart));
+ $smarty->assign("sizeStop", set_post($this->sizeStop));
$smarty->assign("preserveTypes", $preserveTypes);
- $smarty->assign("preserveType", $this->preserveType);
+ $smarty->assign("preserveType", set_post($this->preserveType));
$smarty->assign("FAIfsTypes", $FAIfsTypes);
$smarty->assign("cn", $this->cn);
$smarty->assign("disablePrimary", $this->disablePrimary);
foreach($this->attributes as $attr){
- $smarty->assign($attr,$this->$attr);
+ $smarty->assign($attr,set_post($this->$attr));
}
return($smarty->fetch(get_template_path("faiPartition.tpl", TRUE, dirname(__FILE__))));
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTable.inc
index 0665a1c6c3aaec44183bfc676451e062c79ec432..f6eff626790daee32fc690fe2d367f44ede2645b 100644 (file)
/* Assign all attributes to smarty engine
*/
foreach($this->attributes as $attrs){
- $smarty->assign($attrs,$this->$attrs);
+ $smarty->assign($attrs,set_post($this->$attrs));
if($this->$attrs){
$smarty->assign($attrs."CHK"," ");
}else{
if(isset($_POST['FAIpartitionTablePosted'])){
if (preg_match("/freeze/", $this->FAIstate)) return;
plugin::save_object();
-# foreach($this->attributes as $attrs){
-# if(isset($_POST[$attrs])){
-# $this->$attrs = $_POST[$attrs];
-# }
-# }
if(!count($this->disks)){
if(isset($_POST['mode'])){
$this->FAIpartitionMethod = "setup-storage";
{
$vars = array("cn");
$smarty = get_smarty();
- $smarty->assign("cn", htmlentities($this->cn));
+ $smarty->assign("cn", set_post($this->cn));
$str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
$ret = array();
$ret['string'] = $str;
$var = $ldap->get_attribute($object['dn'], $attrs,$r_array=0);
}
- /* Fix slashes */
- $var = addslashes($var);
$object[$attrs] = $var;
}
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiPartitionTableEntry.inc b/gosa-plugins/fai/admin/fai/class_faiPartitionTableEntry.inc
index dc743d1725b331d7b56cf8f6433b83a5ce7ba079..b194beff1bb75ef6b4ab09f66bbd499d917aad67 100644 (file)
* And Checkbox selection
*/
foreach($this->attributes as $attrs){
- $smarty->assign($attrs,$this->$attrs);
+ $smarty->assign($attrs,set_post($this->$attrs));
if($this->$attrs){
$smarty->assign($attrs."CHK"," ");
}else{
*/
$smarty->assign("setup", $this->generateParts());
foreach($this->attributes as $attr){
- $smarty->assign($attr,$this->$attr);
+ $smarty->assign($attr,set_post($this->$attr));
}
$tmp = $this->plInfo();
if($this->acl_is_writeable($attrs)){
if(isset($_POST[$attrs."_".$key])){
- $this->partitions[$key][$attrs] = $_POST[$attrs."_".$key];
+ $this->partitions[$key][$attrs] = get_post($attrs."_".$key);
}else{
$this->partitions[$key][$attrs] = false;
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiProfile.inc b/gosa-plugins/fai/admin/fai/class_faiProfile.inc
index 796189f15dea4e706d0fef97e6f488850b2e1f87..bb8a8ab73e2021d6f879936843192db327754282 100644 (file)
* If we post the escaped strings they will be escaped again
*/
foreach($this->attributes as $attrs){
- if(get_magic_quotes_gpc()){
- $smarty->assign($attrs,stripslashes($this->$attrs));
- }else{
- $smarty->assign($attrs,($this->$attrs));
- }
+ $smarty->assign($attrs,set_post($this->$attrs));
}
{
$vars = array("cn");
$smarty = get_smarty();
- $smarty->assign("cn", htmlentities($this->cn));
+ $smarty->assign("cn", set_post($this->cn));
$str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
$ret = array();
$ret['string'] = $str;
diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplate.inc b/gosa-plugins/fai/admin/fai/class_faiTemplate.inc
index c3c99f607c7aa757e1f472c8684a649ba9afeb34..1653586f02e44cb36ef8823de52ef0e56e493619 100644 (file)
if(in_array_ics($attrs,$this->sub64coded)){
$var = base64_decode($var);
}
- $var = stripslashes($var);
/* check if this is a binary entry */
if(in_array_ics($attrs,$this->subBinary)){
diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplateEdit.inc b/gosa-plugins/fai/admin/fai/class_faiTemplateEdit.inc
index 9cb844e0815d5f8e50764124f3c08b803eb05f21..dfad479570ab9f388af4c40e7f59bba8c42990c4 100644 (file)
/* We now split cn/FAItemplatePath to make things more clear... */
$smarty = get_smarty();
- $smarty->assign("templateValue",htmlspecialchars(($this->value)));
+ $smarty->assign("templateValue",set_post(($this->value)));
$smarty->assign("write_protect",$this->write_protect);
$smarty->assign("mb_extension",$this->mb_extension);
return($smarty->fetch(get_template_path('faiTemplateEdit.tpl', TRUE)));
diff --git a/gosa-plugins/fai/admin/fai/class_faiVariable.inc b/gosa-plugins/fai/admin/fai/class_faiVariable.inc
index 870028dba0f569ea28e8e26fbd78e228d72bae8d..ca3438e3f3879d8299ac3c95e0a03200d8047e6c 100644 (file)
* If we post the escaped strings they will be escaped again
*/
foreach($this->attributes as $attrs){
- if(get_magic_quotes_gpc()){
- $smarty->assign($attrs,htmlentities (stripslashes(utf8_decode($this->$attrs))));
- }else{
- $smarty->assign($attrs,htmlentities (utf8_decode($this->$attrs)));
- }
+ $smarty->assign($attrs,set_post($this->$attrs));
}
$c_dn = $this->acl_base_for_current_object($this->dn);
{
$vars = array("cn");
$smarty = get_smarty();
- $smarty->assign("cn", htmlentities($this->cn));
+ $smarty->assign("cn", set_post($this->cn));
$str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
$ret = array();
$ret['string'] = $str;
$var = $ldap->get_attribute($object['dn'], $attrs,$r_array=0);
}
- /* Fix slashes */
- $var = addslashes($var);
$object[$attrs] = $var;
}
}
diff --git a/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc b/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc
index dd88739559bbda247393bf731682347c82ecd506..aa3159dd9d866bf201ae33190bd8aaf73ff651a0 100644 (file)
$this->dn=$object['dn'];
foreach($object as $name=>$value){
$oname = $name;
- $this->$oname=addslashes($value);
+ $this->$oname=($value);
}
}else{
$this->status = "new";
* If we post the escaped strings they will be escaped again
*/
foreach($this->attributes as $attrs){
- if(get_magic_quotes_gpc()){
- $smarty->assign($attrs,htmlentities (stripslashes(utf8_decode($this->$attrs))));
- }else{
- $smarty->assign($attrs,htmlentities (utf8_decode($this->$attrs)));
- }
+ $smarty->assign($attrs,set_post($this->$attrs));
}
$tmp = $this->plInfo();
foreach($this->attributes as $attrs){
if($this->acl_is_writeable($attrs)){
if(isset($_POST[$attrs])){
- $this->$attrs = $_POST[$attrs];
+ $this->$attrs = get_post($attrs);
}else{
$this->$attrs = "";
}
{
$tmp=array();
foreach($this->attributes as $attrs){
- $tmp[$attrs] = stripslashes( $this->$attrs);
+ $tmp[$attrs] = $this->$attrs;
}
if(($this->orig_cn)&&($tmp['cn']!=$this->orig_cn)){