diff --git a/public/include/classes/user.class.php b/public/include/classes/user.class.php index 16502af2..fa1d5485 100644 --- a/public/include/classes/user.class.php +++ b/public/include/classes/user.class.php @@ -456,8 +456,12 @@ class User extends Base { * @param email2 string Email confirmation * @return bool **/ - public function register($username, $password1, $password2, $pin, $email1='', $email2='', $strToken='') { + public function register($username, $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'); + return false; + } if (strlen($username) > 40) { $this->setErrorMessage('Username exceeding character limit'); return false; diff --git a/public/include/pages/register/register.inc.php b/public/include/pages/register/register.inc.php index 3c63963b..79856585 100644 --- a/public/include/pages/register/register.inc.php +++ b/public/include/pages/register/register.inc.php @@ -23,7 +23,7 @@ if ($setting->getValue('disable_invitations') && $setting->getValue('lock_regist if ($rsp->is_valid) { $smarty->assign("RECAPTCHA", recaptcha_get_html($setting->getValue('recaptcha_public_key'))); isset($_POST['token']) ? $token = $_POST['token'] : $token = ''; - if ($user->register(@$_POST['username'], @$_POST['password1'], @$_POST['password2'], @$_POST['pin'], @$_POST['email1'], @$_POST['email2'], $token)) { + if ($user->register(@$_POST['username'], @$_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' => 'errormsg'); @@ -39,7 +39,7 @@ if ($setting->getValue('disable_invitations') && $setting->getValue('lock_regist // Captcha disabled } else { isset($_POST['token']) ? $token = $_POST['token'] : $token = ''; - if ($user->register(@$_POST['username'], @$_POST['password1'], @$_POST['password2'], @$_POST['pin'], @$_POST['email1'], @$_POST['email2'], $token)) { + if ($user->register(@$_POST['username'], @$_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' => 'errormsg'); diff --git a/public/templates/mpos/register/default.tpl b/public/templates/mpos/register/default.tpl index ba8f58e6..f109d8e9 100644 --- a/public/templates/mpos/register/default.tpl +++ b/public/templates/mpos/register/default.tpl @@ -1,38 +1,43 @@

Register new account

-
- + + {if $smarty.request.token|default:""} - § + § {/if} - -
- - -
-
- - - - -
-
- - - - -
-
- - (4 digit number. Remember this pin!) -
- {nocache}{$RECAPTCHA|default:""}{/nocache} + +
+ + +
+
+ + + + +
+
+ + + + +
+
+ + (4 digit number. Remember this pin!) +
+ {nocache}{$RECAPTCHA|default:""}{/nocache} +
+  Accept Terms and Conditions + + +
+
-