GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Authen::Htpasswd::User(3) User Contributed Perl Documentation Authen::Htpasswd::User(3)

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

    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', 'joe@site.com', 'Joe Sysadmin');
    $user->set(username => 'bill', password => 'foo'); # set several at once
    
    print $user->to_line, "\n";

    my $userobj = Authen::Htpasswd::User->new($username, $password[, @extra_info], \%options);

Creates a user object. You may also specify the arguments and options together in a hash: "{ username => $foo, password => $bar, extra_info => [$email, $name], ... }".

encrypt_hash
check_hashes
See Authen::Htpasswd.
hashed_password
Explicitly sets the value of the hashed password, rather than generating it with "password".

    $userobj->check_password($password,\@check_hashes);

Returns whether the password matches. "check_hashes" is the same as for Authen::Htpasswd.

Get and set the fields of the user line. These methods, as well as "password" and "set" below, write any changes immediately if the user was lookup up from an Authen::Htpasswd object. If the username is changed, the old entry is not preserved.

    $userobj->password($newpass);

Encrypts a new password. Dies if $newpass is not provided.

    $userobj->set(item => $value, ...);

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

    $userobj->to_line;

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

David Kamholz "dkamholz@cpan.org"

Yuval Kogman

    Copyright (c) 2005 - 2007 the aforementioned authors.
    
    This program is free software; you can redistribute
    it and/or modify it under the same terms as Perl itself.
2011-08-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.