Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  HTTPD::GROUPADMIN (3)

.ds Aq ’


HTTPD::GroupAdmin - Management of HTTP server group databases



    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.


new () 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-insensitive

<B>NameB> - Group name

<B>DBTypeB> - The type of database, one of ’DBM’, ’Text’, or ’SQL’ (Default is ’DBM’)

<B>DBB> - The database name (Default is ’.htpasswd’ for DBM & Text databases)

<B>ServerB> - 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 availible

<B>PathB> - Relative DB files are resolved to this value (Default is ’.’)

<B>LockingB> - Boolean, Lock Text and DBM files (Default is true)

<B>DebugB> - Boolean, Turn on debug mode

Specific to DBM files:

<B>DBMFB> - The DBM file implementation to use (Default is ’NDBM’)

<B>FlagsB> - The read, write and create flags. There are four modes: <B>rwcB> - the default, open for reading, writing and creating. <B>rwB> - open for reading and writing. <B>rB> - open for reading only. <B>wB> - open for writing only.

<B>ModeB> - 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:

<B>HostB> - Server hostname

<B>PortB> - Server port

<B>UserB> - Database login name

<B>AuthB> - Database login password

<B>DriverB> - Driver for DBI (Default is ’mSQL’)

<B>GroupTableB> - Table with field names below

<B>NameFieldB> - Field for the name (Default is ’user’)

<B>GroupFieldB> - Field for the group (Default is ’group’)

From here on out, things should look the same for everyone.

add($username[,$groupname]) 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[,$groupname]) Delete user $username from group $groupname, or whatever the ’Name’ attribute is set to.

    if($group->delete(dougm)) {
        print "Hes gone from the group\n";

exists($groupname, [$username]) 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([$groupname]) 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 yet

remove($groupname) Remove group $groupname from the database
name($groupname) Change the value of ’Name’ attribute.


debug($boolean) Turn debugging on or off
lock([$timeout]) =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 objects database
    $group->add($username,$passwd); #write while database is locked
    $group->unlock; release the lock

db($dbname); Select a different database.

    $olddb = $group->db($newdb);
    print "Now were reading and writing $newdb, done with $olddbn\";

flags([$flags]) Get or set read, write, create flags.
commit Commit changes to disk (for Text files).




Doug MacEachern <>

Copyright (c) 1996, 1997 Doug MacEachern

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 HTTPD::GROUPADMIN (3) 2003-01-16

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.