source: trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Updatedyndata.pm @ 2376

Last change on this file since 2376 was 2376, checked in by nanardon, 4 years ago

Fix module not call w/o acls

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