X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=scripts%2Fconsole;h=added9f839fd9dfb8b32b765f4d09f4b821f7b4b;hb=abc7d88b97193fe5c1c23071cd56b62e928b1fd9;hp=dcaaabc115349eada45afdb5fa2c9d3b4523fbc4;hpb=f942a47abc0f2d930bc97002fd0cbefe8df58b83;p=kivitendo-erp.git diff --git a/scripts/console b/scripts/console index dcaaabc11..added9f83 100755 --- a/scripts/console +++ b/scripts/console @@ -14,7 +14,7 @@ use Data::Dumper; use Devel::REPL 1.002001; use Term::ReadLine::Perl::Bind; # use sane key binding for rxvt users -read_config 'config/console.conf' => my %config;# if -f 'config/console.conf'; +read_config 'config/lx_office.conf' => my %config; 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 @@ -39,8 +39,11 @@ package Devel::REPL; use utf8; use CGI qw( -no_xhtml); +use DateTime; use SL::Auth; +use SL::Dispatcher; use SL::Form; +use SL::Helper::DateTime; use SL::Locale; use SL::LXDebug; use Data::Dumper; @@ -71,6 +74,9 @@ sub lxinit { $::form = Form->new; $::auth = SL::Auth->new; + read_config 'config/lx_office.conf' => %::lx_office_conf; + SL::Dispatcher::_decode_recursively(\%::lx_office_conf); + die 'cannot reach auth db' unless $::auth->session_tables_present; $::auth->restore_session; @@ -78,8 +84,12 @@ sub lxinit { require "bin/mozilla/common.pl"; die "cannot find user $login" unless %::myconfig = $::auth->read_user($login); + + $::form->{login} = $login; # normaly implicit at login + die "cannot find locale for user $login" unless $::locale = Locale->new($::myconfig{countrycode}); + return "logged in as $login"; } @@ -124,6 +134,7 @@ EOL sub pp { local $Data::Dumper::Indent = 2; local $Data::Dumper::Maxdepth = 2; + local $Data::Dumper::Sortkeys = 1; Data::Dumper::Dumper(@_); } @@ -186,8 +197,8 @@ of the classes they were created with. Configuration of this script is located in: - config/console.conf - config/console.conf.default + config/lx_office.conf + config/lx_office.conf.default See there for interesting options.