[5095] | 1 | #!/usr/bin/perl |
---|
| 2 | # ------------------------------------------------------------------------------ |
---|
| 3 | # Copyright (C) 2006-2021 British Crown (Met Office) & Contributors. |
---|
| 4 | # |
---|
| 5 | # This file is part of FCM, tools for managing and building source code. |
---|
| 6 | # |
---|
| 7 | # FCM is free software: you can redistribute it and/or modify |
---|
| 8 | # it under the terms of the GNU General Public License as published by |
---|
| 9 | # the Free Software Foundation, either version 3 of the License, or |
---|
| 10 | # (at your option) any later version. |
---|
| 11 | # |
---|
| 12 | # FCM is distributed in the hope that it will be useful, |
---|
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 15 | # GNU General Public License for more details. |
---|
| 16 | # |
---|
| 17 | # You should have received a copy of the GNU General Public License |
---|
| 18 | # along with FCM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 19 | # ------------------------------------------------------------------------------ |
---|
| 20 | |
---|
| 21 | use strict; |
---|
| 22 | use warnings; |
---|
| 23 | |
---|
| 24 | use FindBin; |
---|
| 25 | use lib "$FindBin::Bin/../lib"; |
---|
| 26 | use FCM::Admin::System qw{ |
---|
| 27 | filter_projects |
---|
| 28 | get_projects_from_trac_live |
---|
| 29 | get_users |
---|
| 30 | manage_users_in_trac_db_of |
---|
| 31 | }; |
---|
| 32 | use FCM::Admin::Util qw{option2config}; |
---|
| 33 | use Getopt::Long qw{GetOptions}; |
---|
| 34 | use Pod::Usage qw{pod2usage}; |
---|
| 35 | |
---|
| 36 | if (!caller()) { |
---|
| 37 | main(@ARGV); |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | sub main { |
---|
| 41 | local(@ARGV) = @_; |
---|
| 42 | my %option; |
---|
| 43 | my $result = GetOptions( |
---|
| 44 | \%option, |
---|
| 45 | q{help|usage|h}, |
---|
| 46 | q{trac-live-dir=s}, |
---|
| 47 | ); |
---|
| 48 | if (!$result) { |
---|
| 49 | pod2usage(1); |
---|
| 50 | } |
---|
| 51 | if (exists($option{help})) { |
---|
| 52 | pod2usage(q{-verbose} => 1); |
---|
| 53 | } |
---|
| 54 | option2config(\%option); |
---|
| 55 | my $user_ref = get_users(); |
---|
| 56 | for my $project (filter_projects([get_projects_from_trac_live()], \@ARGV)) { |
---|
| 57 | manage_users_in_trac_db_of($project, $user_ref), |
---|
| 58 | } |
---|
| 59 | } |
---|
| 60 | |
---|
| 61 | __END__ |
---|
| 62 | |
---|
| 63 | =head1 NAME |
---|
| 64 | |
---|
| 65 | fcm-manage-trac-env-session |
---|
| 66 | |
---|
| 67 | =head1 SYNOPSIS |
---|
| 68 | |
---|
| 69 | fcm-manage-trac-env-session [OPTIONS] [PROJECT ...] |
---|
| 70 | |
---|
| 71 | =head1 OPTIONS |
---|
| 72 | |
---|
| 73 | =over 4 |
---|
| 74 | |
---|
| 75 | =item --help, -h, --usage |
---|
| 76 | |
---|
| 77 | Prints help and exits. |
---|
| 78 | |
---|
| 79 | =item --trac-live-dir=DIR |
---|
| 80 | |
---|
| 81 | Specifies the root location of the live directory of the Trac environments. See |
---|
| 82 | L<FCM::Admin::Config|FCM::Admin::Config> for the current default. |
---|
| 83 | |
---|
| 84 | =back |
---|
| 85 | |
---|
| 86 | =head1 DESCRIPTION |
---|
| 87 | |
---|
| 88 | This program manages session and session attributes for authenticated users in |
---|
| 89 | Trac environments. If no PROJECT is specified, the program acts on all trac |
---|
| 90 | environments in the live directory. |
---|
| 91 | |
---|
| 92 | =head1 COPYRIGHT |
---|
| 93 | |
---|
| 94 | Copyright (C) 2006-2021 British Crown (Met Office) & Contributors. |
---|
| 95 | |
---|
| 96 | =cut |
---|