[ADDED] Accept TaC during registration
This commit is contained in:
parent
9338af0d31
commit
f465bda350
@ -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 <a href="'.$_SERVER['PHP_SELF'].'?page=tac" target="_blank">Terms and Conditions</a>');
|
||||
return false;
|
||||
}
|
||||
if (strlen($username) > 40) {
|
||||
$this->setErrorMessage('Username exceeding character limit');
|
||||
return false;
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -1,38 +1,43 @@
|
||||
<article class="module width_quarter">
|
||||
<header><h3>Register new account</h3></header>
|
||||
<div class="module_content">
|
||||
<form action="{$smarty.server.PHP_SELF}" method="post">
|
||||
<input type="hidden" name="page" value="{$smarty.request.page|escape}">
|
||||
<form action="{$smarty.server.PHP_SELF}" method="post">
|
||||
<input type="hidden" name="page" value="{$smarty.request.page|escape}">
|
||||
{if $smarty.request.token|default:""}
|
||||
§ <input type="hidden" name="token" value="{$smarty.request.token|escape}" />
|
||||
§ <input type="hidden" name="token" value="{$smarty.request.token|escape}" />
|
||||
{/if}
|
||||
<input type="hidden" name="action" value="register">
|
||||
<fieldset>
|
||||
<label>Username</label>
|
||||
<input type="text" class="text tiny" name="username" value="{$smarty.post.username|escape|default:""}" size="15" maxlength="20" required>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label>Password</label>
|
||||
<input type="password" class="text tiny" name="password1" value="" size="15" maxlength="20" required>
|
||||
<label>Repeat Password</label>
|
||||
<input type="password" class="text tiny" name="password2" value="" size="15" maxlength="20" required>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label>Email</label>
|
||||
<input type="text" name="email1" class="text small" value="{$smarty.post.email1|escape|default:""}" size="15" required>
|
||||
<label>Email Repeat</label>
|
||||
<input type="text" class="text small" name="email2" value="{$smarty.post.email2|escape|default:""}" size="15" required>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label>PIN</label>
|
||||
<input type="password" class="text pin" name="pin" value="" size="4" maxlength="4"><font size="1"> (4 digit number. <b>Remember this pin!</b>)</font>
|
||||
</fieldset>
|
||||
{nocache}{$RECAPTCHA|default:""}{/nocache}
|
||||
<input type="hidden" name="action" value="register">
|
||||
<fieldset>
|
||||
<label>Username</label>
|
||||
<input type="text" class="text tiny" name="username" value="{$smarty.post.username|escape|default:""}" size="15" maxlength="20" required>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label>Password</label>
|
||||
<input type="password" class="text tiny" name="password1" value="" size="15" maxlength="20" required>
|
||||
<label>Repeat Password</label>
|
||||
<input type="password" class="text tiny" name="password2" value="" size="15" maxlength="20" required>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label>Email</label>
|
||||
<input type="text" name="email1" class="text small" value="{$smarty.post.email1|escape|default:""}" size="15" required>
|
||||
<label>Email Repeat</label>
|
||||
<input type="text" class="text small" name="email2" value="{$smarty.post.email2|escape|default:""}" size="15" required>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label>PIN</label>
|
||||
<input type="password" class="text pin" name="pin" value="" size="4" maxlength="4" required><font size="1"> (4 digit number. <b>Remember this pin!</b>)</font>
|
||||
</fieldset>
|
||||
{nocache}{$RECAPTCHA|default:""}{/nocache}
|
||||
<fieldset>
|
||||
<label>Terms and Conditions</label><font size="1"> Accept Terms and Conditions</font>
|
||||
<input type="checkbox" value="1" name="tac" id="tac">
|
||||
<label for="tac"></label>
|
||||
</fieldset>
|
||||
</div>
|
||||
<footer>
|
||||
<div class="submit_link">
|
||||
<input type="submit" value="Register" class="alt_btn">
|
||||
</div>
|
||||
</footer>
|
||||
</form>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user