PHP Class PasswordResetModel, huge

Handles all the stuff that is related to the password-reset process
Afficher le fichier Open project: panique/huge Class Usage Examples

Méthodes publiques

Méthode Description
changePassword ( string $user_name, string $user_password_current, string $user_password_new, string $user_password_repeat ) : boolean Validates fields, hashes new password, saves new password
requestPasswordReset ( $user_name_or_email, $captcha ) : boolean Perform the necessary actions to send a password reset mail
saveChangedPassword ( string $user_name, string $user_password_hash ) : boolean Writes the new password to the database
saveNewUserPassword ( string $user_name, string $user_password_hash, string $user_password_reset_hash ) : boolean Writes the new password to the database
sendPasswordResetMail ( string $user_name, string $user_password_reset_hash, string $user_email ) : boolean Send the password reset mail
setNewPassword ( string $user_name, string $user_password_reset_hash, string $user_password_new, string $user_password_repeat ) : boolean Set the new password (for DEFAULT user, FACEBOOK-users don't have a password) Please note: At this point the user has already pre-verified via verifyPasswordReset() (within one hour), so we don't need to check again for the 60min-limit here. In this method we authenticate via username & password-reset-hash from (hidden) form fields.
setPasswordResetDatabaseToken ( string $user_name, string $user_password_reset_hash, integer $temporary_timestamp ) : boolean Set password reset token in database (for DEFAULT user accounts)
validatePasswordChange ( string $user_name, string $user_password_current, string $user_password_new, string $user_password_repeat ) : boolean Validates current and new passwords
validateResetPassword ( $user_name, $user_password_reset_hash, $user_password_new, $user_password_repeat ) : boolean Validate the password submission
verifyPasswordReset ( string $user_name, string $verification_code ) : boolean Verifies the password reset request via the verification hash token (that's only valid for one hour)

Method Details

changePassword() public static méthode

Validates fields, hashes new password, saves new password
public static changePassword ( string $user_name, string $user_password_current, string $user_password_new, string $user_password_repeat ) : boolean
$user_name string
$user_password_current string
$user_password_new string
$user_password_repeat string
Résultat boolean

requestPasswordReset() public static méthode

Perform the necessary actions to send a password reset mail
public static requestPasswordReset ( $user_name_or_email, $captcha ) : boolean
$user_name_or_email string Username or user's email
$captcha string Captcha string
Résultat boolean success status

saveChangedPassword() public static méthode

Writes the new password to the database
public static saveChangedPassword ( string $user_name, string $user_password_hash ) : boolean
$user_name string
$user_password_hash string
Résultat boolean

saveNewUserPassword() public static méthode

Writes the new password to the database
public static saveNewUserPassword ( string $user_name, string $user_password_hash, string $user_password_reset_hash ) : boolean
$user_name string username
$user_password_hash string
$user_password_reset_hash string
Résultat boolean

sendPasswordResetMail() public static méthode

Send the password reset mail
public static sendPasswordResetMail ( string $user_name, string $user_password_reset_hash, string $user_email ) : boolean
$user_name string username
$user_password_reset_hash string password reset hash
$user_email string user email
Résultat boolean success status

setNewPassword() public static méthode

Set the new password (for DEFAULT user, FACEBOOK-users don't have a password) Please note: At this point the user has already pre-verified via verifyPasswordReset() (within one hour), so we don't need to check again for the 60min-limit here. In this method we authenticate via username & password-reset-hash from (hidden) form fields.
public static setNewPassword ( string $user_name, string $user_password_reset_hash, string $user_password_new, string $user_password_repeat ) : boolean
$user_name string
$user_password_reset_hash string
$user_password_new string
$user_password_repeat string
Résultat boolean success state of the password reset

setPasswordResetDatabaseToken() public static méthode

Set password reset token in database (for DEFAULT user accounts)
public static setPasswordResetDatabaseToken ( string $user_name, string $user_password_reset_hash, integer $temporary_timestamp ) : boolean
$user_name string username
$user_password_reset_hash string password reset hash
$temporary_timestamp integer timestamp
Résultat boolean success status

validatePasswordChange() public static méthode

Validates current and new passwords
public static validatePasswordChange ( string $user_name, string $user_password_current, string $user_password_new, string $user_password_repeat ) : boolean
$user_name string
$user_password_current string
$user_password_new string
$user_password_repeat string
Résultat boolean

validateResetPassword() public static méthode

Validate the password submission
public static validateResetPassword ( $user_name, $user_password_reset_hash, $user_password_new, $user_password_repeat ) : boolean
$user_name
$user_password_reset_hash
$user_password_new
$user_password_repeat
Résultat boolean

verifyPasswordReset() public static méthode

Verifies the password reset request via the verification hash token (that's only valid for one hour)
public static verifyPasswordReset ( string $user_name, string $verification_code ) : boolean
$user_name string Username
$verification_code string Hash token
Résultat boolean Success status