Revision dc50b737
Von Sven Schöling vor mehr als 14 Jahren hinzugefügt
bin/mozilla/admin.pl | ||
---|---|---|
57 | 57 |
|
58 | 58 |
use strict; |
59 | 59 |
|
60 |
our $cgi = new CGI(''); |
|
61 |
our $form = new Form; |
|
62 |
our $locale = new Locale $main::language, "admin"; |
|
63 |
our $auth = SL::Auth->new(); |
|
64 |
|
|
65 |
if ($auth->session_tables_present()) { |
|
66 |
$auth->expire_sessions(); |
|
67 |
$auth->restore_session(); |
|
68 |
$auth->set_session_value('rpw', $form->{rpw}); |
|
69 |
} |
|
70 |
|
|
71 |
# customization |
|
72 |
if (-f "bin/mozilla/custom_$form->{script}") { |
|
73 |
eval { require "bin/mozilla/custom_$form->{script}"; }; |
|
74 |
$form->error($@) if ($@); |
|
75 |
} |
|
60 |
our $cgi; |
|
61 |
our $form; |
|
62 |
our $locale; |
|
63 |
our $auth; |
|
76 | 64 |
|
77 |
$form->{stylesheet} = "lx-office-erp.css"; |
|
78 |
$form->{favicon} = "favicon.ico"; |
|
65 |
sub run { |
|
66 |
$::lxdebug->enter_sub; |
|
67 |
my $session_result = shift; |
|
79 | 68 |
|
80 |
if ($form->{action}) { |
|
81 |
if ($auth->authenticate_root($form->{rpw}, 0) != $auth->OK()) { |
|
82 |
$form->{error_message} = $locale->text('Incorrect Password!'); |
|
83 |
adminlogin(); |
|
84 |
exit; |
|
85 |
} |
|
69 |
$cgi = $::cgi; |
|
70 |
$form = $::form; |
|
71 |
$locale = $::locale; |
|
72 |
$auth = $::auth; |
|
86 | 73 |
|
87 |
$auth->create_or_refresh_session() if ($auth->session_tables_present());
|
|
74 |
$::auth->set_session_value('rpw', $::form->{rpw}) if $session_result == SL::Auth->SESSION_OK;
|
|
88 | 75 |
|
89 |
call_sub($locale->findsub($form->{action})); |
|
90 |
|
|
91 |
} elsif ($auth->authenticate_root($form->{rpw}, 0) == $auth->OK()) { |
|
92 |
|
|
93 |
$auth->create_or_refresh_session() if ($auth->session_tables_present()); |
|
76 |
$form->{stylesheet} = "lx-office-erp.css"; |
|
77 |
$form->{favicon} = "favicon.ico"; |
|
94 | 78 |
|
95 |
login(); |
|
79 |
if ($form->{action}) { |
|
80 |
if ($auth->authenticate_root($form->{rpw}, 0) != $auth->OK()) { |
|
81 |
$form->{error_message} = $locale->text('Incorrect Password!'); |
|
82 |
adminlogin(); |
|
83 |
} else { |
|
84 |
$auth->create_or_refresh_session() if ($auth->session_tables_present()); |
|
85 |
call_sub($locale->findsub($form->{action})); |
|
86 |
} |
|
87 |
} elsif ($auth->authenticate_root($form->{rpw}, 0) == $auth->OK()) { |
|
96 | 88 |
|
97 |
} else { |
|
98 |
# if there are no drivers bail out |
|
99 |
$form->error($locale->text('No Database Drivers available!')) |
|
100 |
unless (User->dbdrivers); |
|
89 |
$auth->create_or_refresh_session() if ($auth->session_tables_present()); |
|
101 | 90 |
|
102 |
adminlogin(); |
|
91 |
login(); |
|
92 |
} else { |
|
93 |
# if there are no drivers bail out |
|
94 |
$form->error($locale->text('No Database Drivers available!')) |
|
95 |
unless (User->dbdrivers); |
|
103 | 96 |
|
97 |
adminlogin(); |
|
98 |
} |
|
99 |
$::lxdebug->leave_sub; |
|
104 | 100 |
} |
105 | 101 |
|
106 |
1; |
|
107 |
|
|
108 |
# end |
|
109 |
|
|
110 | 102 |
sub adminlogin { |
111 | 103 |
my $form = $main::form; |
112 | 104 |
my $locale = $main::locale; |
Auch abrufbar als: Unified diff
fcgi patch test
Conflicts: