X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=scripts%2Fconsole;h=50febadb60d1842bb73aa98bb33ab75012acb0b1;hb=919aac7928355937d6eedf8df4da56808ebd4eb9;hp=2613c72379b1da63b800efbafdaafd2a4e3201e1;hpb=f2af9def6777d0192a83c8a86f1332569c742051;p=kivitendo-erp.git diff --git a/scripts/console b/scripts/console index 2613c7237..50febadb6 100755 --- a/scripts/console +++ b/scripts/console @@ -9,16 +9,17 @@ BEGIN { push @INC, "modules/fallback"; # Only use our own versions of modules if there's no system version. } -use Config::Std; use Data::Dumper; use Devel::REPL 1.002001; use Term::ReadLine::Perl::Bind; # use sane key binding for rxvt users -read_config 'config/lx_office.conf' => my %config; +use SL::LxOfficeConf; +SL::LxOfficeConf->read; -my $login = shift || $config{Console}{login} || 'demo'; -my $history_file = $config{Console}{history_file} || '/tmp/lxoffice_console_history.log'; # fallback if users is not writable -my $autorun = $config{Console}{autorun}; +my $login = shift || $::lx_office_conf{console}{login} || 'demo'; +my $history_file = $::lx_office_conf{console}{history_file} || '/tmp/lxoffice_console_history.log'; # fallback if users is not writable +my $debug_file = $::lx_office_conf{console}{log_file} || '/tmp/lxoffice_console_debug.log'; +my $autorun = $::lx_office_conf{console}{autorun}; # will be configed eventually my @plugins = qw(History LexEnv Colors MultiLine::PPI FancyPrompt PermanentHistory AutoloadModules); @@ -41,9 +42,9 @@ use utf8; use CGI qw( -no_xhtml); use DateTime; use SL::Auth; -use SL::Dispatcher; use SL::Form; use SL::Helper::DateTime; +use SL::InstanceConfiguration; use SL::Locale; use SL::LXDebug; use Data::Dumper; @@ -59,17 +60,12 @@ sub lxinit { package main; - eval { require "config/lx-erp.conf"; }; - eval { require "config/lx-erp-local.conf"; } if -f "config/lx-erp-local.conf"; - - read_config 'config/lx_office.conf' => %::lx_office_conf; - SL::Dispatcher::_decode_recursively(\%::lx_office_conf); - - $::lxdebug = LXDebug->new; - $::locale = Locale->new($::language); - $::cgi = CGI->new qw(); - $::form = Form->new; - $::auth = SL::Auth->new; + $::lxdebug = LXDebug->new(file => $debug_file); + $::locale = Locale->new($::lx_office_conf{system}->{language}); + $::form = Form->new; + $::auth = SL::Auth->new; + $::instance_conf = SL::InstanceConfiguration->new; + $::request = { cgi => CGI->new({}) }; die 'cannot reach auth db' unless $::auth->session_tables_present; @@ -83,6 +79,7 @@ sub lxinit { die "cannot find locale for user $login" unless $::locale = Locale->new($::myconfig{countrycode}); + $::instance_conf->init; return "logged in as $login"; } @@ -138,7 +135,7 @@ __END__ =head1 NAME -scripts/console - Lx Office Console +scripts/console - Lx-Office console =head1 SYNOPSIS