TITAN Library for PHP5  5.1.0
Web Software Development Kit for PHP5
htpasswd Class Reference

Titan .htpasswd Handler Class. More...

Public Member Functions

 __construct ($filename=null)
 
 load ()
 
 save ()
 
 rand_salt_crypt ($pass)
 
 rand_salt_sha1 ($pass)
 
 non_salted_sha1 ($pass)
 
 add ($user, $pass, $save=false)
 
 check ($user, $pass)
 

Detailed Description

Titan .htpasswd Handler Class.

Class: \tl\core\htpasswd

Author
James E. Bush work@.nosp@m.bush.nosp@m..cc
Version
5.1.0

Constructor & Destructor Documentation

__construct (   $filename = null)

Constructor

Parameters
mixed$filename(optional) The name and of the file to use. (default) null = '.htpasswd'

Member Function Documentation

load ( )

Loads htpasswd contents into an array of form array( username => crypted_pass, ... )

Returns
boolean Success?
save ( )

Saves the array of usernames/passwords to the .htaccess file

Returns
boolean Success?
rand_salt_crypt (   $pass)

Generates a htpasswd compatible crypted password string.

Parameters
string$passThe password to encrypt
Returns
string The crypted password
rand_salt_sha1 (   $pass)

Generates a htpasswd compatible sha1 password hash.

Parameters
string$passThe password to encrypt
Returns
string The SHA1 password hash
non_salted_sha1 (   $pass)

Generate a SHA1 password hash without salt.

Parameters
string$passThe password to encrypt
Returns
string The unsalted SHA1 password hash
add (   $user,
  $pass,
  $save = false 
)

Add a username/password to the .htpasswd array.

Parameters
mixed$user
string$userThe username
string$passThe password to encrypt
boolean$save(optional) Save the file? (default) false
Returns
boolean Success?
check (   $user,
  $pass 
)

Check if the user exists and the password matches.

Parameters
string$userThe username to check
string$passThe password to check
Returns
boolean Does the user exist and the password match?

The documentation for this class was generated from the following file: