PHP 클래스 PasswordResetModel, huge

Handles all the stuff that is related to the password-reset process
파일 보기 프로젝트 열기: panique/huge 1 사용 예제들

공개 메소드들

메소드 설명
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)

메소드 상세

changePassword() 공개 정적인 메소드

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
리턴 boolean

requestPasswordReset() 공개 정적인 메소드

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
리턴 boolean success status

saveChangedPassword() 공개 정적인 메소드

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
리턴 boolean

saveNewUserPassword() 공개 정적인 메소드

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
리턴 boolean

sendPasswordResetMail() 공개 정적인 메소드

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
리턴 boolean success status

setNewPassword() 공개 정적인 메소드

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
리턴 boolean success state of the password reset

setPasswordResetDatabaseToken() 공개 정적인 메소드

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
리턴 boolean success status

validatePasswordChange() 공개 정적인 메소드

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
리턴 boolean

validateResetPassword() 공개 정적인 메소드

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
리턴 boolean

verifyPasswordReset() 공개 정적인 메소드

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
리턴 boolean Success status