[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/password/ -> PasswordFactory.php (summary)

Implements the Password class for the MediaWiki software. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

File Size: 178 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 8 functions

  register()
  setDefaultType()
  init()
  getTypes()
  newFromCiphertext()
  newFromType()
  newFromPlaintext()
  needsUpdate()

Functions
Functions that are not part of a class:

register( $type, array $config )   X-Ref
Register a new type of password hash

param: string $type Unique type name for the hash
param: array $config Array of configuration options

setDefaultType( $type )   X-Ref
Set the default password type

param: string $type Password hash type

init( Config $config )   X-Ref
Initialize the internal static variables using the global variables

param: Config $config Configuration object to load data from

getTypes()   X-Ref
Get the list of types of passwords

return: array

newFromCiphertext( $hash )   X-Ref
Create a new Hash object from an existing string hash

Parse the type of a hash and create a new hash object based on the parsed type.
Pass the raw hash to the constructor of the new object. Use InvalidPassword type
if a null hash is given.

param: string|null $hash Existing hash or null for an invalid password
return: Password

newFromType( $type )   X-Ref
Make a new default password of the given type.

param: string $type Existing type
return: Password

newFromPlaintext( $password, Password $existing = null )   X-Ref
Create a new Hash object from a plaintext password

If no existing object is given, make a new default object. If one is given, clone that
object. Then pass the plaintext to Password::crypt().

param: string $password Plaintext password
param: Password|null $existing Optional existing hash to get options from
return: Password

needsUpdate( Password $password )   X-Ref
Determine whether a password object needs updating

Check whether the given password is of the default type. If it is,
pass off further needsUpdate checks to Password::needsUpdate.

param: Password $password
return: bool True if needs update, false otherwise



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1