28 include(
"inc/common.php");
43 header(
"Location: home.php");
49 $email = trim($_POST[
"email"]);
50 $mobile = str_replace(array(
'/',
' ',
'-'),
'', $_POST[
"mobile"]);
58 $password = trim($_POST[
"password"]);
60 $confirm_pass = trim($_POST[
"passwordc"]);
61 $captcha = md5($_POST[
"captcha"]);
64 if ($captcha != $_SESSION[
'captcha']) {
69 $errors[] =
lang(
'ACCOUNT_FIRST_INVALID_CHARACTERS');
72 $errors[] =
lang(
'ACCOUNT_LAST_INVALID_CHARACTERS');
76 $errors[] =
lang(
"ACCOUNT_PASS_CHAR_LIMIT", array(8, 50));
78 if ($password != $confirm_pass) {
93 $user =
new User($username, $firstname, $lastname, $password, $email, $mobile);
97 if ($user->username_taken)
98 $errors[] =
lang(
"ACCOUNT_USERNAME_IN_USE", array($username));
99 if ($user->email_taken)
100 $errors[] =
lang(
"ACCOUNT_EMAIL_IN_USE", array($email));
101 if ($user->mobile_taken)
102 $errors[] =
lang(
"ACCOUNT_MOBILE_IN_USE", array($mobile));
105 if (!$user->userCakeAddUser()) {
106 if ($user->mail_failure)
108 if ($user->sql_failure)
115 $smarty->assign(
'firstname', $firstname);
116 $smarty->assign(
'lastname', $lastname);
117 $smarty->assign(
'email', $email);
118 $smarty->assign(
'mobile', $mobile);
124 unset($confirm_pass);
132 $smarty->assign(
'firstname', $firstname);
133 $smarty->assign(
'lastname', $lastname);
134 $smarty->assign(
'email', $email);
135 $smarty->assign(
'mobile', $mobile);