diff --git a/include/classes/user.class.php b/include/classes/user.class.php index 11c2b20f7..509f5da1d 100644 --- a/include/classes/user.class.php +++ b/include/classes/user.class.php @@ -731,7 +731,7 @@ public function getUserData($userID) { * @param email2 string Email confirmation * @return bool **/ - public function register($username, $password1, $password2, $pin, $email1='', $email2='', $tac='', $strToken='') { + public function register($username, $coinaddress, $password1, $password2, $pin, $email1='', $email2='', $tac='', $strToken='') { $this->debug->append("STA " . __METHOD__, 4); if ($tac != 1) { $this->setErrorMessage('You need to accept our Terms and Conditions'); @@ -741,6 +741,10 @@ public function register($username, $password1, $password2, $pin, $email1='', $e $this->setErrorMessage('Username exceeding character limit'); return false; } + if (strlen($coinaddress) < 35) { + $this->setErrorMessage('Coin Address is to short'); + return false; + } if (preg_match('/[^a-z_\-0-9]/i', $username)) { $this->setErrorMessage('Username may only contain alphanumeric characters'); return false; @@ -795,15 +799,15 @@ public function register($username, $password1, $password2, $pin, $email1='', $e ! $this->setting->getValue('accounts_confirm_email_disabled') ? $is_locked = 1 : $is_locked = 0; $is_admin = 0; $stmt = $this->mysqli->prepare(" - INSERT INTO $this->table (username, pass, email, signup_timestamp, pin, api_key, is_locked) - VALUES (?, ?, ?, ?, ?, ?, ?) + INSERT INTO $this->table (username, pass, email, signup_timestamp, pin, api_key, is_locked, coin_address) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) "); } else { $is_locked = 0; $is_admin = 1; $stmt = $this->mysqli->prepare(" - INSERT INTO $this->table (username, pass, email, signup_timestamp, pin, api_key, is_admin, is_locked) - VALUES (?, ?, ?, ?, ?, ?, 1, ?) + INSERT INTO $this->table (username, pass, email, signup_timestamp, pin, api_key, is_admin, is_locked, coin_address) + VALUES (?, ?, ?, ?, ?, ?, 1, ?, ?) "); } @@ -814,7 +818,7 @@ public function register($username, $password1, $password2, $pin, $email1='', $e $username_clean = strip_tags($username); $signup_time = time(); - if ($this->checkStmt($stmt) && $stmt->bind_param('sssissi', $username_clean, $password_hash, $email1, $signup_time, $pin_hash, $apikey_hash, $is_locked) && $stmt->execute()) { + if ($this->checkStmt($stmt) && $stmt->bind_param('sssissis', $username_clean, $password_hash, $email1, $signup_time, $pin_hash, $apikey_hash, $is_locked, $coinaddress) && $stmt->execute()) { if (! $this->setting->getValue('accounts_confirm_email_disabled') && $is_admin != 1) { if ($token = $this->token->createToken('confirm_email', $stmt->insert_id)) { $aData['username'] = $username_clean; diff --git a/include/pages/register/register.inc.php b/include/pages/register/register.inc.php index e2dcd75f2..60d988c6b 100644 --- a/include/pages/register/register.inc.php +++ b/include/pages/register/register.inc.php @@ -26,7 +26,7 @@ if ($setting->getValue('recaptcha_enabled') != 1 || $setting->getValue('recaptcha_enabled_registrations') != 1 || $rsp->is_valid) { // Check if recaptcha is enabled, process form data if valid or disabled isset($_POST['token']) ? $token = $_POST['token'] : $token = ''; - if ($user->register(@$_POST['username'], @$_POST['password1'], @$_POST['password2'], @$_POST['pin'], @$_POST['email1'], @$_POST['email2'], @$_POST['tac'], $token)) { + if ($user->register(@$_POST['username'], @$_POST['coinaddress'], @$_POST['password1'], @$_POST['password2'], @$_POST['pin'], @$_POST['email1'], @$_POST['email2'], @$_POST['tac'], $token)) { (!$setting->getValue('accounts_confirm_email_disabled')) ? $_SESSION['POPUP'][] = array('CONTENT' => 'Please check your mailbox to activate this account') : $_SESSION['POPUP'][] = array('CONTENT' => 'Account created, please login'); } else { $_SESSION['POPUP'][] = array('CONTENT' => 'Unable to create account: ' . $user->getError(), 'TYPE' => 'alert alert-danger'); diff --git a/templates/bootstrap/register/default.tpl b/templates/bootstrap/register/default.tpl index 2d302c735..722f903f4 100644 --- a/templates/bootstrap/register/default.tpl +++ b/templates/bootstrap/register/default.tpl @@ -22,6 +22,11 @@ + +
+ + +
(Strength)