Heres where we find out whats different about your server.
This creates an object whos database is a DBM file named .htpasswd, in a format that the Apache server understands.
This creates an object whose database is a plain text file named .htpasswd, in a format that the NCSA server understands.
This creates an object whos mSQL database is named www, with a schema that the Apache server (extention) understands.
Full list of constructor attributes:
Note: Attribute names are case-insensitive
Note: run perl t/support.t matrix to see what support is currently availible
<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.
Specific to DBM files:
From here on out, things should look the same for everyone.
Add a user.
Fails if $username exists in the database
You may need to pass additional fields, such as the users real name. This depends on your server of course.
You can also pass a set of field name/value pairs in the form of a hash ref. Example
Delete a user
Suspend a user
Unsuspend a suspended user
True if $username is found in the database
Returns the encrypted password for a user
Useful for copying users to another database.
Fetch a list of field values from the indicated user. Field names may be provided as a list or as an array reference. The return value is a reference to a hash containing the field/value pairs.
Returns a list of usernames in the current database
|update($username,$password,\%fields) <B>SQL onlyB>||
Update $username with a new $password
An undefined value in the password field will leave the field unchanged.
Short cut for creating an HTTPD::GroupAdmin object.
All applicable attributes are inherited, but can be
Convert a database.
These methods give you control of the locking mechanism.
Select a different database.
|flags([$flags])||Get or set read, write, create flags.|
|commit||Commit changes to disk (for Text files).|
Currently, you can store user info in a format for servers who support Message Digest Authentication. Heres an example:
$user = new HTTPD::UserAdmin (DB => .htdigest, Encrypt => MD5); ($username,$realm,$password) = (JoeUser, SomePlace, 14me); #The checksum contains more info that just a password $user->add($username, "$username:$realm:$password"); $user->update($username, "$username:$realm:newone"); $info = $user->password($username); ($realm, $checksum) = split(":", $info); $user->delete($username);
See <URL:http://hoohoo.ncsa.uiuc.edu/docs/howto/md5_auth.html> for NCSAs implementation.
So, its a little more work, but dont worry, a nicer interface is on the way.
Doug MacEachern <email@example.com>
Copyright (c) 1996, Doug MacEachern
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|perl v5.20.3||HTTPD::USERADMIN (3)||2003-01-16|