source: branches/4.0/LATMOS-Accounts/bin/la-find-expired @ 1284

Last change on this file since 1284 was 861, checked in by nanardon, 13 years ago
  • reimport missing files from previous svn
  • Property svn:executable set to *
File size: 1021 bytes
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-warn-expire - query expiration of user and send mail
15
16=head1 SYNOPSIS
17
18    la-warn-expire [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 -c|--config configdir
34
35Use this configuration directory instead of the default one.
36
37=back
38
39=cut
40
41my $LA = LATMOS::Accounts::Maintenance->new($config);
42
43foreach ($LA->find_expired_users($delay)) {
44    my $obj = $LA->_base->get_object('user', $_);
45    printf("%s - %s (%s%s)\n", $obj->id, $obj->get_attributes('displayName'),
46        $obj->get_attributes('expireText'),
47        ($obj->get_attributes('managerContact') ? ' ' .
48            $obj->get_attributes('managerContact') : ''),
49    );
50}
Note: See TracBrowser for help on using the repository browser.