X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=inline;f=lib%2FBackupPC%2FCGI%2FEditConfig.pm;fp=lib%2FBackupPC%2FCGI%2FEditConfig.pm;h=a5740e438dc30bffb681464d81c7852be6bec94d;hb=4cdaa6b8a9f5161ee2da4371d68cbbad41248ea0;hp=ec05e9f78896288463f842112908453d1adae6cb;hpb=dcb39df8e33e09eabfb4eae471c2e6447094d0e2;p=BackupPC.git diff --git a/lib/BackupPC/CGI/EditConfig.pm b/lib/BackupPC/CGI/EditConfig.pm index ec05e9f..a5740e4 100644 --- a/lib/BackupPC/CGI/EditConfig.pm +++ b/lib/BackupPC/CGI/EditConfig.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 3.0.0alpha, released 23 Jan 2006. +# Version 3.0.0beta0, released 11 Jul 2006. # # See http://backuppc.sourceforge.net. # @@ -41,6 +41,7 @@ use BackupPC::CGI::Lib qw(:all); use BackupPC::Config::Meta qw(:all); use BackupPC::Storage; use Data::Dumper; +use Encode; our %ConfigMenu = ( server => { @@ -713,9 +714,10 @@ EOF $bpc->ServerConnect(); if ( $mesg ne "" ) { (my $mesgBR = $mesg) =~ s/\n/
\n/g; - $content .= <$mesgBR -EOF + # uncomment this if you want the changes to be displayed +# $content .= <$mesgBR +#EOF foreach my $str ( split(/\n/, $mesg) ) { $bpc->ServerMesg("log $str") if ( $str ne "" ); } @@ -841,8 +843,9 @@ EOF # foreach my $var ( keys(%In) ) { next if ( $var !~ /^orig_z_/ ); + my $val = decode_utf8($In{$var}); $contentHidden .= < + EOF } } @@ -946,7 +949,7 @@ sub fieldEditBuild $size = $type->{size} if ( defined($type->{size}) ); # - # These fragments allow inline conent to be turned on and off + # These fragments allow inline content to be turned on and off # # # $varName @@ -1205,7 +1208,7 @@ EOF } my $textType = ($varName =~ /Passwd/) ? "password" : "text"; $content .= < + EOF } elsif ( $type->{type} eq "boolean" ) { # checkbox @@ -1227,7 +1230,7 @@ EOF my $rowCnt = $varValue =~ tr/\n//; $rowCnt = 1 if ( $rowCnt < 1 ); $content .= <${EscHTML($varValue)} + EOF } $content .= "\n"; @@ -1412,7 +1415,7 @@ sub fieldInputParse } } } else { - $$value = $In{"v_z_$varName"}; + $$value = decode_utf8($In{"v_z_$varName"}); $$value =~ s/\r\n/\n/g; } $$value = undef if ( $type->{undefIfEmpty} && $$value eq "" ); @@ -1465,12 +1468,15 @@ sub configDiffMesg (my $valueNew2 = $valueNew) =~ s/['\n\r]//g; (my $valueOld2 = $valueOld) =~ s/['\n\r]//g; + + next if ( $valueOld2 eq $valueNew2 ); + $valueNew =~ s/\n/\\n/g; $valueOld =~ s/\n/\\n/g; $valueNew =~ s/\r/\\r/g; $valueOld =~ s/\r/\\r/g; - $mesg .= eval("qq($Lang->{CfgEdit_Log_Change_param_value})") - if ( $valueOld2 ne $valueNew2 ); + + $mesg .= eval("qq($Lang->{CfgEdit_Log_Change_param_value})"); } } return $mesg;