[1737] | 1 | package LATMOS::Accounts::Task::Updatedyndata; |
---|
[861] | 2 | |
---|
| 3 | use strict; |
---|
| 4 | use warnings; |
---|
| 5 | use base qw(LATMOS::Accounts::Task); |
---|
| 6 | use LATMOS::Accounts; |
---|
| 7 | use LATMOS::Accounts::Log; |
---|
| 8 | use LATMOS::Accounts::Utils; |
---|
| 9 | |
---|
[1023] | 10 | =head1 NAME |
---|
| 11 | |
---|
| 12 | LATMOS::Accounts::Task::Refreshexpired - Task to disable expired users |
---|
| 13 | |
---|
| 14 | =head1 DESCRIPTION |
---|
| 15 | |
---|
| 16 | Some base doesn't handle accounts expiration. One way to do it is to synchronize |
---|
| 17 | user with value denying login (wrong UNIX shell, password entry set to false, |
---|
| 18 | ...). |
---|
| 19 | |
---|
| 20 | For performance issue, objects are not written at each synchronisation, only |
---|
| 21 | when they changes. |
---|
| 22 | |
---|
| 23 | This module find expired user and refresh modification time to ensure |
---|
| 24 | propagation to other database. |
---|
| 25 | |
---|
| 26 | =cut |
---|
| 27 | |
---|
[2220] | 28 | # Every 5 minutes |
---|
[2189] | 29 | sub runDelay { 5 * 60 } |
---|
[1737] | 30 | |
---|
[861] | 31 | sub init { |
---|
| 32 | my ($self) = @_; |
---|
| 33 | my $LA = LATMOS::Accounts->new($self->{config}); |
---|
[1085] | 34 | my $labase = $self->{base} ? $LA->base($self->{base}) : $LA->base; |
---|
[861] | 35 | $labase && $labase->load or die "Cannot load base"; |
---|
| 36 | |
---|
| 37 | $self->{_la} = $LA; |
---|
| 38 | $self->{_base} = $labase; |
---|
| 39 | |
---|
| 40 | 1; |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | sub run { |
---|
| 44 | my ($self) = @_; |
---|
| 45 | |
---|
[1737] | 46 | $self->{_base}->PopulateDynData; |
---|
[861] | 47 | |
---|
| 48 | 1; |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | 1; |
---|
[1023] | 52 | |
---|
| 53 | __END__ |
---|
| 54 | |
---|
| 55 | =head1 SEE ALSO |
---|
| 56 | |
---|
| 57 | L<LATMOS::Accounts>, L<LATMOS::Accounts::Task> |
---|
| 58 | |
---|
| 59 | =head1 AUTHOR |
---|
| 60 | |
---|
| 61 | Olivier Thauvin, E<lt>olivier.thauvin@latmos.ipsl.frE<gt> |
---|
| 62 | |
---|
| 63 | =head1 COPYRIGHT AND LICENSE |
---|
| 64 | |
---|
| 65 | Copyright (C) 2012 CNRS SA/CETP/LATMOS |
---|
| 66 | |
---|
| 67 | This library is free software; you can redistribute it and/or modify |
---|
| 68 | it under the same terms as Perl itself, either Perl version 5.10.0 or, |
---|
| 69 | at your option, any later version of Perl 5 you may have available. |
---|
| 70 | |
---|
| 71 | =cut |
---|
| 72 | |
---|