[IMPROVED] Allow contactform for guests
* Added admin option to disable access to contactform for guests * Propagated new option to templates Fixes #1185
This commit is contained in:
parent
a3117b889b
commit
a8a7d2c52f
@ -287,6 +287,13 @@ $aSettings['system'][] = array(
|
||||
'name' => 'disable_contactform', 'value' => $setting->getValue('disable_contactform'),
|
||||
'tooltip' => 'Enable or Disable Contactform. Users will not be able to use the contact form.'
|
||||
);
|
||||
$aSettings['system'][] = array(
|
||||
'display' => 'Disable Contactform for Guests', 'type' => 'select',
|
||||
'options' => array( 0 => 'No', 1 => 'Yes' ),
|
||||
'default' => 0,
|
||||
'name' => 'disable_contactform_guest', 'value' => $setting->getValue('disable_contactform_guest'),
|
||||
'tooltip' => 'Enable or Disable Contactform for guests. Guests will not be able to use the contact form.'
|
||||
);
|
||||
$aSettings['system'][] = array(
|
||||
'display' => 'Disable Donors Page', 'type' => 'select',
|
||||
'options' => array( 0 => 'No', 1 => 'Yes'),
|
||||
|
||||
@ -6,6 +6,9 @@ if (!defined('SECURITY')) die('Hacking attempt');
|
||||
if ($setting->getValue('disable_contactform')) {
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => 'Contactform is currently disabled. Please try again later.', 'TYPE' => 'errormsg');
|
||||
$smarty->assign("CONTENT", "disabled.tpl");
|
||||
} else if ($setting->getValue('disable_contactform_guest') && !$user->isAuthenticated(false)) {
|
||||
$_SESSION['POPUP'][] = array('CONTENT' => 'Contactform is disabled for guests.', 'TYPE' => 'errormsg');
|
||||
$smarty->assign("CONTENT", "disabled.tpl");
|
||||
} else {
|
||||
if ($setting->getValue('recaptcha_enabled')) {
|
||||
require_once(INCLUDE_DIR . '/lib/recaptchalib.php');
|
||||
|
||||
@ -69,6 +69,8 @@ $aGlobal = array(
|
||||
'disable_payouts' => $setting->getValue('disable_payouts'),
|
||||
'disable_manual_payouts' => $setting->getValue('disable_manual_payouts'),
|
||||
'disable_auto_payouts' => $setting->getValue('disable_auto_payouts'),
|
||||
'disable_contactform' => $setting->getValue('disable_contactform'),
|
||||
'disable_contactform_guest' => $setting->getValue('disable_contactform_guest'),
|
||||
'algorithm' => $config['algorithm'],
|
||||
'target_bits' => $config['target_bits'],
|
||||
'accounts' => $config['accounts'],
|
||||
|
||||
@ -662,7 +662,7 @@ margin: 0 10px;
|
||||
fieldset label {
|
||||
display: block;
|
||||
float: left;
|
||||
width: 200px;
|
||||
width: 250px;
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
|
||||
@ -72,14 +72,20 @@
|
||||
<h3>Other</h3>
|
||||
<ul class="toggle">
|
||||
{if $smarty.session.AUTHENTICATED|default:"0" == 1}
|
||||
{if !$GLOBAL.config.disable_contactform|default:"0" == 1}
|
||||
{if $GLOBAL.config.disable_contactform|default:"0" != 1}
|
||||
<li class="icon-mail"><a href="{$smarty.server.PHP_SELF}?page=contactform">Support</a></li>
|
||||
{else}
|
||||
<li class="icon-mail"><a href="{$smarty.server.PHP_SELF}?page=support">Support</a></li>
|
||||
{/if}
|
||||
<li class="icon-off"><a href="{$smarty.server.PHP_SELF}?page=logout">Logout</a></li>
|
||||
{else}
|
||||
<li class="icon-login"><a href="{$smarty.server.PHP_SELF}?page=login">Login</a></li>
|
||||
<li class="icon-pencil"><a href="{$smarty.server.PHP_SELF}?page=register">Sign Up</a></li>
|
||||
<li class="icon-mail"><a href="{$smarty.server.PHP_SELF}?page=support">Support</a></li>
|
||||
{if $GLOBAL.config.disable_contactform_guest|default:"0" == 1 || $GLOBAL.config.disable_contactform|default:"0" == 1}
|
||||
<li class="icon-mail"><a href="{$smarty.server.PHP_SELF}?page=support">Support</a></li>
|
||||
{else}
|
||||
<li class="icon-mail"><a href="{$smarty.server.PHP_SELF}?page=contactform">Support</a></li>
|
||||
{/if}
|
||||
{/if}
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user