FusionDirectory
Public Member Functions | Static Public Member Functions
passwordMethod Class Reference

This class contains all the basic function for password methods. More...

Inheritance diagram for passwordMethod:
Inheritance graph
[legend]

Public Member Functions

 __construct ($dn='', $userTab=NULL)
 Password method contructor. More...
 
 generate_hash (string $pwd, bool $locked=FALSE)
 Generate template hash. More...
 
 is_available ()
 Is available. More...
 
 need_password ()
 If we need password. More...
 
 is_lockable ()
 If we can lock the password. More...
 
 is_locked ($dn='', $pwd='')
 Is locked. More...
 
 lock_account ($dn='', bool $lockEverything=TRUE)
 Locks an account by adding a '!' as prefix to the password hashes. This makes login impossible, due to the fact that the hash becomes invalid. userPassword: {SHA}!q02NKl9IChNwZEAJxzRdmB6E sambaLMPassword: !EBD223B61F8C259AD3B435B51404EE sambaNTPassword: !98BB35737013AAF181D0FE9FDA09E. More...
 
 unlock_account ($dn='')
 Unlocks an account which was locked by 'lock_account()'. For details about the locking mechanism see 'lock_account()'.
 
 checkPassword ($pwd, $hash)
 Method to check if a password matches a hash.
 
 is_configurable ()
 Return true if this password method provides a configuration dialog.
 
 configure ()
 Provide a subdialog to configure a password method.
 
 save ($dn)
 Save information to LDAP. More...
 
 set_hash ($hash)
 Set a hash. More...
 
 get_hash ()
 Get a hash.
 

Static Public Member Functions

static get_hash_name ()
 Get the Hash name.
 
static get_available_methods ()
 This function returns all loaded classes for password encryption.
 
static get_method ($password_hash, $dn='')
 Try to find out if it's our hash... More...
 
static _extract_method ($password_hash)
 Extract a method. More...
 
static make_hash ($password, $hash)
 Make a hash. More...
 
static is_harmless ($password)
 Test for problematic unicode caracters in password This can be activated with the keyword strictPasswordRules in the fusiondirectory.conf. More...
 

Detailed Description

This class contains all the basic function for password methods.

Definition at line 31 of file class_passwordMethod.inc.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $dn = '',
  $userTab = NULL 
)

Password method contructor.

Parameters
string$dnThe DN
object$userTabThe user main tab object

Definition at line 44 of file class_passwordMethod.inc.

References generate_hash(), and get_hash_name().

Member Function Documentation

◆ _extract_method()

static _extract_method (   $password_hash)
static

Extract a method.

Parameters
string$classnameThe password method class name
string$password_hash

Definition at line 344 of file class_passwordMethod.inc.

◆ generate_hash()

generate_hash ( string  $pwd,
bool  $locked = FALSE 
)
abstract

Generate template hash.

Parameters
string$pwdPassword
bool$lockedShould the password be locked
Returns
string the password hash

Referenced by __construct(), and checkPassword().

◆ get_method()

static get_method (   $password_hash,
  $dn = '' 
)
static

Try to find out if it's our hash...

Parameters
string$password_hash
string$dnThe DN

Definition at line 314 of file class_passwordMethod.inc.

References get_available_methods().

◆ is_available()

is_available ( )

Is available.

Returns
TRUE

Definition at line 68 of file class_passwordMethod.inc.

◆ is_harmless()

static is_harmless (   $password)
static

Test for problematic unicode caracters in password This can be activated with the keyword strictPasswordRules in the fusiondirectory.conf.

Parameters
string$passwordThe password

Definition at line 395 of file class_passwordMethod.inc.

◆ is_lockable()

is_lockable ( )

If we can lock the password.

Returns
boolean

Definition at line 88 of file class_passwordMethod.inc.

◆ is_locked()

is_locked (   $dn = '',
  $pwd = '' 
)

Is locked.

Parameters
string$dnThe DN

Definition at line 98 of file class_passwordMethod.inc.

◆ lock_account()

lock_account (   $dn = '',
bool  $lockEverything = TRUE 
)

Locks an account by adding a '!' as prefix to the password hashes. This makes login impossible, due to the fact that the hash becomes invalid. userPassword: {SHA}!q02NKl9IChNwZEAJxzRdmB6E sambaLMPassword: !EBD223B61F8C259AD3B435B51404EE sambaNTPassword: !98BB35737013AAF181D0FE9FDA09E.

Parameters
string$dn

Definition at line 126 of file class_passwordMethod.inc.

◆ make_hash()

static make_hash (   $password,
  $hash 
)
static

Make a hash.

Parameters
string$passwordThe password
string$hash

Definition at line 361 of file class_passwordMethod.inc.

References get_available_methods().

◆ need_password()

need_password ( )

If we need password.

Returns
boolean TRUE

Definition at line 78 of file class_passwordMethod.inc.

◆ save()

save (   $dn)

Save information to LDAP.

Parameters
string$dnThe DN

Definition at line 302 of file class_passwordMethod.inc.

◆ set_hash()

set_hash (   $hash)

Set a hash.

Parameters
string$hash

Definition at line 374 of file class_passwordMethod.inc.


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