Apache-Htpasswd

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

NAME
    Apache::Htpasswd - Manage Unix crypt-style password file.

SYNOPSIS
        use Apache::Htpasswd;

        $foo = new Apache::Htpasswd("path-to-file");

        # Add an entry    
        $foo->htpasswd("zog", "password");

        # Change a password    
        $foo->htpasswd("zog", "new-password", "old-password");
    
        # Change a password without checking against old password
        # The 1 signals that the change is being forced.
    
        $foo->htpasswd("zog", "new-password", 1);
        
        # Check that a password is correct
        $pwdFile->htCheckPassword("zog", "password");

        # Fetch an encrypted password 
        $foo->fetchPass("foo");
    
        # Delete entry
        $foo->htDelete("foo");

        # If something fails, check error
        $foo->error;

        # Write in the extra info field
        $foo->writeInfo("login", "info");

        # Get extra info field for a user
        $foo->fetchInfo("login");

DESCRIPTION
    This module comes with a set of methods to use with htaccess password
    files. These files (and htaccess) are used to do Basic Authentication on
    a web server.

    The passwords file is a flat-file with login name and their associated
    crypted password. You can use this for non-Apache files if you wish, but
    it was written specifically for .htaccess style files.

  FUNCTIONS

    htaccess->new("path-to-file");
        "path-to-file" should be the path and name of the file containing
        the login/password information.

    error;
        If a method returns an error, or a method fails, the error can be
        retrived by calling error()

    htCheckPassword("login", "password");
        Finds if the password is valid for the given login.

        Returns 1 if passes. Returns 0 if fails.

    htpasswd("login", "password");



( run in 1.890 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )