PHP Class RegistrationModel, huge

Everything registration-related happens here.
Afficher le fichier Open project: panique/huge Class Usage Examples

Méthodes publiques

Méthode Description
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

Method Details

registerNewUser() public static méthode

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
Résultat boolean Gives back the success status of the registration

registrationInputValidation() public static méthode

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
Résultat boolean

rollbackRegistrationByUserId() public static méthode

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() public static méthode

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
Résultat boolean gives back true if mail has been sent, gives back false if no mail could been sent

validateUserEmail() public static méthode

Validates the email
public static validateUserEmail ( $user_email, $user_email_repeat ) : boolean
$user_email
$user_email_repeat
Résultat boolean

validateUserName() public static méthode

Validates the username
public static validateUserName ( $user_name ) : boolean
$user_name
Résultat boolean

validateUserPassword() public static méthode

Validates the password
public static validateUserPassword ( $user_password_new, $user_password_repeat ) : boolean
$user_password_new
$user_password_repeat
Résultat boolean

verifyNewUser() public static méthode

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
Résultat boolean success status

writeNewUserToDatabase() public static méthode

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
Résultat boolean