Revision b2945bf6
Von Sven Schöling vor mehr als 14 Jahren hinzugefügt
SL/Dispatcher.pm | ||
---|---|---|
14 | 14 |
use Rose::DB::Object; |
15 | 15 |
use File::Basename; |
16 | 16 |
|
17 |
# Trailing new line is added so that Perl will not add the line |
|
18 |
# number 'die' was called in. |
|
19 |
use constant END_OF_REQUEST => "END-OF-REQUEST\n"; |
|
20 |
|
|
17 | 21 |
sub pre_request_checks { |
18 | 22 |
show_error('login/auth_db_unreachable') unless $::auth->session_tables_present; |
19 | 23 |
$::auth->expire_sessions; |
... | ... | |
33 | 37 |
print $::form->parse_html_template($template); |
34 | 38 |
$::lxdebug->leave_sub; |
35 | 39 |
|
36 |
exit;
|
|
40 |
::end_of_request();
|
|
37 | 41 |
} |
38 | 42 |
|
39 | 43 |
sub pre_startup_setup { |
... | ... | |
159 | 163 |
|
160 | 164 |
1; |
161 | 165 |
} or do { |
162 |
$::form->{label_error} = $::cgi->pre($EVAL_ERROR); |
|
163 |
show_error('generic/error'); |
|
166 |
if ($EVAL_ERROR ne END_OF_REQUEST) { |
|
167 |
$::form->{label_error} = $::cgi->pre($EVAL_ERROR); |
|
168 |
eval { show_error('generic/error') }; |
|
169 |
} |
|
164 | 170 |
}; |
165 | 171 |
|
166 | 172 |
# cleanup |
... | ... | |
181 | 187 |
} |
182 | 188 |
} |
183 | 189 |
|
190 |
package main; |
|
191 |
|
|
192 |
use strict; |
|
193 |
|
|
194 |
sub end_of_request { |
|
195 |
die SL::Dispatcher->END_OF_REQUEST; |
|
196 |
} |
|
197 |
|
|
184 | 198 |
1; |
Auch abrufbar als: Unified diff
Aufrufe von 'exit' durch eigene Funktion '::end_of_request()' ersetzt.
Außerdem dafür gesorgt, dass Meldungen, die per
$form->show_generic_(error|information) ausgegeben werden, nicht
doppelt angezeigt werden.
Conflicts: