From e82766d6aab88a10e75b4669f44d2dbe7ff9d766 Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Thu, 19 Feb 2004 15:42:05 +0000 Subject: [PATCH] Allow authentication to set template and action. git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@68 48953598-375a-da11-a14b-00016c27c3ee --- lib/Maypole/Model/Base.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Maypole/Model/Base.pm b/lib/Maypole/Model/Base.pm index 9d673c6..d092e50 100644 --- a/lib/Maypole/Model/Base.pm +++ b/lib/Maypole/Model/Base.pm @@ -8,9 +8,13 @@ sub edit :Exported { } sub process { my ($class, $r) = @_; - $r->template( my $method = $r->action ); + my $method = $r->action; + $r->{template} ||= $method; # Authentication may have done this for us $r->objects([ $class->retrieve(shift @{$r->{args}}) ]); - $class->$method($r); + + # This allows the authentication mechanism to set the template + # without needing to define an action. + $class->$method($r) if $class->can($method); } sub display_columns { -- 2.39.5