Last change
on this file since 1888 was
1871,
checked in by nanardon, 8 years ago
|
Update doc
|
-
Property svn:executable set to
*
|
File size:
1.0 KB
|
Rev | Line | |
---|
[861] | 1 | #!/usr/bin/perl |
---|
| 2 | |
---|
| 3 | # $Id: la-find-expired 2795 2010-07-31 10:04:13Z nanardon $ |
---|
| 4 | |
---|
| 5 | use strict; |
---|
| 6 | use warnings; |
---|
| 7 | use LATMOS::Accounts::Maintenance; |
---|
| 8 | use LATMOS::Accounts::Log; |
---|
| 9 | use Getopt::Long; |
---|
| 10 | use Pod::Usage; |
---|
| 11 | |
---|
| 12 | =head1 NAME |
---|
| 13 | |
---|
[1871] | 14 | la-sql-find-expired - Find expired user |
---|
[861] | 15 | |
---|
| 16 | =head1 SYNOPSIS |
---|
| 17 | |
---|
[1871] | 18 | la-sql-find-expired [options] |
---|
[861] | 19 | |
---|
| 20 | =cut |
---|
| 21 | |
---|
| 22 | GetOptions( |
---|
| 23 | 'c|config=s' => \my $config, |
---|
| 24 | 'help' => sub { pod2usage(0) }, |
---|
| 25 | 'old=s' => \my $delay, |
---|
| 26 | 'test' => \my $test, |
---|
| 27 | ) or pod2usage(); |
---|
| 28 | |
---|
| 29 | =head1 OPTIONS |
---|
| 30 | |
---|
| 31 | =over 4 |
---|
| 32 | |
---|
[1871] | 33 | =item old DELAY |
---|
| 34 | |
---|
| 35 | The minimum delay user has been expired |
---|
| 36 | |
---|
[861] | 37 | =item -c|--config configdir |
---|
| 38 | |
---|
| 39 | Use this configuration directory instead of the default one. |
---|
| 40 | |
---|
| 41 | =back |
---|
| 42 | |
---|
| 43 | =cut |
---|
| 44 | |
---|
| 45 | my $LA = LATMOS::Accounts::Maintenance->new($config); |
---|
| 46 | |
---|
| 47 | foreach ($LA->find_expired_users($delay)) { |
---|
| 48 | my $obj = $LA->_base->get_object('user', $_); |
---|
| 49 | printf("%s - %s (%s%s)\n", $obj->id, $obj->get_attributes('displayName'), |
---|
| 50 | $obj->get_attributes('expireText'), |
---|
[1365] | 51 | ($obj->get_attributes('manager') ? ' ' . |
---|
| 52 | $obj->get_attributes('manager') : ''), |
---|
[861] | 53 | ); |
---|
| 54 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.