-
- if(count($errors) == 0)
- {
- //Construct a user object
- $user = new User($username,$displayname,$password,$email);
-
- //Checking this flag tells us whether there were any errors such as possible data duplication occured
- if(!$user->status)
- {
- if($user->username_taken) $errors[] = lang("ACCOUNT_USERNAME_IN_USE",array($username));
- if($user->displayname_taken) $errors[] = lang("ACCOUNT_DISPLAYNAME_IN_USE",array($displayname));
- if($user->email_taken) $errors[] = lang("ACCOUNT_EMAIL_IN_USE",array($email));
- }
- else
- {
- //Attempt to add the user to the database, carry out finishing tasks like emailing the user (if required)
- if(!$user->userCakeAddUser())
- {
- if($user->mail_failure) $errors[] = lang("MAIL_ERROR");
- if($user->sql_failure) $errors[] = lang("SQL_ERROR");
- }
- }
+ //Construct a user object
+ $user = new User($username,$displayname,$password,$email);
+
+ //Checking this flag tells us whether there were any errors such as possible data duplication occured
+ if(!$user->status)
+ {
+ if($user->username_taken) $localerrors[] = lang("ACCOUNT_USERNAME_IN_USE",array($username));
+ if($user->displayname_taken) $localerrors[] = lang("ACCOUNT_DISPLAYNAME_IN_USE",array($displayname));
+ if($user->email_taken) $localerrors[] = lang("ACCOUNT_EMAIL_IN_USE",array($email));