HTTPD::GroupAdmin

HTTPD::GroupAdmin is a Perl module for the management of HTTP server group databases.
Download

HTTPD::GroupAdmin Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Doug MacEachern
  • Publisher web site:
  • http://search.cpan.org/~gozer/mod_perl-1.30/lib/Apache/Status.pm

HTTPD::GroupAdmin Tags


HTTPD::GroupAdmin Description

HTTPD::GroupAdmin is a Perl module for the management of HTTP server group databases. HTTPD::GroupAdmin is a Perl module for the management of HTTP server group databases.SYNOPSIS use HTTPD::GroupAdmin ();This software is meant to provide a generic interface that hides the inconsistencies across HTTP server implementations of user and group databases.METHODSnew ()Here's where we find out what's different about your server.Some examples: @DBM = (DBType => 'DBM', DB => '.htgroup', Server => 'apache'); $group = new HTTPD::GroupAdmin @DBM;This creates an object whose database is a DBM file named '.htgroup', in a format that the Apache server understands. @Text = (DBType => 'Text', DB => '.htgroup', Server => 'ncsa'); $group = new HTTPD::GroupAdmin @Text;This creates an object whose database is a plain text file named '.htgroup', in a format that the NCSA server understands.Full list of constructor attributes:Note: Attribute names are case-insensitiveName - Group nameDBType - The type of database, one of 'DBM', 'Text', or 'SQL' (Default is 'DBM')DB - The database name (Default is '.htpasswd' for DBM & Text databases)Server - HTTP server name (Default is the generic class, that works with NCSA, Apache and possibly others)Note: run 'perl t/support.t matrix' to see what support is currently availiblePath - Relative DB files are resolved to this value (Default is '.')Locking - Boolean, Lock Text and DBM files (Default is true)Debug - Boolean, Turn on debug modeSpecific to DBM files:DBMF - The DBM file implementation to use (Default is 'NDBM')Flags - The read, write and create flags. There are four modes: rwc - the default, open for reading, writing and creating. rw - open for reading and writing. r - open for reading only. w - open for writing only.Mode - The file creation mode, defaults to '0644'Specific to DBI: We talk to an SQL server via Tim Bunce's DBI interface. For more info see: http://www.hermetica.com/technologia/DBI/Host - Server hostnamePort - Server portUser - Database login nameAuth - Database login passwordDriver - Driver for DBI (Default is 'mSQL')GroupTable - Table with field names belowNameField - Field for the name (Default is 'user')GroupField - Field for the group (Default is 'group')From here on out, things should look the same for everyone.add($username)Add user $username to group $groupname, or whatever the 'Name' attribute is set to.Fails if $username exists in the database if($group->add('dougm', 'www-group')) { print "Welcome!n"; }delete($username)Delete user $username from group $groupname, or whatever the 'Name' attribute is set to. if($group->delete('dougm')) { print "He's gone from the groupn"; }exists($groupname, )True if $groupname is found in the database if($group->exists('web-heads')) { die "oh no!"; } if($group->exists($groupname, $username) { #$username is a member of $groupname }list()Returns a list of group names, or users in a group if '$name' is present.@groups = $group->list;@users = $group->list('web-heads');user()Short cut for creating an HTTPD::UserAdmin object. All applicable attributes are inherited, but can be overridden. $user = $group->user();(See HTTPD::UserAdmin)convert(@Attributes)Convert a database. #not yetremove($groupname)Remove group $groupname from the databasename($groupname)Change the value of 'Name' attribute. $group->name('bew-ediw-dlrow');debug($boolean)Turn debugging on or offlock() =item unlock()These methods give you control of the locking mechanism. $group = new HTTPD::GroupAdmin (Locking => 0); #turn off auto-locking $group->lock; #lock the object's database $group->add($username,$passwd); #write while database is locked $group->unlock; release the lockdb($dbname);Select a different database. $olddb = $group->db($newdb); print "Now we're reading and writing '$newdb', done with '$olddb'n";flags()Get or set read, write, create flags.commitCommit changes to disk (for Text files). Requirements: · Perl


HTTPD::GroupAdmin Related Software