summaryrefslogtreecommitdiff
path: root/admin.pl
diff options
context:
space:
mode:
Diffstat (limited to 'admin.pl')
-rwxr-xr-xadmin.pl47
1 files changed, 23 insertions, 24 deletions
diff --git a/admin.pl b/admin.pl
index a3b9de31..c4ae2d48 100755
--- a/admin.pl
+++ b/admin.pl
@@ -9,9 +9,9 @@
# with permission.
#
# This file contains source code included with or based on SQL-Ledger which
-# is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 and licensed
-# under the GNU General Public License version 2 or, at your option, any later
-# version. For a full list including contact information of contributors,
+# is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 and licensed
+# under the GNU General Public License version 2 or, at your option, any later
+# version. For a full list including contact information of contributors,
# maintainers, and copyright holders, see the CONTRIBUTORS file.
#
# Original Copyright Notice from SQL-Ledger 2.6.17 (before the fork):
@@ -53,19 +53,18 @@ require "common.pl";
$| = 1;
-if ($ENV{CONTENT_LENGTH}) {
- read(STDIN, $_, $ENV{CONTENT_LENGTH});
+if ( $ENV{CONTENT_LENGTH} ) {
+ read( STDIN, $_, $ENV{CONTENT_LENGTH} );
}
-if ($ENV{QUERY_STRING}) {
- $_ = $ENV{QUERY_STRING};
+if ( $ENV{QUERY_STRING} ) {
+ $_ = $ENV{QUERY_STRING};
}
-if ($ARGV[0]) {
- $_ = $ARGV[0];
+if ( $ARGV[0] ) {
+ $_ = $ARGV[0];
}
-
%form = split /[&=]/;
# fix for apache 2.0 bug
@@ -74,7 +73,7 @@ map { $form{$_} =~ s/\\$// } keys %form;
# name of this script
$0 =~ tr/\\/\//;
$pos = rindex $0, '/';
-$script = substr($0, $pos + 1);
+$script = substr( $0, $pos + 1 );
#this needs to be a db based function
#if (-e "${LedgerSMB::Sysconfig::userspath}/nologin" && $script ne 'admin.pl') {
@@ -84,26 +83,26 @@ $script = substr($0, $pos + 1);
# exit;
#}
+if ( $form{path} ) {
-if ($form{path}) {
-
- if ($form{path} ne 'bin/lynx'){ $form{path} = 'bin/mozilla';}
+ if ( $form{path} ne 'bin/lynx' ) { $form{path} = 'bin/mozilla'; }
- $ARGV[0] = "$_&script=$script";
- require "bin/$script";
+ $ARGV[0] = "$_&script=$script";
+ require "bin/$script";
-} else {
+}
+else {
- $form{terminal} = "lynx";
+ $form{terminal} = "lynx";
- if ($ENV{HTTP_USER_AGENT} !~ /lynx/i) {
- $form{terminal} = "mozilla";
- }
+ if ( $ENV{HTTP_USER_AGENT} !~ /lynx/i ) {
+ $form{terminal} = "mozilla";
+ }
- $ARGV[0] = "path=bin/$form{terminal}&script=$script";
- map { $ARGV[0] .= "&${_}=$form{$_}" } keys %form;
+ $ARGV[0] = "path=bin/$form{terminal}&script=$script";
+ map { $ARGV[0] .= "&${_}=$form{$_}" } keys %form;
- require "bin/$script";
+ require "bin/$script";
}