PHP 클래스 RegistrationModel, huge

Everything registration-related happens here.
파일 보기 프로젝트 열기: panique/huge 1 사용 예제들

공개 메소드들

메소드 설명
registerNewUser ( ) : boolean Handles the entire registration process for DEFAULT users (not for people who register with 3rd party services, like facebook) and creates a new user in the database if everything is fine
registrationInputValidation ( $captcha, $user_name, $user_password_new, $user_password_repeat, $user_email, $user_email_repeat ) : boolean Validates the registration input
rollbackRegistrationByUserId ( $user_id ) Deletes the user from users table. Currently used to rollback a registration when verification mail sending was not successful.
sendVerificationEmail ( integer $user_id, string $user_email, string $user_activation_hash ) : boolean Sends the verification email (to confirm the account).
validateUserEmail ( $user_email, $user_email_repeat ) : boolean Validates the email
validateUserName ( $user_name ) : boolean Validates the username
validateUserPassword ( $user_password_new, $user_password_repeat ) : boolean Validates the password
verifyNewUser ( integer $user_id, string $user_activation_verification_code ) : boolean checks the email/verification code combination and set the user's activation status to true in the database
writeNewUserToDatabase ( $user_name, $user_password_hash, $user_email, $user_creation_timestamp, $user_activation_hash ) : boolean Writes the new user's data to the database

메소드 상세

registerNewUser() 공개 정적인 메소드

Handles the entire registration process for DEFAULT users (not for people who register with 3rd party services, like facebook) and creates a new user in the database if everything is fine
public static registerNewUser ( ) : boolean
리턴 boolean Gives back the success status of the registration

registrationInputValidation() 공개 정적인 메소드

Validates the registration input
public static registrationInputValidation ( $captcha, $user_name, $user_password_new, $user_password_repeat, $user_email, $user_email_repeat ) : boolean
$captcha
$user_name
$user_password_new
$user_password_repeat
$user_email
$user_email_repeat
리턴 boolean

rollbackRegistrationByUserId() 공개 정적인 메소드

Deletes the user from users table. Currently used to rollback a registration when verification mail sending was not successful.
public static rollbackRegistrationByUserId ( $user_id )
$user_id

sendVerificationEmail() 공개 정적인 메소드

The construction of the mail $body looks weird at first, but it's really just a simple string.
public static sendVerificationEmail ( integer $user_id, string $user_email, string $user_activation_hash ) : boolean
$user_id integer user's id
$user_email string user's email
$user_activation_hash string user's mail verification hash string
리턴 boolean gives back true if mail has been sent, gives back false if no mail could been sent

validateUserEmail() 공개 정적인 메소드

Validates the email
public static validateUserEmail ( $user_email, $user_email_repeat ) : boolean
$user_email
$user_email_repeat
리턴 boolean

validateUserName() 공개 정적인 메소드

Validates the username
public static validateUserName ( $user_name ) : boolean
$user_name
리턴 boolean

validateUserPassword() 공개 정적인 메소드

Validates the password
public static validateUserPassword ( $user_password_new, $user_password_repeat ) : boolean
$user_password_new
$user_password_repeat
리턴 boolean

verifyNewUser() 공개 정적인 메소드

checks the email/verification code combination and set the user's activation status to true in the database
public static verifyNewUser ( integer $user_id, string $user_activation_verification_code ) : boolean
$user_id integer user id
$user_activation_verification_code string verification token
리턴 boolean success status

writeNewUserToDatabase() 공개 정적인 메소드

Writes the new user's data to the database
public static writeNewUserToDatabase ( $user_name, $user_password_hash, $user_email, $user_creation_timestamp, $user_activation_hash ) : boolean
$user_name
$user_password_hash
$user_email
$user_creation_timestamp
$user_activation_hash
리턴 boolean