projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of lx-office.linet-services.de:lx-office-erp
[kivitendo-erp.git]
/
bin
/
mozilla
/
login.pl
diff --git
a/bin/mozilla/login.pl
b/bin/mozilla/login.pl
index
5a5aa42
..
03e6dd9
100644
(file)
--- a/
bin/mozilla/login.pl
+++ b/
bin/mozilla/login.pl
@@
-39,7
+39,6
@@
use strict;
our $cgi;
our $form;
our $cgi;
our $form;
-our $locale;
our $auth;
sub run {
our $auth;
sub run {
@@
-48,33
+47,33
@@
sub run {
$cgi = $::cgi;
$form = $::form;
$cgi = $::cgi;
$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();
login_screen();
-
exit
;
+
::end_of_request()
;
}
my $action = $form->{action};
if (!$action && $auth->{SESSION}->{login}) {
$action = 'login';
}
if ($action) {
}
my $action = $form->{action};
if (!$action && $auth->{SESSION}->{login}) {
$action = 'login';
}
if ($action) {
- our %myconfig = $auth->read_user($form->{login}) if ($form->{login});
+ %::myconfig = $auth->read_user($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 {
$auth->set_session_value('login', $form->{login}, 'password', $form->{password});
$auth->create_or_refresh_session();
login_screen();
} else {
$auth->set_session_value('login', $form->{login}, 'password', $form->{password});
$auth->create_or_refresh_session();
- $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,8
+102,8
@@
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!'));
-
exit
;
+ login_screen($
::
locale->text('You did not enter a name!'));
+
::end_of_request()
;
}
my $user = new User $form->{login};
}
my $user = new User $form->{login};
@@
-112,9
+111,9
@@
sub 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) {
-
exit
if $result == -2;
- login_screen($locale->text('Incorrect username or password!'));
-
exit
;
+
::end_of_request()
if $result == -2;
+ login_screen($
::
locale->text('Incorrect username or password!'));
+
::end_of_request()
;
}
my %style_to_script_map = ( 'v3' => 'v3',
}
my %style_to_script_map = ( 'v3' => 'v3',
@@
-151,7
+150,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
+159,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('Lx-Office');
+ $form->{interface} = $::dispatcher->interface_type;
# create the logo screen
$form->header() unless $form->{noheader};
# create the logo screen
$form->header() unless $form->{noheader};
@@
-177,9
+175,8
@@
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();
$form->{stylesheet} = 'css/lx-office-erp.css';
$form->header();
@@
-188,7
+185,7
@@
sub show_error {
# $form->parse_html_template('login/auth_db_unreachable');
# $form->parse_html_template('login/authentication_pl_missing');
# $form->parse_html_template('login/auth_db_unreachable');
# $form->parse_html_template('login/authentication_pl_missing');
-
exit
;
+
::end_of_request()
;
}
1;
}
1;