[Catalyst-commits] r7077 -
trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Plugin
bricas at dev.catalyst.perl.org
bricas at dev.catalyst.perl.org
Tue Oct 30 00:47:50 GMT 2007
Author: bricas
Date: 2007-10-30 00:47:50 +0000 (Tue, 30 Oct 2007)
New Revision: 7077
Modified:
trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Plugin/Authentication.pm
Log:
make realm class spec work like other class specs (append or + for full name)
Modified: trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Plugin/Authentication.pm
===================================================================
--- trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Plugin/Authentication.pm 2007-10-29 22:00:00 UTC (rev 7076)
+++ trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Plugin/Authentication.pm 2007-10-30 00:47:50 UTC (rev 7077)
@@ -218,11 +218,18 @@
sub setup_auth_realm {
my ($app, $realmname, $config) = @_;
- my $realmclass = 'Catalyst::Plugin::Authentication::Realm';
- if (defined($config->{'class'})) {
- $realmclass = $config->{'class'};
- Catalyst::Utils::ensure_class_loaded( $realmclass );
+ my $realmclass = $config->{class};
+
+ if( !$realmclass ) {
+ $realmclass = 'Catalyst::Plugin::Authentication::Realm';
+ } elsif ($realmclass !~ /^\+(.*)$/ ) {
+ $realmclass = "Catalyst::Plugin::Authentication::Realm::${realmclass}";
+ } else {
+ $realmclass = $1;
}
+
+ Catalyst::Utils::ensure_class_loaded( $realmclass );
+
my $realm = $realmclass->new($realmname, $config, $app);
if ($realm) {
$app->auth_realms->{$realmname} = $realm;
@@ -307,7 +314,7 @@
my $realm = $self->get_auth_realm('default');
if (!$realm) {
- $realm = $self->setup_auth_realm('default', { class => "Catalyst::Plugin::Authentication::Realm::Compatibility" });
+ $realm = $self->setup_auth_realm('default', { class => 'Compatibility' });
}
if ( my $new = shift ) {
$realm->store($new);
More information about the Catalyst-commits
mailing list