]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole.pm
2.10_pre3 release
[maypole.git] / lib / Maypole.pm
index e89cef0af6ce89865530e566592e3e010127bdf1..30384eb6ce2b6b0b6b3ca8b8a215e26332b4cb74 100644 (file)
@@ -7,7 +7,7 @@ use Maypole::Config;
 use Maypole::Constants;
 use Maypole::Headers;
 
 use Maypole::Constants;
 use Maypole::Headers;
 
-our $VERSION = '2.05';
+our $VERSION = '2.10_pre3';
 
 __PACKAGE__->mk_classdata($_) for qw( config init_done view_object );
 __PACKAGE__->mk_accessors(
 
 __PACKAGE__->mk_classdata($_) for qw( config init_done view_object );
 __PACKAGE__->mk_accessors(
@@ -34,7 +34,7 @@ sub setup {
     my $config = $calling_class->config;
     $config->model || $config->model("Maypole::Model::CDBI");
     $config->model->require;
     my $config = $calling_class->config;
     $config->model || $config->model("Maypole::Model::CDBI");
     $config->model->require;
-    die "Couldn't load the model class $config->model: $@" if $@;
+    die "Couldn't load the model class $config->{model}: $@" if $@;
     $config->model->setup_database( $config, $calling_class, @_ );
     for my $subclass ( @{ $config->classes } ) {
         no strict 'refs';
     $config->model->setup_database( $config, $calling_class, @_ );
     for my $subclass ( @{ $config->classes } ) {
         no strict 'refs';
@@ -186,8 +186,7 @@ sub exception { return ERROR }
 sub parse_path {
     my $self = shift;
     $self->{path} ||= "frontpage";
 sub parse_path {
     my $self = shift;
     $self->{path} ||= "frontpage";
-    my @pi = split /\//, $self->{path};
-    shift @pi while @pi and !$pi[0];
+    my @pi = $self->{path} =~ m{([^/]+)/?}g;
     $self->{table}  = shift @pi;
     $self->{action} = shift @pi;
     $self->{action} ||= "index";
     $self->{table}  = shift @pi;
     $self->{action} = shift @pi;
     $self->{action} ||= "index";
@@ -223,6 +222,13 @@ sub send_output {
     die "Do not use Maypole directly; use Apache::MVC or similar";
 }
 
     die "Do not use Maypole directly; use Apache::MVC or similar";
 }
 
+# Session and Repeat Submission Handling
+
+sub make_random_id {
+    use Maypole::Session;
+    return Maypole::Session::generate_unique_id();
+}
+
 =head1 NAME
 
 Maypole - MVC web application framework
 =head1 NAME
 
 Maypole - MVC web application framework
@@ -236,7 +242,7 @@ See L<Maypole::Application>.
 This documents the Maypole request object. See the L<Maypole::Manual>, for a
 detailed guide to using Maypole.
 
 This documents the Maypole request object. See the L<Maypole::Manual>, for a
 detailed guide to using Maypole.
 
-Maypole is a Perl web application framework to Java's struts. It is 
+Maypole is a Perl web application framework similar to Java's struts. It is 
 essentially completely abstracted, and so doesn't know anything about
 how to talk to the outside world.
 
 essentially completely abstracted, and so doesn't know anything about
 how to talk to the outside world.
 
@@ -465,6 +471,9 @@ This method first checks if the relevant model class
 can handle exceptions the user, or falls back to the default
 exception method of your Maypole application.
 
 can handle exceptions the user, or falls back to the default
 exception method of your Maypole application.
 
+=head3 make_random_id
+
+returns a unique id for this request can be used to prevent or detect repeat submissions.
 
 =head3 handler
 
 
 =head3 handler
 
@@ -492,11 +501,13 @@ Maypole is currently maintained by Simon Flack C<simonflk#cpan.org>
 
 Simon Cozens, C<simon#cpan.org>
 
 
 Simon Cozens, C<simon#cpan.org>
 
+Sebastian Riedel, C<sri#oook.de> maintained Maypole from 1.99_01 to 2.04
+
 =head1 THANKS TO
 
 =head1 THANKS TO
 
-Danijel Milicevic, Dave Slack, Jesse Sheidlower, Jody Belka, Marcus Ramberg,
-Mickael Joanne, Randal Schwartz, Simon Flack, Steve Simms, Veljko Vidovic
-and all the others who've helped.
+Sebastian Riedel, Danijel Milicevic, Dave Slack, Jesse Sheidlower, Jody Belka,
+Marcus Ramberg, Mickael Joanne, Randal Schwartz, Simon Flack, Steve Simms,
+Veljko Vidovic and all the others who've helped.
 
 =head1 LICENSE
 
 
 =head1 LICENSE