Revision 540c0b5e
Von Moritz Bunkus vor etwa 12 Jahren hinzugefügt
SL/Controller/Base.pm | ||
---|---|---|
21 | 21 |
|
22 | 22 |
my %params = ref($_[0]) eq 'HASH' ? %{ $_[0] } : @_; |
23 | 23 |
my $controller = delete($params{controller}) || $self->_controller_name; |
24 |
my $action = delete($params{action}) || 'dispatch'; |
|
25 |
$params{action} = "${controller}/${action}"; |
|
24 |
my $action = $params{action} || 'dispatch'; |
|
25 |
|
|
26 |
my $script; |
|
27 |
if ($controller =~ m/\.pl$/) { |
|
28 |
# Old-style controller |
|
29 |
$script = $controller; |
|
30 |
} else { |
|
31 |
$params{action} = "${controller}/${action}"; |
|
32 |
$script = "controller.pl"; |
|
33 |
} |
|
34 |
|
|
26 | 35 |
my $query = join '&', map { uri_encode($_->[0]) . '=' . uri_encode($_->[1]) } @{ flatten(\%params) }; |
27 | 36 |
|
28 |
return "controller.pl?${query}";
|
|
37 |
return "${script}?${query}";
|
|
29 | 38 |
} |
30 | 39 |
|
31 | 40 |
sub redirect_to { |
... | ... | |
172 | 181 |
return 'user'; |
173 | 182 |
} |
174 | 183 |
|
184 |
sub keep_auth_vars_in_form { |
|
185 |
return 0; |
|
186 |
} |
|
187 |
|
|
175 | 188 |
# |
176 | 189 |
# private functions -- for use in Base only |
177 | 190 |
# |
... | ... | |
517 | 530 |
future value C<none> (which would require no authentication but is not |
518 | 531 |
yet implemented). |
519 | 532 |
|
533 |
=item C<keep_auth_vars_in_form> |
|
534 |
|
|
535 |
May be overridden by a controller. If falsish (the default) all form |
|
536 |
variables whose name starts with C<{AUTH}> are removed before the |
|
537 |
request is routed. Only controllers that handle login requests |
|
538 |
themselves should return trueish for this function. |
|
539 |
|
|
520 | 540 |
=back |
521 | 541 |
|
522 | 542 |
=head2 PRIVATE FUNCTIONS |
Auch abrufbar als: Unified diff
User-Login auf Controller umgestellt