X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=SL%2FForm.pm;h=7803fc394b94aca0928c7051f47b4a8cc95719d2;hb=09335d0f463d5fff5b1b620ffc61f3ad48ab793a;hp=ebc7e82f8c2e3c776863fca080ebd7c3ce12cb27;hpb=0576299f2aa98125991c4ffcd2f75073ea583d7d;p=kivitendo-erp.git
diff --git a/SL/Form.pm b/SL/Form.pm
index ebc7e82f8..7803fc394 100644
--- a/SL/Form.pm
+++ b/SL/Form.pm
@@ -1,4 +1,4 @@
-#=====================================================================
+#====================================================================
# LX-Office ERP
# Copyright (C) 2004
# Based on SQL-Ledger Version 2.1.9
@@ -36,9 +36,20 @@
#======================================================================
package Form;
+use Data::Dumper;
+
+use Cwd;
+use HTML::Template;
+use SL::Template;
+use CGI::Ajax;
+use SL::DBUtils;
+use SL::Menu;
+use SL::User;
+use SL::Common;
+use CGI;
sub _input_to_hash {
- $main::lxdebug->enter_sub();
+ $main::lxdebug->enter_sub(2);
my $input = $_[0];
my %in = ();
@@ -49,13 +60,13 @@ sub _input_to_hash {
$in{$name} = unescape(undef, $value);
}
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(2);
return %in;
}
sub _request_to_hash {
- $main::lxdebug->enter_sub();
+ $main::lxdebug->enter_sub(2);
my ($input) = @_;
my ($i, $loc, $key, $val);
@@ -106,11 +117,11 @@ sub _request_to_hash {
}
}
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(2);
return %ATTACH;
} else {
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(2);
return _input_to_hash($input);
}
}
@@ -122,6 +133,11 @@ sub new {
my $self = {};
+ if ($LXDebug::watch_form) {
+ require SL::Watchdog;
+ tie %{ $self }, 'SL::Watchdog';
+ }
+
read(STDIN, $_, $ENV{CONTENT_LENGTH});
if ($ENV{QUERY_STRING}) {
@@ -135,13 +151,10 @@ sub new {
my %parameters = _request_to_hash($_);
map({ $self->{$_} = $parameters{$_}; } keys(%parameters));
- $self->{menubar} = 1 if $self->{path} =~ /lynx/i;
-
$self->{action} = lc $self->{action};
- $self->{action} =~ s/( |-|,|#)/_/g;
+ $self->{action} =~ s/( |-|,|\#)/_/g;
- $self->{version} = "2.1.2";
- $self->{dbversion} = "2.1.2";
+ $self->{version} = "2.4.2";
$main::lxdebug->leave_sub();
@@ -161,24 +174,19 @@ sub debug {
}
sub escape {
- $main::lxdebug->enter_sub();
+ $main::lxdebug->enter_sub(2);
- my ($self, $str, $beenthere) = @_;
-
- # for Apache 2 we escape strings twice
- #if (($ENV{SERVER_SOFTWARE} =~ /Apache\/2/) && !$beenthere) {
- # $str = $self->escape($str, 1);
- #}
+ my ($self, $str) = @_;
$str =~ s/([^a-zA-Z0-9_.-])/sprintf("%%%02x", ord($1))/ge;
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(2);
return $str;
}
sub unescape {
- $main::lxdebug->enter_sub();
+ $main::lxdebug->enter_sub(2);
my ($self, $str) = @_;
@@ -187,33 +195,75 @@ sub unescape {
$str =~ s/%([0-9a-fA-Z]{2})/pack("c",hex($1))/eg;
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(2);
return $str;
}
-sub error {
- $main::lxdebug->enter_sub();
+sub quote {
+ my ($self, $str) = @_;
- my ($self, $msg) = @_;
+ if ($str && !ref($str)) {
+ $str =~ s/\"/"/g;
+ }
- if ($ENV{HTTP_USER_AGENT}) {
- $msg =~ s/\n/
/g;
+ $str;
- $self->header;
+}
- print qq|
-
$msg + $str; - -