source: LATMOS-Accounts/bin/la-passwd @ 189

Last change on this file since 189 was 189, checked in by nanardon, 15 years ago
  • add set_password() to AD
  • Property svn:executable set to *
File size: 546 bytes
Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5use LATMOS::Accounts;
6use Getopt::Long;
7use Pod::Usage;
8
9GetOptions(
10    'c|config=s' => \my $config,
11    'b|base=s'   => \my $base,
12    'help'       => sub { pod2usage(0) },
13) or pod2usage();
14
15my $otype = 'user';
16
17my $LA = LATMOS::Accounts->new($config);
18my $labase = $base ? $LA->base($base) : $LA->default_base;
19$labase && $labase->load or die "Cannot load base";
20
21my $obj = $labase->get_object($otype, $ARGV[0]) or do {
22    die "Object $otype $ARGV[0] not found\n";
23};
24$obj->set_password($ARGV[1]);
Note: See TracBrowser for help on using the repository browser.