Changeset 1405
- Timestamp:
- 08/31/15 17:57:50 (9 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts-Web/lib/LATMOS/Accounts/Web/Controller/Users.pm
r1403 r1405 44 44 # synchaccess do not manage connect() at time, opening a 45 45 # backdoor then :\ 46 foreach ($sync->bases) { $_->{_user} = $ username }47 48 my $suser = $sync->get_object ('user', $username);46 foreach ($sync->bases) { $_->{_user} = $c->user->username } 47 48 my $suser = $sync->get_object_ifexists('user', $username); 49 49 my $msg = $c->stash->{user}->check_password($password); 50 50 if ($msg ne 'ok') { -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts.pm
r1354 r1405 268 268 ); 269 269 } 270 271 if (!@obases) { 272 la_log(LA_ERR, "Cannot load any bases for syncronised action"); 273 return; 274 } 275 276 la_log(LA_DEBUG, "Load databases: %s", join(', ', map { $_->label } @obases)); 270 277 271 278 LATMOS::Accounts::SynchAccess->new([ @obases ]); -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/SynchAccess.pm
r1023 r1405 17 17 =cut 18 18 19 # TODO WTF is difference with LATMOS::Accounts::SynchAccess::base20 21 19 =head2 get_object ($otype, $uid) 22 20 23 Compatibility function: return a set of object for which action must be done.21 Compatibility function: return a set of objects for which action must be done. 24 22 25 23 =cut … … 31 29 if ($_->is_supported_object($otype)) { 32 30 my $u = $_->get_object($otype, $uid) or do { 33 la_log(LA_ERR, 34 "Cannot get object $otype/$uid in %s/%s", 35 $_->type, 36 $_->label 31 $_->log(LA_ERR, 32 "Cannot get object $otype/$uid", 37 33 ); 38 34 return; 39 35 }; 40 36 push(@subobj, $u); 41 37 } 42 38 } 39 40 return LATMOS::Accounts::SynchAccess::Objects->new( 41 [ @subobj ] 42 ); 43 } 44 45 =head2 get_object_ifexists ($otype, $uid) 46 47 Compatibility function: return a set of objects for which action must be done. 48 49 Instead get_object, if the named object does not exists in a database no error is returned 50 51 =cut 52 53 sub get_object_ifexists { 54 my ($self, $otype, $uid) = @_; 55 my @subobj; 56 foreach ($self->bases) { 57 $_->log(LA_DEBUG, 58 "trying to get object $otype/$uid", 59 ); 60 if ($_->is_supported_object($otype)) { 61 my $u = $_->get_object($otype, $uid) or do { 62 $_->log(LA_WARN, 63 "Cannot get object $otype/$uid", 64 ); 65 next 66 }; 67 push(@subobj, $u); 68 } 69 } 70 71 if (!@subobj) { 72 la_log(LA_ERR, "No object $otype/$uid found in any bases"); 73 return; 74 } 75 43 76 return LATMOS::Accounts::SynchAccess::Objects->new( 44 77 [ @subobj ] -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/SynchAccess/base.pm
r1262 r1405 17 17 This module fake a base object to send same actions tu multiple base. This is 18 18 used for actions basic synchronisation process cannot handle. 19 20 This module contain common functions between Base and Object managment. 19 21 20 22 =head1 FUNCTIONS
Note: See TracChangeset
for help on using the changeset viewer.