#!/usr/bin/perl -w -T
# +==========================================================================+
# || cipux_cat_web_module                                                   ||
# ||                                                                        ||
# || XML-RPC client to register, deregister and list a CAT module.          ||
# ||                                                                        ||
# || Copyright (C) 2008 - 2009 by Christian Kuelker                         ||
# ||                                                                        ||
# || License: GNU General Public license - GNU GPL - version 2              ||
# ||          or (at your opinion) any later version.                       ||
# ||                                                                        ||
# +==========================================================================+
# $Id$
# $Revision$
# $HeadURL$
# $Date$
# $Source$

package cipux_cat_web_module;

use 5.008001;
use strict;
use warnings;
use CipUX::CAT::Web::Setup::Client;
use version; our $VERSION = qv('3.4.0.3');
delete @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)};    # Make %ENV safer

# +==========================================================================+
# || MAIN                                                                   ||
# +==========================================================================+
my $client = CipUX::CAT::Web::Setup::Client->new(
    { name => 'cipux_cat_web_module' } );

$client->run();

exit 0;

__END__

=pod

=head1 NAME

Program to register, deregister and list a CAT modules.

=head1 SYNOPSIS

 (1) cipux_cat_web_module [OPTIONS] --register --object <NAME>| --all

 (2) cipux_cat_web_module [OPTIONS] --deregister --object <NAME>| --all

 (3) cipux_cat_web_module [OPTIONS] --list-registered

 (4) cipux_cat_web_module [OPTIONS] --list-deregistered

=head1 OPTIONS

        Options for all commands:
        -D | --debug         : print debug messages for developers
        -h | --help          : print help (this message + options)
        -l | --login ID      : uses ID as UID to authenticate
        -V | --version       : print only version
             --verbose       : print more messages
        -w | --password CRED : uses CRED as credential to authenticate

        Additional options for registering and deregistering:
        -a | --all     : (de)register all pending objects

        Additional options for registering:
        -e | --enable     : enable module(s)
        -m | --add-member : add object (user or group) to ACL

=head1 USAGE SPECIFIC OPTIONS

(1) register

 --add-member <NAME>  : do add object to the ACL, so that this object
                        can access the modules. An object could be a
                        group or a user.

 -e | --enable        : do enable the module during registration; module is
                        disabled by default

 -a | --all           : register all modules
 or
 -o | --object <NAME> : or register only one module


(2) deregister

 -a | --all           : deregister all modules
 or
 -o | --object <NAME> : or deregister only one module

The URL of the CipUX XML-RPC server is taken from cipux-cat-web.ini file. The
default location for CipUX-CAT-Web. If you would like to use a different URL
change catweb_rpc_server in the base section.


=head1 DESCRIPTION OF OPTIONS

=over 4

=item I<-a>

Same as option --all

=item I<-add-member NAME>

Adds NAME to the ACL of that module(s).

=item I<-all>

Register all CAT modules.

=item I<-D>

Same as option --debug.

=item I<--debug>

To see more output, what the internals is doing, you can enable the --debug
option and see more message printed to STDOUT.

=item I<-e>

Same as option --enable.

=item I<--enable>

Enable the object during registration.

=item I<-h>

Same as option --help

=item I<--help>

Prints brief help message.

=item I<-l UID>

Same as option --login UID.

=item I<--login UID>

Use UID as identity to authenticate against RPC server.

=item I<-o>

Same as option --object

=item I<--object>

This option is used to specify the object on which the command is operating.
Make sure you choose the right object. Of course this will also fail when the
object is not fetchable with (in the objects list of) --task.

=item I<--password SECRET>

Use SECRET as credential to authenticate against RPC server.

=item I<-V>

Same as option --version.

=item I<--version>

Prints the version and exits.

=item I<--verbose>

Not implemented yet.

=item I<-v>

Same as option --verbose.

=item I<-w SECRET>

Same as option --password SECRET.

=back

=cut

