source: trunk/LATMOS-Accounts/bin/la-sql-find-expired @ 2043

Last change on this file since 2043 was 1871, checked in by nanardon, 7 years ago

Update doc

  • Property svn:executable set to *
File size: 1.0 KB
Line 
1#!/usr/bin/perl
2
3# $Id: la-find-expired 2795 2010-07-31 10:04:13Z nanardon $
4
5use strict;
6use warnings;
7use LATMOS::Accounts::Maintenance;
8use LATMOS::Accounts::Log;
9use Getopt::Long;
10use Pod::Usage;
11
12=head1 NAME
13
14    la-sql-find-expired - Find expired user
15
16=head1 SYNOPSIS
17
18    la-sql-find-expired [options]
19
20=cut
21
22GetOptions(
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
33=item old DELAY
34
35The minimum delay user has been expired
36
37=item -c|--config configdir
38
39Use this configuration directory instead of the default one.
40
41=back
42
43=cut
44
45my $LA = LATMOS::Accounts::Maintenance->new($config);
46
47foreach ($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'),
51        ($obj->get_attributes('manager') ? ' ' .
52            $obj->get_attributes('manager') : ''),
53    );
54}
Note: See TracBrowser for help on using the repository browser.