The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WE::Util::Htpasswd - create apache .htpasswd files from a user database

SYNOPSIS

    use WE::Util::Htpasswd;
    WE::Util::Htpasswd::create("/var/www/.htpasswd", $complex_user_db);

DESCRIPTION

Create apache .htpasswd files from a WE_Framework user database.

FUNCTIONS

create($dest_file, $user_db, %args);

Create the .htpasswd as $dest_file from the (complex) user database object $user_db. Note that the user database should use the "none" CryptMode (that is, store plain text passwords).

add_user($dest_file, $user_object, %args);

Add the entry for a user to the .htpasswd file $dest_file. The user object should be a WE::UserObj object as created in WE::DB::ComplexUser.

invalid_chars

Return a string of invalid characters for htpasswd usernames. This is handy for using in ComplexUser:

    new WE::DB::ComplexUser(..., ...,
                            -crypt => "none",
                            -invalidchars => WE::Util::Htpasswd::invalid_chars(),
                            -invalidgroupchars => WE::Util::Htgroup::invalid_chars())

TODO

Maybe optionally use Apache::Htpasswd from CPAN to create .htpasswd. This would be handy if htpasswd is not available.

AUTHOR

Slaven Rezic - slaven@rezic.de

SEE ALSO

htpasswd(1), WE::DB::ComplexUser, WE::Util::Htgroup, WE::Util::Htaccess.