From: Jay Kuri Date: Tue, 9 Oct 2007 19:48:12 +0000 (+0000) Subject: Added auto_update feature - for updating user information on checkin - X-Git-Tag: v0.10009_01~47 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4bd1f581b076de8897d82a38b74f7d1e40f420af;p=catagits%2FCatalyst-Plugin-Authentication.git Added auto_update feature - for updating user information on checkin - and checking that the store can auto_create and auto_update when requested --- diff --git a/lib/Catalyst/Plugin/Authentication/Realm.pm b/lib/Catalyst/Plugin/Authentication/Realm.pm index b6ed636..d9ec742 100644 --- a/lib/Catalyst/Plugin/Authentication/Realm.pm +++ b/lib/Catalyst/Plugin/Authentication/Realm.pm @@ -88,9 +88,13 @@ sub find_user { 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; }