projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kosmetik: Templatenamen in Fehlermeldung nicht doppelt ausgeben
[kivitendo-erp.git]
/
bin
/
mozilla
/
login.pl
diff --git
a/bin/mozilla/login.pl
b/bin/mozilla/login.pl
index
622db69
..
3c90891
100644
(file)
--- a/
bin/mozilla/login.pl
+++ b/
bin/mozilla/login.pl
@@
-39,23
+39,20
@@
use strict;
our $cgi;
our $form;
our $cgi;
our $form;
-our $locale;
our $auth;
sub run {
$::lxdebug->enter_sub;
my $session_result = shift;
our $auth;
sub run {
$::lxdebug->enter_sub;
my $session_result = shift;
- $cgi = $::cgi;
$form = $::form;
$form = $::form;
- $locale = $::locale;
$auth = $::auth;
$form->{stylesheet} = "lx-office-erp.css";
$form->{favicon} = "favicon.ico";
if (SL::Auth::SESSION_EXPIRED == $session_result) {
$auth = $::auth;
$form->{stylesheet} = "lx-office-erp.css";
$form->{favicon} = "favicon.ico";
if (SL::Auth::SESSION_EXPIRED == $session_result) {
- $form->{error_message} = $locale->text('The session is invalid or has expired.');
+ $form->{error_message} = $
::
locale->text('The session is invalid or has expired.');
login_screen();
::end_of_request();
}
login_screen();
::end_of_request();
}
@@
-64,17
+61,19
@@
sub run {
$action = 'login';
}
if ($action) {
$action = 'login';
}
if ($action) {
- our %myconfig = $auth->read_user($form->{login}) if ($form->{login});
+ %::myconfig = $auth->read_user(login => $form->{login}) if ($form->{login});
+ $::locale = Locale->new($::myconfig{countrycode}) if $::myconfig{countrycode};
- if (
!$myconfig{login} || (SL::Auth::OK != $auth->authenticate($form->{login}, $form->{password}, 0)
)) {
- $form->{error_message} = $
locale->text('Incorrect P
assword!');
+ if (
SL::Auth::OK != $auth->authenticate($::myconfig{login}, $form->{password}
)) {
+ $form->{error_message} = $
::locale->text('Incorrect username or p
assword!');
login_screen();
} else {
login_screen();
} else {
- $auth->s
et_session_value('login', $form->{login}, 'password',
$form->{password});
+ $auth->s
tore_credentials_in_session(login => $form->{login}, password =>
$form->{password});
$auth->create_or_refresh_session();
$auth->create_or_refresh_session();
+ delete $form->{password};
- $form->{titlebar} .= " - $
myconfig{name} - $
myconfig{dbname}";
- call_sub($locale->findsub($action));
+ $form->{titlebar} .= " - $
::myconfig{name} - $::
myconfig{dbname}";
+ call_sub($
::
locale->findsub($action));
}
} else {
login_screen();
}
} else {
login_screen();
@@
-103,25
+102,31
@@
sub login {
$main::lxdebug->enter_sub();
unless ($form->{login}) {
$main::lxdebug->enter_sub();
unless ($form->{login}) {
- login_screen($locale->text('You did not enter a name!'));
+ login_screen($
::
locale->text('You did not enter a name!'));
::end_of_request();
}
::end_of_request();
}
- my $user =
new User $form->{login}
;
+ my $user =
User->new(login => $form->{login})
;
# if we get an error back, bale out
my $result;
if (($result = $user->login($form)) <= -1) {
# if we get an error back, bale out
my $result;
if (($result = $user->login($form)) <= -1) {
+ if ($result == -3) {
+ show_error('login/auth_db_needs_update');
+ $::auth->destroy_session;
+ ::end_of_request();
+ }
+
::end_of_request() if $result == -2;
::end_of_request() if $result == -2;
- login_screen($locale->text('Incorrect username or password!'));
+ login_screen($
::
locale->text('Incorrect username or password!'));
::end_of_request();
}
::end_of_request();
}
- my %style_to_script_map = (
'v3' => 'v3',
-
'neu' => 'new
',
-
'v4' => 'v4
',
-
'xml' => 'XML
',
-
);
+ my %style_to_script_map = (
+
v3 => 'v3
',
+
neu => 'new
',
+
v4 => 'v4
',
+ );
my $menu_script = $style_to_script_map{$user->{menustyle}} || '';
my $menu_script = $style_to_script_map{$user->{menustyle}} || '';
@@
-151,7
+156,7
@@
sub logout {
# remove the callback to display the message
$form->{callback} = "login.pl?action=";
# remove the callback to display the message
$form->{callback} = "login.pl?action=";
- $form->redirect($locale->text('You are logged out!'));
+ $form->redirect($
::
locale->text('You are logged out!'));
$main::lxdebug->leave_sub();
}
$main::lxdebug->leave_sub();
}
@@
-160,12
+165,11
@@
sub company_logo {
$main::lxdebug->enter_sub();
my %myconfig = %main::myconfig;
$main::lxdebug->enter_sub();
my %myconfig = %main::myconfig;
- $locale = new Locale $myconfig{countrycode}, "login" if ($main::language ne $myconfig{countrycode});
-
$form->{todo_list} = create_todo_list('login_screen' => 1) if (!$form->{no_todo_list});
$form->{stylesheet} = $myconfig{stylesheet};
$form->{todo_list} = create_todo_list('login_screen' => 1) if (!$form->{no_todo_list});
$form->{stylesheet} = $myconfig{stylesheet};
- $form->{title} = $locale->text('About');
+ $form->{title} = $::locale->text('kivitendo');
+ $form->{interface} = $::dispatcher->interface_type;
# create the logo screen
$form->header() unless $form->{noheader};
# create the logo screen
$form->header() unless $form->{noheader};
@@
-177,15
+181,15
@@
sub company_logo {
sub show_error {
my $template = shift;
sub show_error {
my $template = shift;
- my %myconfig = %main::myconfig;
- $locale = Locale->new($main::language, 'all');
- $myconfig{countrycode} = $main::language;
+ my %myconfig = %main::myconfig;
+ $myconfig{countrycode} = $::lx_office_conf{system}->{language};
$form->{stylesheet} = 'css/lx-office-erp.css';
$form->header();
print $form->parse_html_template($template);
# $form->parse_html_template('login/auth_db_unreachable');
$form->{stylesheet} = 'css/lx-office-erp.css';
$form->header();
print $form->parse_html_template($template);
# $form->parse_html_template('login/auth_db_unreachable');
+ # $form->parse_html_template('login/auth_db_needs_update');
# $form->parse_html_template('login/authentication_pl_missing');
::end_of_request();
# $form->parse_html_template('login/authentication_pl_missing');
::end_of_request();