Last change
on this file since 59 was
59,
checked in by nanardon, 15 years ago
|
- support Group/memberUID, eg user in a group
|
-
Property svn:keywords set to
Id Rev
|
File size:
788 bytes
|
Line | |
---|
1 | #!/usr/bin/perl |
---|
2 | |
---|
3 | use strict; |
---|
4 | use warnings; |
---|
5 | use LATMOS::Accounts; |
---|
6 | use Getopt::Long; |
---|
7 | use Pod::Usage; |
---|
8 | |
---|
9 | GetOptions( |
---|
10 | 'c|config=s' => \my $config, |
---|
11 | 'd|base=s' => \my $base, |
---|
12 | 'o|object=s' => \my $otype, |
---|
13 | 'help' => sub { pod2usage(0) }, |
---|
14 | ) or pod2usage(); |
---|
15 | |
---|
16 | $otype ||= 'user'; |
---|
17 | |
---|
18 | my $LA = LATMOS::Accounts->new($config); |
---|
19 | my $labase = $base ? $LA->base($base) : $LA->default_base; |
---|
20 | |
---|
21 | if (my $ouid = shift(@ARGV)) { |
---|
22 | my $obj = $labase->get_object($otype, $ouid); |
---|
23 | foreach ($labase->list_canonicals_fields($otype)) { |
---|
24 | my $val = $obj->get_c_field($_); |
---|
25 | printf( |
---|
26 | " %s: %s\n", |
---|
27 | $_, |
---|
28 | ref $val ? join(', ', @$val) : ($val || 'N/A') |
---|
29 | ); |
---|
30 | } |
---|
31 | } else { |
---|
32 | foreach ($labase->list_objects($otype)) { |
---|
33 | print "$_\n"; |
---|
34 | } |
---|
35 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.