Apache2-AuthAny

 view release on metacpan or  search on metacpan

bin/auth-any-user.pl  view on Meta::CPAN

#!/usr/bin/perl

use strict;
use warnings;

use Apache2::AuthAny::DB ();
use Getopt::Long;

use Data::Dumper qw(Dumper);

my $usage = "Usage: auth-any-user.pl [options] user\n" .
  "Use 'auth-any-user.pl --help' for complete documentation\n";

my $full_usage = <<'USAGE';
Usage: auth-any-user.pl [options] user

Options:

 --help                  Print this documentation
 --get                   Return user's settings (default)
 --report [full|line|email] Report style for --get or --search
 --add                   Add user
 --update                Update user
 --search                Search for users matching input fields
 --verbose               Verbose output (used by --search)

 --organization str
 --firstName str
 --lastName str
 --phone str
 --email str
 --active [0|1]          Defaults to 1

 --role str
 --no-role str           The role is removed if in "--update" mode

 --ident                 Identity for use with --search
 --protectnetIdent str   Identity, +, or - (see below)
 --uwIdent str
 --googleIdent str
 --basicIdent str
 --ldapIdent str

The provider arguments (--xxxIdent) all take "+" or "-" as well as the user's
identity string. If "+" is used, the identity will be the username appended
with the default for the provider. For example, "--uwIdent + joe" would
produce the identity, "joe@washington.edu". If "-" is used, that identity
is removed.

EXAMPLES:
Search for an existing president who has the preview role
$ auth-any-user.pl --search --verbose --ident pres

Add new user, "boboma"
$ auth-any-user.pl --add --googleIdent president@whitehouse.gov boboma

Update "bobama", adding a second Google ident and the contributor role. The
plus (+) sign after '--google' results in the default identity, 
"boboma@gmail.com".
Note the use of abbreviated flags. They only need to be unambiguous.
$ auth-any-user.pl --up --google + -r contributor boboma

Get information about "boboma"
$ auth-any-user.pl boboma

Update "bobama", removing all Google identities and the contributor role. The
preview role is added along with Protect Network and UW identities.
$ auth-any-user.pl -up -go - -no-role contributor -r preview -uw + -pr + boboma



( run in 2.825 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )