CSV-Import-Script: Dokumentation zum Doublettencheck erweitert
[kivitendo-erp.git] / scripts / console
index fa570c3..239ed54 100755 (executable)
@@ -18,7 +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 $debug_file   =          $::lx_office_conf{console}{log_file}     || '/tmp/lxoffice_console_debug.log';
 my $autorun      =          $::lx_office_conf{console}{autorun};
 
 # will be configed eventually
@@ -44,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;
@@ -59,11 +60,12 @@ sub lxinit {
 
   package main;
 
-  $::lxdebug = LXDebug->new(file => $debug_file);
-  $::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;
 
@@ -71,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";
 }
@@ -103,14 +106,14 @@ sub quit {
 sub help {
   print <<EOL;
 
-  Lx-Office Konsole
+  kivitendo Konsole
 
   ./scripts/console [login]
 
 Spezielle Kommandos:
 
   help                - zeigt diese Hilfe an.
-  lxinit 'login'      - lädt das Lx-Office Environment für den User 'login'.
+  lxinit 'login'      - lädt das kivitendo-Environment für den User 'login'.
   reload              - lädt modifizierte Module neu.
   pp DATA             - zeigt die Datenstruktur mit Data::Dumper an.
   quit                - beendet die Konsole
@@ -132,7 +135,7 @@ __END__
 
 =head1 NAME
 
-scripts/console - Lx Office Console
+scripts/console - kivitendo console
 
 =head1 SYNOPSIS
 
@@ -185,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.