Apache-Voodoo
view release on metacpan or search on metacpan
value of error. This can be used to provide a hint to the receiving module to describe why
access was denied. The second param can be used to have the access_denied call redirect somewhere else.
(based on modifications made by Mike)
pretty_tiem had the wrong array members being used
Per user theme selection works again.
Logout target can be user configured now.
Prettier handling of the maximum upload size.
2.03 - 2/04/2008
================
Installer now handles standard Perl modules too.
Added variations of the next, previous and more pages in order to make building ajaxed pagination easier.
Added arbitrary join syntax to the table abstraction layer.
Abstracted Template handling out of the Hander.pm
Removed dependency on IPC::Shareable
Fixed a rounding error in the window size code. This bug was only triggered when the window size
was set to an odd number; and event which rarely happens. This has allowed this bug to go
unnoticed for 9 years.
2.01 - 1/19/2007
================
Fixed glitch in upload handling under Apache 2, updated docs.
2.00 - 1/18/2007
================
Added support for Apache 2
1.22 - 12/18/2006
================
Bug fixes.
1.21 - 11/27/2006
lib/Apache/Voodoo/Application/ConfigParser.pm view on Meta::CPAN
my %conf = $conf->getall();
$conf{'id'} = $self->{'id'};
$conf{'base_package'} ||= $self->{'id'};
# PCI says that sessions should expire after 15 minutes, this should be a sane default
$conf{'session_timeout'} = (defined($conf{'session_timeout'}) && $conf{'session_timeout'} =~ /^\d+$/)?$conf{'session_timeout'}:900;
$conf{'upload_size_max'} = (defined($conf{'upload_size_max'}) && $conf{'upload_size_max'} =~ /^\d+$/)?$conf{'upload_size_max'}:5242880;
$conf{'cookie_name'} ||= uc($self->{'id'}). "_SID";
$conf{'https_cookies'} = ($conf{'https_cookies'})?1:0;
$conf{'template_opts'} ||= {};
$conf{'template_dir'} = File::Spec->catfile(
$self->{'constants'}->install_path(),
$self->{'id'},
lib/Apache/Voodoo/Engine.pm view on Meta::CPAN
Apache::Voodoo::Exception::DBIConnect->throw($DBI::errstr);
}
return $db;
}
sub parse_params {
my $self = shift;
my $params = $self->{mp}->parse_params($self->_app->config->{'upload_size_max'});
unless (ref($params)) {
Apache::Voodoo::Exception::ParamParse->throw($params);
}
$debug->mark(Time::HiRes::time,"Parameter parsing");
$debug->params($params);
return $params;
}
sub status {
lib/Apache/Voodoo/MP/V1.pm view on Meta::CPAN
}
else {
$r->header_out("Location" => $loc);
}
}
return Apache::Constants::REDIRECT;
}
sub parse_params {
my $self = shift;
my $upload_max = shift;
my %params;
my $apr = Apache::Request->new($self->{r}, POST_MAX => $upload_max);
foreach ($apr->param) {
my @value = $apr->param($_);
$params{$_} = @value > 1 ? [@value] : $value[0];
}
# make sure our internal special params don't show up in the parameter list.
delete $params{'__voodoo_file_upload__'};
delete $params{'__voodoo_upload_error__'};
if ($apr->parse()) {
$params{'__voodoo_upload_error__'} = $apr->notes('error-notes');
}
else {
my @uploads = $apr->upload;
if (@uploads) {
$params{'__voodoo_file_upload__'} = @uploads > 1 ? [@uploads] : $uploads[0];
}
}
return \%params;
}
sub set_cookie {
my $self = shift;
my $name = shift;
lib/Apache/Voodoo/MP/V2.pm view on Meta::CPAN
}
else {
$r->headers_out->add("Location" => $loc);
}
}
return Apache2::Const::REDIRECT;
}
sub parse_params {
my $self = shift;
my $upload_max = shift;
my $apr = Apache2::Request->new($self->{r}, POST_MAX => $upload_max*5);
my %params;
foreach ($apr->param) {
my @value = $apr->param($_);
$params{$_} = @value > 1 ? [@value] : $value[0];
}
# make sure our internal special params don't show up in the parameter list.
delete $params{'__voodoo_file_upload__'};
delete $params{'__voodoo_upload_error__'};
my @uploads = $apr->upload;
if ($#uploads == 0) {
my $u = $apr->upload($uploads[0]);
if ($u->size() > $upload_max) {
$params{'__voodoo_upload_error__'} = "File size exceeds $upload_max bytes.";
}
else {
$params{'__voodoo_file_upload__'} = $u;
}
}
elsif ($#uploads > 0) {
foreach (@uploads) {
my $u = $apr->upload($_);
if ($u->size() > $upload_max) {
$params{'__voodoo_upload_error__'} = "File size exceeds $upload_max bytes.";
}
else {
push(@{$params{'__voodoo_file_upload__'}},$u);
}
}
}
return \%params;
}
sub set_cookie {
my $self = shift;
lib/Apache/Voodoo/Test.pm view on Meta::CPAN
else {
$self->{'parameters'} = [ @_ ];
}
}
return $self->{'parameters'};
}
sub parse_params {
my $self = shift;
my $upload_max = shift;
if (ref($self->{'parameters'}) eq "HASH") {
return $self->{'parameters'};
}
else {
my $params = {};
my $c=0;
foreach (@{$self->{'parameters'}}) {
if (ref($_) eq "HASH") {
while (my ($k,$v) = each %{$_}) {
t/Application-ConfigParser.t view on Meta::CPAN
['id', 'app_blank'],
['old_ns', 0]
) {
is($cp->{$_->[0]}, $_->[1],"default value for $_->[0] set correctly");
}
foreach (
['id', 'app_blank'],
['base_package', 'app_blank'],
['session_timeout', 900 ],
['upload_size_max', 5*1024*1024],
['cookie_name', 'APP_BLANK_SID'],
['https_cookies', 0,],
['logout_target', '/index'],
['devel_mode', 0],
['dynamic_loading', 0],
['halt_on_errors', 1]
) {
is($cp->{config}->{$_->[0]}, $_->[1],"default value for $_->[0] set correctly");
}
t/Application-ConfigParser.t view on Meta::CPAN
['id', 'app_oldstyle'],
['old_ns', 1]
) {
is($cp->{$_->[0]}, $_->[1],"$_->[0] set correctly");
}
foreach (
['id', 'app_oldstyle'],
['base_package', 'app_newstyle'],
['session_timeout', 0 ],
['upload_size_max', 10],
['cookie_name', 'bar_sid'],
['https_cookies', 1,],
['logout_target', '/logout/target'],
['devel_mode', 0],
['dynamic_loading', 1],
['halt_on_errors', 0]
) {
is($cp->{config}->{$_->[0]}, $_->[1],"$_->[0] set correctly");
}
t/app_oldstyle/etc/voodoo.conf view on Meta::CPAN
base_package = app_newstyle
session_dir = /data/apache/session/test
cookie_name = bar_sid
https_cookies = 1
logout_target = /logout/target
session_timeout = 0
upload_size_max = 10
dynamic_loading = 1
halt_on_errors = 0
<database>
connect = "dbi:mysql:database=test;host=localhost"
username = "root"
password = "root_password"
</database>
<modules>
( run in 1.419 second using v1.01-cache-2.11-cpan-b16cb0d3907 )