X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fadmin.pl;h=5f3e0b19d8f2e95406aa48c8c58a48ba1e65a30a;hb=16455a4f7a2e871d645485ffb5904d197b907217;hp=4e33ef200c80fedbd94c2434962d5c38103f5007;hpb=8cbf20b55bb339ed4940711d371d6b607dcac8e4;p=kivitendo-erp.git diff --git a/bin/mozilla/admin.pl b/bin/mozilla/admin.pl old mode 100644 new mode 100755 index 4e33ef200..5f3e0b19d --- a/bin/mozilla/admin.pl +++ b/bin/mozilla/admin.pl @@ -32,1722 +32,498 @@ # #====================================================================== -$menufile = "menu.ini"; - use DBI; -use CGI; - +use Encode; +use English qw(-no_match_vars); +use Fcntl; +use File::Copy; +use File::Find; +use File::Spec; +use Cwd; +use IO::Dir; +use IO::File; +use POSIX qw(strftime); +use Sys::Hostname; + +use SL::Auth; +use SL::Auth::PasswordPolicy; +use SL::DB::AuthClient; +use SL::DB::AuthUser; use SL::Form; +use SL::Iconv; +use SL::Mailer; use SL::User; use SL::Common; +use SL::Inifile; +use SL::DBUpgrade2; +use SL::DBUtils; +use SL::Template; require "bin/mozilla/common.pl"; -our $cgi = new CGI(''); +use strict; -$form = new Form; -$form->{"root"} = "root login"; +# parserhappy(R): -$locale = new Locale $language, "admin"; +# $locale->text('periodic') +# $locale->text('income') +# $locale->text('perpetual') +# $locale->text('balance') -# 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}) { + $form = $::form; + $locale = $::locale; + $auth = $::auth; + $::request->{layout} = SL::Layout::Dispatcher->new(style => 'admin'); + $::request->{layout}->use_stylesheet("lx-office-erp.css"); + $form->{favicon} = "favicon.ico"; - $subroutine = $locale->findsub($form->{action}); + if ($form->{action}) { + if ($auth->authenticate_root($form->{'{AUTH}admin_password'}) != $auth->OK()) { + $auth->punish_wrong_login; + $form->{error} = $locale->text('Incorrect password!'); + $auth->delete_session_value('admin_password'); + adminlogin(); + } else { + if ($auth->session_tables_present()) { + delete $::form->{'{AUTH}admin_password'}; + } - if ($subroutine eq 'login') { - if ($form->{rpw}) { - $form->{rpw} = crypt $form->{rpw}, "ro"; + call_sub($locale->findsub($form->{action})); } + } else { + adminlogin(); } - - &check_password; - - call_sub($subroutine); - -} else { - - # if there are no drivers bail out - $form->error($locale->text('No Database Drivers available!')) - unless (User->dbdrivers); - - # create memberfile - if (!-f $memberfile) { - open(FH, ">$memberfile") or $form->error("$memberfile : $!"); - print FH qq|# SQL-Ledger Accounting members - -[root login] -password= - -|; - close FH; - } - - &adminlogin; - + $::lxdebug->leave_sub; } -1; - -# end - sub adminlogin { - - $form->{title} = - qq|Lx-Office ERP $form->{version} | . $locale->text('Administration'); - - $form->header; - - print qq| -
- - -| - . $locale->text('Administration') - . qq| - -
- -Lx-Office | - . $locale->text('website') . qq| - -