Merge pull request #290 from TheSerapher/remove-register-configuration

Removed registration configuration option
This commit is contained in:
Sebastian Grewe 2013-06-30 03:32:53 -07:00
commit d7182ce74f
5 changed files with 20 additions and 10 deletions

View File

@ -39,7 +39,6 @@ $config = array(
'theme' => 'mmcFE', // Overall default theme 'theme' => 'mmcFE', // Overall default theme
'mobile' => true, // Allow overwriting theme for mobile devices 'mobile' => true, // Allow overwriting theme for mobile devices
'mobile_theme' => 'mobile', // Set default or custom mobile theme 'mobile_theme' => 'mobile', // Set default or custom mobile theme
'registration' => true, // Allow new users to register
'name' => 'The Pool', 'name' => 'The Pool',
'slogan' => 'Resistance is futile', 'slogan' => 'Resistance is futile',
'email' => 'test@example.com', // Mail address used for notifications 'email' => 'test@example.com', // Mail address used for notifications

View File

@ -18,7 +18,8 @@ if ($_REQUEST['do'] == 'save' && !empty($_REQUEST['data'])) {
// Fetch settings to propagate to template // Fetch settings to propagate to template
$smarty->assign("MAINTENANCE", $setting->getValue('maintenance')); $smarty->assign("MAINTENANCE", $setting->getValue('maintenance'));
$smarty->assign("REGISTRATION", $setting->getValue('registration')); var_dump($setting->getValue('lock_registration'));
$smarty->assign("LOCKREGISTRATION", $setting->getValue('lock_registration'));
// Tempalte specifics // Tempalte specifics
$smarty->assign("CONTENT", "default.tpl"); $smarty->assign("CONTENT", "default.tpl");

View File

@ -3,7 +3,7 @@
// Make sure we are called from index.php // Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt'); if (!defined('SECURITY')) die('Hacking attempt');
if (!$config['website']['registration'] || !$setting->getValue('registration')) { if ($setting->getValue('lock_registration')) {
$_SESSION['POPUP'][] = array('CONTENT' => 'Account registration is currently disabled. Please try again later.', 'TYPE' => 'errormsg'); $_SESSION['POPUP'][] = array('CONTENT' => 'Account registration is currently disabled. Please try again later.', 'TYPE' => 'errormsg');
$smarty->assign("CONTENT", "disabled.tpl"); $smarty->assign("CONTENT", "disabled.tpl");
} else { } else {

View File

@ -17,9 +17,9 @@ if ($config['recaptcha']['enabled']) {
if($config['recaptcha']['enabled'] && $_POST["recaptcha_response_field"] && $_POST["recaptcha_response_field"]!=''){ if($config['recaptcha']['enabled'] && $_POST["recaptcha_response_field"] && $_POST["recaptcha_response_field"]!=''){
if ($rsp->is_valid) { if ($rsp->is_valid) {
$smarty->assign("RECAPTCHA", recaptcha_get_html($config['recaptcha']['public_key'])); $smarty->assign("RECAPTCHA", recaptcha_get_html($config['recaptcha']['public_key']));
if (!$config['website']['registration'] || !$setting->getValue('registration')) { if ($setting->getValue('lock_registration')) {
$_SESSION['POPUP'][] = array('CONTENT' => 'Account registration is currently disabled. Please try again later.', 'TYPE' => 'errormsg'); $_SESSION['POPUP'][] = array('CONTENT' => 'Account registration is currently disabled. Please try again later.', 'TYPE' => 'errormsg');
} else if ($user->register($_POST['username'], $_POST['password1'], $_POST['password2'], $_POST['pin'], $_POST['email1'], $_POST['email2']) && ($config['website']['registration'] || $setting->getValue('registration'))) { } else if ($user->register($_POST['username'], $_POST['password1'], $_POST['password2'], $_POST['pin'], $_POST['email1'], $_POST['email2']) && !$setting->getValue('lock_registration')) {
$_SESSION['POPUP'][] = array('CONTENT' => 'Account created, please login'); $_SESSION['POPUP'][] = array('CONTENT' => 'Account created, please login');
} else { } else {
$_SESSION['POPUP'][] = array('CONTENT' => 'Unable to create account: ' . $user->getError(), 'TYPE' => 'errormsg'); $_SESSION['POPUP'][] = array('CONTENT' => 'Unable to create account: ' . $user->getError(), 'TYPE' => 'errormsg');
@ -34,9 +34,9 @@ if($config['recaptcha']['enabled'] && $_POST["recaptcha_response_field"] && $_PO
$_SESSION['POPUP'][] = array('CONTENT' => 'Empty Captcha, please try again.', 'TYPE' => 'errormsg'); $_SESSION['POPUP'][] = array('CONTENT' => 'Empty Captcha, please try again.', 'TYPE' => 'errormsg');
// Captcha disabled // Captcha disabled
} else { } else {
if (!$config['website']['registration'] || !$setting->getValue('registration')) { if ($setting->getValue('lock_registration')) {
$_SESSION['POPUP'][] = array('CONTENT' => 'Account registration is currently disabled. Please try again later.', 'TYPE' => 'errormsg'); $_SESSION['POPUP'][] = array('CONTENT' => 'Account registration is currently disabled. Please try again later.', 'TYPE' => 'errormsg');
} else if ($user->register($_POST['username'], $_POST['password1'], $_POST['password2'], $_POST['pin'], $_POST['email1'], $_POST['email2']) && $config['website']['registration']) { } else if ($user->register($_POST['username'], $_POST['password1'], $_POST['password2'], $_POST['pin'], $_POST['email1'], $_POST['email2']) && !$setting->getValue('lock_registration')) {
$_SESSION['POPUP'][] = array('CONTENT' => 'Account created, please login'); $_SESSION['POPUP'][] = array('CONTENT' => 'Account created, please login');
} else { } else {
$_SESSION['POPUP'][] = array('CONTENT' => 'Unable to create account: ' . $user->getError(), 'TYPE' => 'errormsg'); $_SESSION['POPUP'][] = array('CONTENT' => 'Unable to create account: ' . $user->getError(), 'TYPE' => 'errormsg');

View File

@ -13,12 +13,22 @@
<tr> <tr>
<td class="left">Maintenance Mode</td> <td class="left">Maintenance Mode</td>
<td class="center"><span id='tt'><img src='{$PATH}/images/questionmark.png' height='15px' width='15px' title='Enable Maintenance Mode for mmcfe-ng. Only admins can login.'></span></td> <td class="center"><span id='tt'><img src='{$PATH}/images/questionmark.png' height='15px' width='15px' title='Enable Maintenance Mode for mmcfe-ng. Only admins can login.'></span></td>
<td><select name="data[maintenance]"><option value="1">Yes</option><option value="0"{if !$MAINTENANCE} selected{/if}>No</option></select></td> <td>
<select name="data[maintenance]">
<option value="1">Yes</option>
<option value="0"{if !$MAINTENANCE} selected{/if}>No</option>
</select>
</td>
</tr> </tr>
<tr> <tr>
<td class="left">User Registration</td> <td class="left">Disable Registration</td>
<td class="center"><span id='tt'><img src='{$PATH}/images/questionmark.png' height='15px' width='15px' title='Enable or disable new account registration. Can also be done via configuration option.'></span></td> <td class="center"><span id='tt'><img src='{$PATH}/images/questionmark.png' height='15px' width='15px' title='Enable or disable new account registration. Can also be done via configuration option.'></span></td>
<td><select name="data[registration]"><option value="1">Yes</option><option value="0"{if !$REGISTRATION} selected{/if}>No</option></select></td> <td>
<select name="data[lock_registration]">
<option value="1">Yes</option>
<option value="0"{if !$LOCKREGISTRATION} selected{/if}>No</option>
</select>
</td>
</tr> </tr>
<tr><td class="center" colspan="3"><input type="submit" value="Save" class="submit small" /></td></tr> <tr><td class="center" colspan="3"><input type="submit" value="Save" class="submit small" /></td></tr>
</tbody> </tbody>