projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Menü refactored damit keine Icons verloren gehen.
[kivitendo-erp.git]
/
scripts
/
console
diff --git
a/scripts/console
b/scripts/console
index
d7679d0
..
e3129a0
100755
(executable)
--- a/
scripts/console
+++ b/
scripts/console
@@
-29,11
+29,21
@@
$repl->load_history($history_file);
$repl->eval('help');
$repl->print("trying to auto login as '$login'...");
$repl->print($repl->eval("lxinit '$login'"));
$repl->eval('help');
$repl->print("trying to auto login as '$login'...");
$repl->print($repl->eval("lxinit '$login'"));
-$repl->print($repl->eval($autorun)) if $autorun;
+if ($autorun) {
+ my $result = $repl->eval($autorun);
+ $repl->print($result->message) if ref($result) eq 'Devel::REPL::Error';
+}
$repl->run;
package Devel::REPL;
$repl->run;
package Devel::REPL;
+use utf8;
+use CGI qw( -no_xhtml);
+use SL::Auth;
+use SL::Form;
+use SL::Locale;
+use SL::LXDebug;
+use Data::Dumper;
# this is a cleaned up version of am.pl
# it lacks redirection, some html setup and most of the authentication process.
# this is a cleaned up version of am.pl
# it lacks redirection, some html setup and most of the authentication process.
@@
-49,25
+59,17
@@
sub lxinit {
{ no warnings 'once';
$::userspath = "users";
$::templates = "templates";
{ no warnings 'once';
$::userspath = "users";
$::templates = "templates";
- $::memberfile = "users/members";
$::sendmail = "| /usr/sbin/sendmail -t";
}
$::sendmail = "| /usr/sbin/sendmail -t";
}
- use SL::LXDebug;
- $::lxdebug = LXDebug->new;
-
- use CGI qw( -no_xhtml);
- use SL::Auth;
- use SL::Form;
- use SL::Locale;
- use Data::Dumper;
-
eval { require "config/lx-erp.conf"; };
eval { require "config/lx-erp-local.conf"; } if -f "config/lx-erp-local.conf";
eval { require "config/lx-erp.conf"; };
eval { require "config/lx-erp-local.conf"; } if -f "config/lx-erp-local.conf";
- $::cgi = CGI->new qw();
- $::form = Form->new;
- $::auth = SL::Auth->new;
+ $::lxdebug = LXDebug->new;
+ $::locale = Locale->new($::language);
+ $::cgi = CGI->new qw();
+ $::form = Form->new;
+ $::auth = SL::Auth->new;
die 'cannot reach auth db' unless $::auth->session_tables_present;
die 'cannot reach auth db' unless $::auth->session_tables_present;
@@
-76,8
+78,12
@@
sub lxinit {
require "bin/mozilla/common.pl";
die "cannot find user $login" unless %::myconfig = $::auth->read_user($login);
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});
die "cannot find locale for user $login" unless $::locale = Locale->new($::myconfig{countrycode});
+
return "logged in as $login";
}
return "logged in as $login";
}
@@
-90,7
+96,7
@@
sub load {
}
sub reload {
}
sub reload {
-
us
e Module::Reload;
+
requir
e Module::Reload;
Module::Reload->check();
return "modules reloaded";
Module::Reload->check();
return "modules reloaded";
@@
-110,18
+116,19
@@
sub help {
Spezielle Kommandos:
help - zeigt diese Hilfe an.
Spezielle Kommandos:
help - zeigt diese Hilfe an.
- lxinit 'login' - l
ädt das Lx-Office Environment fü
r den User 'login'.
- reload - l
ä
dt modifizierte Module neu.
+ lxinit 'login' - l
ädt das Lx-Office 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
EOL
pp DATA - zeigt die Datenstruktur mit Data::Dumper an.
quit - beendet die Konsole
EOL
-# load 'module' - l
ä
d das angegebene Modul, d.h. bin/mozilla/module.pl und SL/Module.pm.
+# load 'module' - l
ä
d das angegebene Modul, d.h. bin/mozilla/module.pl und SL/Module.pm.
}
sub pp {
}
sub pp {
- $Data::Dumper::Indent = 2;
- $Data::Dumper::Maxdepth = 2;
+ local $Data::Dumper::Indent = 2;
+ local $Data::Dumper::Maxdepth = 2;
+ local $Data::Dumper::Sortkeys = 1;
Data::Dumper::Dumper(@_);
}
Data::Dumper::Dumper(@_);
}
@@
-191,6
+198,6
@@
See there for interesting options.
=head1 AUTHOR
=head1 AUTHOR
- Sven Sch
ö
ling <s.schoeling@linet-services.de>
+ Sven Sch
ö
ling <s.schoeling@linet-services.de>
=cut
=cut