LDS > HTTPD-User-Manage-1.66 > HTTPD::UserAdmin
[ search.cpan.org |
Kobes search |
report a bug
]
(1 note; [first note])
NAME
SYNOPSIS
DESCRIPTION
This software is meant to provide a generic interface that hides the inconsistencies across HTTP server implementations of user and group databases.
METHODS
- new ()
This creates an object who's database is a DBM file named '.htpasswd', in a format that the Apache server understands.
@Text = (DBType => 'Text', DB => '.htpasswd', Server => 'ncsa'); $user = new HTTPD::UserAdmin @Text;This creates an object whose database is a plain text file named '.htpasswd', in a format that the NCSA server understands.
@SQL = (DBType => "SQL", Host => "", #server hostname Port => "", #server port DB => "www", #database name User => "", #database login name Auth => "", #database login password Encrypt => "crypt", #encryption method Driver => "mSQL", #driver for DBI Server => "apache", #HTTP server type, not required UserTable => "www-users", #table with field names below NameField => "user", #field for the name PasswordField => "password", #field for the password ); $user = new HTTPD::UserAdmin @SQL;This creates an object who's mSQL database is named 'www', with a schema that the Apache server (extention) understands.
Server - HTTP server name (Default is the generic class, that works with NCSA, Apache and possibly others)
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.
- add($username,$password,[@fields])
- add($username,$password,\%fields)
- delete($username)
- suspend($username)
- unsuspend($username)
- exists($username)
- password()
- fetch($username,@fields)
- list()
- update($username,$password)
- update($username,$password,\%fields) SQL only
- group()
- convert(@Attributes)
- lock([$timeout])
- unlock()
- db($dbname);
- flags([$flags])
- commit
Message Digest User Databases
Currently, you can store user info in a format for servers who support Message Digest Authentication. Here's 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 ALSO
AUTHOR
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
(1 note; [last note])


