New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
fcm-manage-users in vendors/fcm/current/examples/sbin – NEMO

source: vendors/fcm/current/examples/sbin/fcm-manage-users @ 1980

Last change on this file since 1980 was 1980, checked in by flavoni, 14 years ago

importing fcm vendor

File size: 2.5 KB
Line 
1#!/usr/bin/perl
2# ------------------------------------------------------------------------------
3# (C) Crown copyright Met Office. All rights reserved.
4# For further details please refer to the file COPYRIGHT.txt
5# which you should have received as part of this distribution.
6# ------------------------------------------------------------------------------
7
8use strict;
9use warnings;
10
11use FindBin;
12use lib "$FindBin::Bin/../lib";
13use FCM::Admin::System qw{
14    get_projects_from_trac_live
15    get_users
16    manage_users_in_svn_passwd
17    manage_users_in_trac_passwd
18    manage_users_in_trac_db_of
19};
20use FCM::Admin::Util qw{option2config};
21use Getopt::Long qw{GetOptions};
22use Pod::Usage qw{pod2usage};
23
24main();
25
26sub main {
27    my %option;
28    my $result = GetOptions(
29        \%option,
30        q{help|usage|h},
31        q{svn-live-dir=s},
32        q{svn-passwd-file=s},
33        q{trac-live-dir=s},
34        q{trac-passwd-file=s},
35    );
36    if (!$result) {
37        pod2usage(1);
38    }
39    if (exists($option{help})) {
40        pod2usage(q{-verbose} => 1);
41    }
42    if (@ARGV) {
43        my $message = sprintf("No argument expected, %d given", scalar(@ARGV));
44        pod2usage({q{-exitval} => 1, q{-message} => $message});
45    }
46    option2config(\%option);
47    my $user_ref = get_users();
48    manage_users_in_svn_passwd($user_ref);
49    manage_users_in_trac_passwd($user_ref);
50    my @projects = get_projects_from_trac_live();
51    for my $project (@projects) {
52        manage_users_in_trac_db_of($project, $user_ref),
53    }
54}
55
56__END__
57
58=head1 NAME
59
60fcm-manage-users
61
62=head1 SYNOPSIS
63
64    fcm-manage-users [OPTIONS]
65
66=head1 OPTIONS
67
68=over 4
69
70=item --help, -h, --usage
71
72Prints help and exits.
73
74=item --svn-live-dir=DIR
75
76Specifies the root location of the live directory of the Subversion
77repositories. See L<FCM::Admin::Config|FCM::Admin::Config> for the current
78default.
79
80=item --svn-passwd-file=FILE
81
82Specifies the base name of the Subversion password file. See
83L<FCM::Admin::Config|FCM::Admin::Config> for the current default.
84
85=item --trac-live-dir=DIR
86
87Specifies the root location of the live directory of the Trac environments. See
88L<FCM::Admin::Config|FCM::Admin::Config> for the current default.
89
90=item --trac-passwd-file=FILE
91
92Specifies the base name of the Trac password file. See
93L<FCM::Admin::Config|FCM::Admin::Config> for the current default.
94
95=back
96
97=head1 DESCRIPTION
98
99This program manages user (login) information for Subversion repositories and
100Trac environments hosted by FCM.
101
102=head1 COPYRIGHT
103
104E<169> Crown copyright Met Office. All rights reserved.
105
106=cut
Note: See TracBrowser for help on using the repository browser.