[Catalyst-commits] r6974 - trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Plugin/Authentication

jayk at dev.catalyst.perl.org jayk at dev.catalyst.perl.org
Tue Oct 9 20:48:13 GMT 2007


Author: jayk
Date: 2007-10-09 20:48:12 +0100 (Tue, 09 Oct 2007)
New Revision: 6974

Modified:
   trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Plugin/Authentication/Realm.pm
Log:
Added auto_update feature - for updating user information on checkin - 
and checking that the store can auto_create and auto_update when requested


Modified: trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Plugin/Authentication/Realm.pm
===================================================================
--- trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Plugin/Authentication/Realm.pm	2007-10-08 19:10:40 UTC (rev 6973)
+++ trunk/Catalyst-Plugin-Authentication/lib/Catalyst/Plugin/Authentication/Realm.pm	2007-10-09 19:48:12 UTC (rev 6974)
@@ -88,9 +88,13 @@
 
     my $res = $self->store->find_user($authinfo, $c);
     
-    if (!$res && $self->config->{'auto_create'} ) {
-        $res = $self->store->auto_create($authinfo, $c);
-    }
+    if (!$res) {
+      if ($self->config->{'auto_create'} && $self->store->can('auto_create') ) {
+          $res = $self->store->auto_create($authinfo, $c);
+      }
+    } elsif ($self->config->{'auto_update'} && $self->store->can('auto_update')) {
+        $res = $self->store->auto_update($authinfo, $c);
+    } 
     
     return $res;
 }




More information about the Catalyst-commits mailing list