X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole.pm;h=582a57b5699b8a59e05a64bed4fa4b2ab66234cb;hb=3ea311267f7346b89d18f043386f6b13221205e0;hp=cb5e50ea04f38211eabfdf5787f4053b24a6767f;hpb=89be850a694b3d8696305a8ab52d31151b008136;p=maypole.git diff --git a/lib/Maypole.pm b/lib/Maypole.pm index cb5e50e..582a57b 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -34,7 +34,7 @@ sub setup { 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'; @@ -222,6 +222,13 @@ sub send_output { 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 @@ -464,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. +=head3 make_random_id + +returns a unique id for this request can be used to prevent or detect repeat submissions. =head3 handler