From dc50b737f80c8bd09ac2fbbfa2cc06a04e9d8753 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 19 Jul 2010 18:10:14 +0200 Subject: [PATCH] fcgi patch test Conflicts: am.pl bin/mozilla/oe.pl --- SL/Form.pm | 27 +++++-- admin.pl | 148 +++++++++++++++++++++++++++++++++++- am.pl | 177 +------------------------------------------ bin/mozilla/admin.pl | 72 ++++++++---------- bin/mozilla/kopf.pl | 11 ++- bin/mozilla/login.pl | 109 ++++++++++++-------------- bin/mozilla/oe.pl | 4 +- config/lx-erp.conf | 2 +- kopf.pl | 37 +-------- locale/de/admin | 1 + login.pl | 95 +---------------------- 11 files changed, 264 insertions(+), 419 deletions(-) mode change 120000 => 100755 admin.pl mode change 100755 => 120000 am.pl mode change 100755 => 120000 kopf.pl mode change 100755 => 120000 login.pl diff --git a/SL/Form.pm b/SL/Form.pm index 7b7cb290f..c75249bac 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -743,6 +743,17 @@ sub redirect_header { return $cgi->redirect($new_uri); } +sub set_standard_title { + $::lxdebug->enter_sub; + my $self = shift; + + $self->{titlebar} = "Lx-Office " . $::locale->text('Version') . " $self->{version}"; + $self->{titlebar} .= "- $::myconfig{name}" if $::myconfig{name}; + $self->{titlebar} .= "- $::myconfig{dbname}" if $::myconfig{name}; + + $::lxdebug->leave_sub; +} + sub _prepare_html_template { $main::lxdebug->enter_sub(); @@ -961,19 +972,19 @@ sub redirect { my ($self, $msg) = @_; - if ($self->{callback}) { - - my ($script, $argv) = split(/\?/, $self->{callback}, 2); - $script =~ s|.*/||; - $script =~ s|[^a-zA-Z0-9_\.]||g; - exec("perl", "$script", $argv); - - } else { + if (!$self->{callback}) { $self->info($msg); exit; } +# my ($script, $argv) = split(/\?/, $self->{callback}, 2); +# $script =~ s|.*/||; +# $script =~ s|[^a-zA-Z0-9_\.]||g; +# exec("perl", "$script", $argv); + + print $::form->redirect_header($self->{callback}); + $main::lxdebug->leave_sub(); } diff --git a/admin.pl b/admin.pl deleted file mode 120000 index 7d7fe4ce4..000000000 --- a/admin.pl +++ /dev/null @@ -1 +0,0 @@ -login.pl \ No newline at end of file diff --git a/admin.pl b/admin.pl new file mode 100755 index 000000000..8ae43c6fb --- /dev/null +++ b/admin.pl @@ -0,0 +1,147 @@ +#!/usr/bin/perl + +use strict; + +BEGIN { + unshift @INC, "modules/override"; # Use our own versions of various modules (e.g. YAML). + push @INC, "modules/fallback"; # Only use our own versions of modules if there's no system version. + push @INC, "SL"; # FCGI won't find modules that are not properly named. Help it by inclduging SL +} + +use FCGI; +use CGI qw( -no_xhtml); +use SL::Auth; +use SL::LXDebug; +use SL::Locale; +use SL::Common; +use Form; +use Moose; +use Rose::DB; +use Rose::DB::Object; +use File::Basename; + +my ($script, $path, $suffix) = fileparse($0, ".pl"); +my $request = FCGI::Request(); + +eval { require "config/lx-erp.conf"; }; +eval { require "config/lx-erp-local.conf"; } if -f "config/lx-erp-local.conf"; +require "bin/mozilla/common.pl"; +require "bin/mozilla/installationcheck.pl"; +require_main_code($script, $suffix); + +# dummy globals +{ + no warnings 'once'; + $::userspath = "users"; + $::templates = "templates"; + $::memberfile = "users/members"; + $::sendmail = "| /usr/sbin/sendmail -t"; + $::lxdebug = LXDebug->new; + $::auth = SL::Auth->new; + %::myconfig = (); +} + +_pre_startup_checks(); + +if ($request->IsFastCGI) { + handle_request() while $request->Accept() >= 0; +} else { + handle_request(); +} + +# end + +sub handle_request { + $::lxdebug->enter_sub; + $::lxdebug->begin_request; + $::cgi = CGI->new(''); + $::locale = Locale->new($::language, $script); + $::form = Form->new; + $::form->{script} = $script . $suffix; + + _pre_request_checks(); + + eval { + if ($script eq 'login' or $script eq 'admin' or $script eq 'kopf') { + $::form->{titlebar} = "Lx-Office " . $::locale->text('Version') . " $::form->{version}"; + run($::auth->restore_session); + } elsif ($::form->{action}) { + # copy from am.pl routines + $::form->error($::locale->text('System currently down for maintenance!')) if -e "$main::userspath/nologin" && $script ne 'admin'; + + my $session_result = $::auth->restore_session; + + _show_error('login/password_error', 'session') if SL::Auth::SESSION_EXPIRED == $session_result; + %::myconfig = $::auth->read_user($::form->{login}); + + _show_error('login/password_error', 'password') unless $::myconfig{login}; + + $::locale = Locale->new($::myconfig{countrycode}, $script); + + _show_error('login/password_error', 'password') if SL::Auth::OK != $::auth->authenticate($::form->{login}, $::form->{password}, 0); + + $::auth->set_session_value('login', $::form->{login}, 'password', $::form->{password}); + $::auth->create_or_refresh_session; + delete $::form->{password}; + + map { $::form->{$_} = $::myconfig{$_} } qw(stylesheet charset) + unless $::form->{action} eq 'save' && $::form->{type} eq 'preferences'; + + $::form->set_standard_title; + call_sub($::locale->findsub($::form->{action})); + } else { + $::form->error($::locale->text('action= not defined!')); + } + }; + + # cleanup + $::locale = undef; + $::form = undef; + $::myconfig = (); + + $::lxdebug->end_request; + $::lxdebug->leave_sub; +} + +sub _pre_request_checks { + _show_error('login/auth_db_unreachable') unless $::auth->session_tables_present; + $::auth->expire_sessions; +} + +sub _show_error { + $::lxdebug->enter_sub; + my $template = shift; + my $error_type = shift; + my $locale = Locale->new($::language, 'all'); + $::form->{error} = $::locale->text('The session is invalid or has expired.') if ($error_type eq 'session'); + $::form->{error} = $::locale->text('Incorrect password!.') if ($error_type eq 'password'); + $::myconfig{countrycode} = $::language; + $::form->{stylesheet} = 'css/lx-office-erp.css'; + + $::form->header; + print $::form->parse_html_template($template); + $::lxdebug->leave_sub; + + exit; +} + +sub _pre_startup_checks { + verify_installation(); +} + +sub require_main_code { + my ($script, $suffix) = @_; + + require "bin/mozilla/$script$suffix"; + + if (-f "bin/mozilla/custom_$script$suffix") { + eval { require "bin/mozilla/custom_$script$suffix"; }; + $::form->error($@) if ($@); + } + if ($::form->{login} && -f "bin/mozilla/$::form->{login}_$::form->{script}") { + eval { require "bin/mozilla/$::form->{login}_$::form->{script}"; }; + $::form->error($@) if ($@); + } +} + +1; diff --git a/am.pl b/am.pl deleted file mode 100755 index a70e45233..000000000 --- a/am.pl +++ /dev/null @@ -1,176 +0,0 @@ -#!/usr/bin/perl -# -###################################################################### -# SQL-Ledger Accounting -# Copyright (C) 2001 -# -# Author: Dieter Simader -# Email: dsimader@sql-ledger.org -# Web: http://www.sql-ledger.org -# -# Contributors: -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -####################################################################### -# -# this script is the frontend called from bin/$terminal/$script -# all the accounting modules are linked to this script which in -# turn execute the same script in bin/$terminal/ -# -####################################################################### - -use strict; - -BEGIN { - unshift @INC, "modules/override"; # Use our own versions of various modules (e.g. YAML). - push @INC, "modules/fallback"; # Only use our own versions of modules if there's no system version. -} - -# setup defaults, DO NOT CHANGE -$main::userspath = "users"; -$main::templates = "templates"; -$main::memberfile = "users/members"; -$main::sendmail = "| /usr/sbin/sendmail -t"; -########## end ########################################### - -$| = 1; - -use SL::LXDebug; -$main::lxdebug = LXDebug->new(); - -use CGI qw( -no_xhtml); -use SL::Auth; -use SL::Form; -use SL::Locale; - -eval { require "config/lx-erp.conf"; }; -eval { require "config/lx-erp-local.conf"; } if -f "config/lx-erp-local.conf"; - -our $cgi = new CGI(''); -our $form = new Form; - -our $auth = SL::Auth->new(); -if (!$auth->session_tables_present()) { - _show_error('login/auth_db_unreachable'); -} -$auth->expire_sessions(); -my $session_result = $auth->restore_session(); - -require "bin/mozilla/common.pl"; - -if (defined($main::latex) && !defined($main::latex_templates)) { - $main::latex_templates = $main::latex; - undef($main::latex); -} - -# this prevents most of the tabindexes being created by CGI. -# note: most. popup menus and selecttables will still have tabindexes -# use common.pl's NTI function to get rid of those -local $CGI::TABINDEX = 0; - -# name of this script -$0 =~ tr/\\/\//; -my $pos = rindex $0, '/'; -my $script = substr($0, $pos + 1); - -# we use $script for the language module -$form->{script} = $script; - -# strip .pl for translation files -$script =~ s/\.pl//; - -# pull in DBI -use DBI; - -# locale messages -$main::locale = new Locale($main::language, "$script"); -my $locale = $main::locale; - -# did sysadmin lock us out -if (-e "$main::userspath/nologin") { - $form->error($locale->text('System currently down for maintenance!')); -} - -if (SL::Auth::SESSION_EXPIRED == $session_result) { - _show_error('login/password_error', 'session'); -} - -$form->{login} =~ s|.*/||; - -%main::myconfig = $auth->read_user($form->{login}); -my %myconfig = %main::myconfig; - -if (!$myconfig{login}) { - _show_error('login/password_error', 'password'); -} - -# locale messages -$locale = new Locale "$myconfig{countrycode}", "$script"; - -if (SL::Auth::OK != $auth->authenticate($form->{login}, $form->{password}, 0)) { - _show_error('login/password_error', 'password'); -} - -$auth->set_session_value('login', $form->{login}, 'password', $form->{password}); -$auth->create_or_refresh_session(); - -delete $form->{password}; - -map { $form->{$_} = $myconfig{$_} } qw(stylesheet charset) - unless (($form->{action} eq 'save') && ($form->{type} eq 'preferences')); - -# pull in the main code -require "bin/mozilla/$form->{script}"; - -# customized scripts -if (-f "bin/mozilla/custom_$form->{script}") { - eval { require "bin/mozilla/custom_$form->{script}"; }; - $form->error($@) if ($@); -} - -# customized scripts for login -if (-f "bin/mozilla/$form->{login}_$form->{script}") { - eval { require "bin/mozilla/$form->{login}_$form->{script}"; }; - $form->error($@) if ($@); -} - -if ($form->{action}) { - - # window title bar, user info - $form->{titlebar} = - "Lx-Office " - . $locale->text('Version') - . " $form->{version} - $myconfig{name} - $myconfig{dbname}"; - - call_sub($locale->findsub($form->{action})); -} else { - $form->error($locale->text('action= not defined!')); -} - -sub _show_error { - my $template = shift; - my $error_type = shift; - my $locale = Locale->new($main::language, 'all'); - $form->{error} = $locale->text('The session is invalid or has expired.') if ($error_type eq 'session'); - $form->{error} = $locale->text('Incorrect password!.') if ($error_type eq 'password'); - $myconfig{countrycode} = $main::language; - $form->{stylesheet} = 'css/lx-office-erp.css'; - - $form->header(); - print $form->parse_html_template($template); - exit; -} - -# end - diff --git a/am.pl b/am.pl new file mode 120000 index 000000000..05c4a229e --- /dev/null +++ b/am.pl @@ -0,0 +1 @@ +admin.pl \ No newline at end of file diff --git a/bin/mozilla/admin.pl b/bin/mozilla/admin.pl index 42efda842..8bd621c80 100755 --- a/bin/mozilla/admin.pl +++ b/bin/mozilla/admin.pl @@ -57,56 +57,48 @@ require "bin/mozilla/admin_groups.pl"; use strict; -our $cgi = new CGI(''); -our $form = new Form; -our $locale = new Locale $main::language, "admin"; -our $auth = SL::Auth->new(); - -if ($auth->session_tables_present()) { - $auth->expire_sessions(); - $auth->restore_session(); - $auth->set_session_value('rpw', $form->{rpw}); -} - -# customization -if (-f "bin/mozilla/custom_$form->{script}") { - eval { require "bin/mozilla/custom_$form->{script}"; }; - $form->error($@) if ($@); -} +our $cgi; +our $form; +our $locale; +our $auth; -$form->{stylesheet} = "lx-office-erp.css"; -$form->{favicon} = "favicon.ico"; +sub run { + $::lxdebug->enter_sub; + my $session_result = shift; -if ($form->{action}) { - if ($auth->authenticate_root($form->{rpw}, 0) != $auth->OK()) { - $form->{error_message} = $locale->text('Incorrect Password!'); - adminlogin(); - exit; - } + $cgi = $::cgi; + $form = $::form; + $locale = $::locale; + $auth = $::auth; - $auth->create_or_refresh_session() if ($auth->session_tables_present()); + $::auth->set_session_value('rpw', $::form->{rpw}) if $session_result == SL::Auth->SESSION_OK; - call_sub($locale->findsub($form->{action})); - -} elsif ($auth->authenticate_root($form->{rpw}, 0) == $auth->OK()) { - - $auth->create_or_refresh_session() if ($auth->session_tables_present()); + $form->{stylesheet} = "lx-office-erp.css"; + $form->{favicon} = "favicon.ico"; - login(); + if ($form->{action}) { + if ($auth->authenticate_root($form->{rpw}, 0) != $auth->OK()) { + $form->{error_message} = $locale->text('Incorrect Password!'); + adminlogin(); + } else { + $auth->create_or_refresh_session() if ($auth->session_tables_present()); + call_sub($locale->findsub($form->{action})); + } + } elsif ($auth->authenticate_root($form->{rpw}, 0) == $auth->OK()) { -} else { - # if there are no drivers bail out - $form->error($locale->text('No Database Drivers available!')) - unless (User->dbdrivers); + $auth->create_or_refresh_session() if ($auth->session_tables_present()); - adminlogin(); + login(); + } else { + # if there are no drivers bail out + $form->error($locale->text('No Database Drivers available!')) + unless (User->dbdrivers); + adminlogin(); + } + $::lxdebug->leave_sub; } -1; - -# end - sub adminlogin { my $form = $main::form; my $locale = $main::locale; diff --git a/bin/mozilla/kopf.pl b/bin/mozilla/kopf.pl index e8fa8a35a..1b72e46b1 100644 --- a/bin/mozilla/kopf.pl +++ b/bin/mozilla/kopf.pl @@ -1,12 +1,15 @@ #!/usr/bin/perl # -$| = 1; +#$| = 1; -use CGI::Carp qw(fatalsToBrowser); +#use CGI::Carp qw(fatalsToBrowser); use strict; +sub run { + my $session_result = shift; + my $form = $main::form; my $locale = $main::locale; @@ -123,4 +126,8 @@ print qq| |; +} + +1; + # diff --git a/bin/mozilla/login.pl b/bin/mozilla/login.pl index 82d50d706..5a5aa42b7 100644 --- a/bin/mozilla/login.pl +++ b/bin/mozilla/login.pl @@ -37,73 +37,52 @@ require "bin/mozilla/todo.pl"; use strict; -# This is required because the am.pl in the root directory -# is not scanned by locales.pl: -# $form->parse_html_template('login/password_error') +our $cgi; +our $form; +our $locale; +our $auth; -our $form = new Form; +sub run { + $::lxdebug->enter_sub; + my $session_result = shift; -if (! -f 'config/authentication.pl') { - show_error('login/authentication_pl_missing'); -} - -our $locale = new Locale $main::language, "login"; - -our $auth = SL::Auth->new(); -if (!$auth->session_tables_present()) { - show_error('login/auth_db_unreachable'); -} -$auth->expire_sessions(); -my $session_result = $main::auth->restore_session(); - -# customization -if (-f "bin/mozilla/custom_$form->{script}") { - eval { require "bin/mozilla/custom_$form->{script}"; }; - $form->error($@) if ($@); -} - -# per login customization -if (-f "bin/mozilla/$form->{login}_$form->{script}") { - eval { require "bin/mozilla/$form->{login}_$form->{script}"; }; - $form->error($@) if ($@); -} - -# window title bar, user info -$form->{titlebar} = "Lx-Office " . $locale->text('Version') . " $form->{version}"; - -if (SL::Auth::SESSION_EXPIRED == $session_result) { - $form->{error_message} = $locale->text('The session is invalid or has expired.'); - login_screen(); - exit; -} - -my $action = $form->{action}; + $cgi = $::cgi; + $form = $::form; + $locale = $::locale; + $auth = $::auth; -if (!$action && $auth->{SESSION}->{login}) { - $action = 'login'; -} - -if ($action) { - our %myconfig = $auth->read_user($form->{login}) if ($form->{login}); + $form->{stylesheet} = "lx-office-erp.css"; + $form->{favicon} = "favicon.ico"; - if (!$myconfig{login} || (SL::Auth::OK != $auth->authenticate($form->{login}, $form->{password}, 0))) { - $form->{error_message} = $locale->text('Incorrect Password!'); + if (SL::Auth::SESSION_EXPIRED == $session_result) { + $form->{error_message} = $locale->text('The session is invalid or has expired.'); login_screen(); exit; } + my $action = $form->{action}; + if (!$action && $auth->{SESSION}->{login}) { + $action = 'login'; + } + if ($action) { + our %myconfig = $auth->read_user($form->{login}) if ($form->{login}); + + if (!$myconfig{login} || (SL::Auth::OK != $auth->authenticate($form->{login}, $form->{password}, 0))) { + $form->{error_message} = $locale->text('Incorrect Password!'); + login_screen(); + } else { + $auth->set_session_value('login', $form->{login}, 'password', $form->{password}); + $auth->create_or_refresh_session(); + + $form->{titlebar} .= " - $myconfig{name} - $myconfig{dbname}"; + call_sub($locale->findsub($action)); + } + } else { + login_screen(); + } - $auth->set_session_value('login', $form->{login}, 'password', $form->{password}); - $auth->create_or_refresh_session(); - - $form->{titlebar} .= " - $myconfig{name} - $myconfig{dbname}"; - call_sub($locale->findsub($action)); - -} else { - login_screen(); + $::lxdebug->leave_sub; } -1; - sub login_screen { $main::lxdebug->enter_sub(); my ($msg) = @_; @@ -147,11 +126,20 @@ sub login { my $menu_script = $style_to_script_map{$user->{menustyle}} || ''; # made it this far, execute the menu - $form->{callback} = build_std_url("script=menu${menu_script}.pl", 'action=display', "callback=" . $form->escape($form->{callback})); + # standard redirect does not seem to work for this invocation, (infinite loops?) + # do a manual invocation instead +# $form->{callback} = build_std_url("script=menu${menu_script}.pl", 'action=display', "callback=" . $form->escape($form->{callback})); $main::auth->set_cookie_environment_variable(); - $form->redirect(); + $::form->{script} = "menu${menu_script}.pl"; + $::form->{action} = 'display'; + $::form->{callback} = $::form->escape($::form->{callback}); + + require "bin/mozilla/$::form->{script}"; + display(); + +# $form->redirect(); $main::lxdebug->leave_sub(); } @@ -203,3 +191,6 @@ sub show_error { exit; } +1; + +__END__ diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index bef23176a..f40e918f9 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -51,7 +51,7 @@ require "bin/mozilla/reportgenerator.pl"; use strict; my $print_post; -my %TMPL_VAR; +our %TMPL_VAR; 1; @@ -302,7 +302,7 @@ sub form_header { check_oe_access(); # Container for template variables. Unfortunately this has to be - # visible in form_footer too, so my at package level and not here. + # visible in form_footer too, so package local level and not my here. %TMPL_VAR = (); $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); diff --git a/config/lx-erp.conf b/config/lx-erp.conf index 300d1a7bc..810c723ce 100644 --- a/config/lx-erp.conf +++ b/config/lx-erp.conf @@ -106,7 +106,7 @@ $pg_restore_exe = "pg_restore"; # # Beipiel: # $LXDebug::global_level = LXDebug::TRACE | LXDebug::QUERY; -$LXDebug::global_level = LXDebug::NONE; +$LXDebug::global_level = LXDebug->NONE; # Überwachung der Inhalte von $form aktiviert oder nicht? Wenn ja, # dann können einzelne Variablen mit diff --git a/kopf.pl b/kopf.pl deleted file mode 100755 index b01c42a10..000000000 --- a/kopf.pl +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/perl -# - -use strict; - -BEGIN { - unshift @INC, "modules/override"; # Use our own versions of various modules (e.g. YAML). - push @INC, "modules/fallback"; # Only use our own versions of modules if there's no system version. -} - -use SL::LXDebug; -our $lxdebug = LXDebug->new(); - -use SL::Auth; -use SL::Form; -use SL::Locale; - -eval { require "config/lx-erp.conf"; }; -eval { require "config/lx-erp-local.conf"; } if (-f "config/lx-erp-local.conf"); - -our $form = new Form; - -our $auth = SL::Auth->new(); -if (!$auth->session_tables_present()) { - _show_error('login/auth_db_unreachable'); -} -$auth->expire_sessions(); -$auth->restore_session(); - -our %myconfig = $auth->read_user($form->{login}); - -our $locale = new Locale "$myconfig{countrycode}", "kopf"; - -delete $form->{password}; - -eval { require "bin/mozilla/kopf.pl"; }; diff --git a/kopf.pl b/kopf.pl new file mode 120000 index 000000000..05c4a229e --- /dev/null +++ b/kopf.pl @@ -0,0 +1 @@ +admin.pl \ No newline at end of file diff --git a/locale/de/admin b/locale/de/admin index b0933a8e5..e77ff22fa 100644 --- a/locale/de/admin +++ b/locale/de/admin @@ -268,6 +268,7 @@ $self->{subs} = { 'restore_dataset' => 'restore_dataset', 'restore_dataset_start' => 'restore_dataset_start', 'retrieve_partunits' => 'retrieve_partunits', + 'run' => 'run', 'sales_invoice' => 'sales_invoice', 'save' => 'save', 'save_group' => 'save_group', diff --git a/login.pl b/login.pl deleted file mode 100755 index e8a3c5b62..000000000 --- a/login.pl +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/perl -# -###################################################################### -# SQL-Ledger Accounting -# Copyright (C) 2001 -# -# Author: Dieter Simader -# Email: dsimader@sql-ledger.org -# Web: http://www.sql-ledger.org -# -# Contributors: -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -####################################################################### -# -# this script sets up the terminal and runs the scripts -# in bin/$terminal directory -# admin.pl is linked to this script -# -####################################################################### - -use strict; - -BEGIN { - unshift @INC, "modules/override"; # Use our own versions of various modules (e.g. YAML). - push @INC, "modules/fallback"; # Only use our own versions of modules if there's no system version. -} - -# setup defaults, DO NOT CHANGE -$main::userspath = "users"; -$main::templates = "templates"; -$main::memberfile = "users/members"; -$main::sendmail = "| /usr/sbin/sendmail -t"; -########## end ########################################### - -$| = 1; - -use SL::LXDebug; -$main::lxdebug = LXDebug->new(); - -eval { require "config/lx-erp.conf"; }; -eval { require "config/lx-erp-local.conf"; } if -f "config/lx-erp-local.conf"; - -if ($ENV{CONTENT_LENGTH}) { - read(STDIN, $_, $ENV{CONTENT_LENGTH}); -} - -if ($ENV{QUERY_STRING}) { - $_ = $ENV{QUERY_STRING}; -} - -if ($ARGV[0]) { - $_ = $ARGV[0]; -} - -my %form = split /[&=]/; - -# fix for apache 2.0 bug -map { $form{$_} =~ s/\\$// } keys %form; - -# name of this script -$0 =~ tr/\\/\//; -my $pos = rindex $0, '/'; -my $script = substr($0, $pos + 1); - -$form{login} =~ s|.*/||; - -if (-e "$main::userspath/nologin" && $script ne 'admin.pl') { - print "content-type: text/plain - -Login disabled!\n"; - - exit; -} - -require "bin/mozilla/installationcheck.pl"; -verify_installation(); - -$ARGV[0] = "$_&script=$script"; -require "bin/mozilla/$script"; - -# end of main - diff --git a/login.pl b/login.pl new file mode 120000 index 000000000..05c4a229e --- /dev/null +++ b/login.pl @@ -0,0 +1 @@ +admin.pl \ No newline at end of file -- 2.20.1