use Carp;
use IO::File;
use List::Util qw(first);
+use SL::Request qw(flatten);
+use SL::MoreCommon qw(uri_encode);
#
# public/helper functions
my $controller = delete($params{controller}) || $self->_controller_name;
my $action = delete($params{action}) || 'dispatch';
$params{action} = "${controller}/${action}";
- my $query = join('&', map { $::form->escape($_) . '=' . $::form->escape($params{$_}) } keys %params);
+ my $query = join '&', map { uri_encode($_->[0]) . '=' . uri_encode($_->[1]) } @{ flatten(\%params) };
return "controller.pl?${query}";
}
0;
}
+sub get_auth_level {
+ # Ignore the 'action' parameter.
+ return 'user';
+}
+
#
# private functions -- for use in Base only
#
will delay all flash messages for the current request. Defaults to false for
compatibility reasons.
+=item C<get_auth_level $action>
+
+May be overridden by a controller. Determines what kind of
+authentication is required for a particular action. Must return either
+C<admin> (which means that authentication as an admin is required),
+C<user> (authentication as a normal user suffices) with a possible
+future value C<none> (which would require no authentication but is not
+yet implemented).
+
=back
=head2 PRIVATE FUNCTIONS