Slaven Rezić > WE_Framework-0.097_03 > WE::Util::Htpasswd

Download:
WE_Framework-0.097_03.tar.gz

Dependencies

Annotate this POD

Module Version: 1.08   Source  

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.

syntax highlighting: