X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=scripts%2Fconsole;h=e183ac83a516b5fb2bf85b7aa881e1ac6c03e83b;hb=872f04a75528d55c3987c09fa0445451c35c6ef9;hp=78b73055920ed497c607173b0730d8104caf710f;hpb=3d7898cf2bab46c72face3011460d093d8778b32;p=kivitendo-erp.git diff --git a/scripts/console b/scripts/console index 78b730559..e183ac83a 100755 --- a/scripts/console +++ b/scripts/console @@ -18,6 +18,7 @@ SL::LxOfficeConf->read; 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 @@ -43,6 +44,7 @@ use DateTime; use SL::Auth; use SL::Form; use SL::Helper::DateTime; +use SL::InstanceConfiguration; use SL::Locale; use SL::LXDebug; use Data::Dumper; @@ -58,11 +60,12 @@ sub lxinit { package main; - $::lxdebug = LXDebug->new; - $::locale = Locale->new($::lx_office_conf{system}->{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; @@ -70,12 +73,13 @@ sub lxinit { require "bin/mozilla/common.pl"; - die "cannot find user $login" unless %::myconfig = $::auth->read_user($login); + die "cannot find user $login" unless %::myconfig = $::auth->read_user(login => $login); $::form->{login} = $login; # normaly implicit at login die "cannot find locale for user $login" unless $::locale = Locale->new($::myconfig{countrycode}); + $::instance_conf->init; return "logged in as $login"; } @@ -131,7 +135,7 @@ __END__ =head1 NAME -scripts/console - Lx Office Console +scripts/console - Lx-Office console =head1 SYNOPSIS @@ -184,8 +188,8 @@ of the classes they were created with. Configuration of this script is located in: - config/lx_office.conf - config/lx_office.conf.default + config/kivitendo.conf + config/kivitendo.conf.default See there for interesting options.