[Catalyst-commits] r9426 - in trunk/Catalyst-Plugin-Authentication: . lib/Catalyst/Authentication lib/Catalyst/Plugin

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Wed Mar 4 12:53:26 GMT 2009


Author: t0m
Date: 2009-03-04 12:53:25 +0000 (Wed, 04 Mar 2009)
New Revision: 9426

Modified:
   trunk/Catalyst-Plugin-Authentication/Changes
   trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Authentication/Realm.pm
   trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Plugin/Authentication.pm
Log:
Check for session method, not ISA C::P::Session for auth collaberation. evdb++

Modified: trunk/Catalyst-Plugin-Authentication/Changes
===================================================================
--- trunk/Catalyst-Plugin-Authentication/Changes	2009-03-04 12:52:32 UTC (rev 9425)
+++ trunk/Catalyst-Plugin-Authentication/Changes	2009-03-04 12:53:25 UTC (rev 9426)
@@ -3,6 +3,8 @@
 0.10011 *UNRELEASED*
       - Update t/live_app_session.t to skip unless you have a newer, more
         reliable version of TWMC (RT#43817)
+      - Change check for isa Catalyst::Plugin::Session to just check the
+        existance of a session method. (Edmund von der Burg)
 
 0.10010
       - Change from NEXT to MRO::Compat

Modified: trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Authentication/Realm.pm
===================================================================
--- trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Authentication/Realm.pm	2009-03-04 12:52:32 UTC (rev 9425)
+++ trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Authentication/Realm.pm	2009-03-04 12:53:25 UTC (rev 9426)
@@ -171,7 +171,7 @@
     my ($self, $c) = @_;
     
     return unless
-         $c->isa("Catalyst::Plugin::Session")
+         $c->can('session')
          and $self->config->{'use_session'}
          and $c->session_is_valid;
 
@@ -214,7 +214,7 @@
     my ($self, $c, $user) = @_;
     
     if (
-        $c->isa("Catalyst::Plugin::Session")
+        $c->can('session')
         and $self->config->{'use_session'}
         and $user->supports("session") 
     ) {
@@ -236,7 +236,7 @@
     my ($self, $c) = @_;
     
     if (
-        $c->isa("Catalyst::Plugin::Session")
+        $c->can('session')
         and $self->config->{'use_session'}
         and $c->session_is_valid
     ) {

Modified: trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Plugin/Authentication.pm
===================================================================
--- trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Plugin/Authentication.pm	2009-03-04 12:52:32 UTC (rev 9425)
+++ trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Plugin/Authentication.pm	2009-03-04 12:53:25 UTC (rev 9426)
@@ -98,7 +98,7 @@
         ## if we have a valid session handler - we store the 
         ## realm in the session.  If not - we have to hope that 
         ## the realm can recognize its frozen user somehow.
-        if ($c->isa("Catalyst::Plugin::Session") && 
+        if ($c->can('session') && 
             $c->config->{'Plugin::Authentication'}{'use_session'} && 
             $c->session_is_valid) {
         
@@ -153,7 +153,7 @@
     my $c = shift;
     
     my $realm;
-    if ($c->isa("Catalyst::Plugin::Session")
+    if ($c->can('session')
         and $c->config->{'Plugin::Authentication'}{'use_session'}
         and $c->session_is_valid 
         and exists($c->session->{'__user_realm'})) {




More information about the Catalyst-commits mailing list