NAME

Authen::Htpasswd::User - represents a user line in a .htpasswd file

SYNOPSIS

   my $user = Authen::Htpasswd::User->new($username, $password[, $extra_info], \%options);
   my $user = $pwfile->lookup_user($username); # from Authen::Htpasswd object
   
   if ($user->check_password($password)) { ... }
   if ($user->hashed_password eq $foo) { ... }
   
   # these are written immediately if the user was looked up from an Authen::Htpasswd object
   $user->username('bill');
   $user->password('bar');
   $user->hashed_password('tIYAwma5mxexA');
   $user->extra_info('root');
   $user->set(username => 'bill', password => 'foo'); # set several at once
   
   print $user->to_line, "\n";

METHODS

new($username, $password[, $extra_info], \%options)

Creates a user object. You may also specify the arguments and options together as a hash: new({ username => $foo, password => $bar, extra_info => $baz, ... }).

encrypt_hash
check_hashes

See Authen::Htpasswd.

hashed_password

Explicitly sets the value of the hashed password, rather than generating it with password.

check_password($password,$hashes)

Returns whether the password matches. Hashes is an array of methods, as for Authen::Htpasswd.

username, hashed_password, extra_info

These methods get and set the three fields of the user line. If the user was looked up from an Authen::Htpasswd object, the changes are written immediately to the assciated file. The same goes for password and set below.

password($newpass)

Encrypts a new password.

set(item => value, ...)

Sets any of the four preceding values at once. Only writes the file once if it is going to be written.

to_line

Returns a line for the user suitable for printing to a .htpasswd file. There is no newline at the end.

AUTHOR

David Kamholz

davekam at pobox dot com

1 POD Error

The following errors were encountered while parsing the POD:

Around line 163:

You forgot a '=back' before '=head1'