diff --git a/public/include/config/admin_settings.inc.php b/public/include/config/admin_settings.inc.php index 379ac811..9c8e27a1 100644 --- a/public/include/config/admin_settings.inc.php +++ b/public/include/config/admin_settings.inc.php @@ -294,6 +294,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'), diff --git a/public/include/pages/contactform.inc.php b/public/include/pages/contactform.inc.php index e4f947c4..75dc427f 100644 --- a/public/include/pages/contactform.inc.php +++ b/public/include/pages/contactform.inc.php @@ -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'); diff --git a/public/include/pages/contactform/contactform.inc.php b/public/include/pages/contactform/contactform.inc.php index fbfab779..28425bfd 100644 --- a/public/include/pages/contactform/contactform.inc.php +++ b/public/include/pages/contactform/contactform.inc.php @@ -17,6 +17,8 @@ if ($setting->getValue('recaptcha_enabled')) { if ($setting->getValue('disable_contactform')) { $_SESSION['POPUP'][] = array('CONTENT' => 'Contactform is currently disabled. Please try again later.', 'TYPE' => 'errormsg'); +} else if ($setting->getValue('disable_contactform') && !$user->isAuthenticated(false)) { + $_SESSION['POPUP'][] = array('CONTENT' => 'Contactform is disabled for guests.', 'TYPE' => 'errormsg'); } else { // Check if recaptcha is enabled, process form data if valid if($setting->getValue('recaptcha_enabled') && $_POST["recaptcha_response_field"] && $_POST["recaptcha_response_field"]!=''){ diff --git a/public/include/smarty_globals.inc.php b/public/include/smarty_globals.inc.php index 6555391e..10b7de8a 100644 --- a/public/include/smarty_globals.inc.php +++ b/public/include/smarty_globals.inc.php @@ -70,6 +70,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'], diff --git a/public/site_assets/mpos/css/layout.css b/public/site_assets/mpos/css/layout.css index 2ba5a823..f28a2a70 100644 --- a/public/site_assets/mpos/css/layout.css +++ b/public/site_assets/mpos/css/layout.css @@ -663,7 +663,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; diff --git a/public/templates/mpos/global/navigation.tpl b/public/templates/mpos/global/navigation.tpl index 139accbe..58801499 100644 --- a/public/templates/mpos/global/navigation.tpl +++ b/public/templates/mpos/global/navigation.tpl @@ -72,14 +72,20 @@