From b01689caf8e372d40112eda0f14a84eed41389d5 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Tue, 23 Feb 2016 03:04:11 -0500
Subject: [PATCH] Hide DSN option in Preferences when smtp_server is not used (#1490666)

---
 program/steps/settings/func.inc |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index 087b236..250a258 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -748,7 +748,7 @@
                 );
             }
 
-            if (!isset($no_override['dsn_default'])) {
+            if (!isset($no_override['dsn_default']) && $RCMAIL->config->get('smtp_server')) {
                 if (!$current) {
                     continue 2;
                 }
@@ -845,6 +845,20 @@
                 );
             }
 
+            if (!isset($no_override['sig_below'])) {
+                if (!$current) {
+                    continue 2;
+                }
+
+                $field_id = 'rcmfd_sig_below';
+                $input    = new html_checkbox(array('name' => '_sig_below', 'id' => $field_id, 'value' => 1));
+
+                $blocks['sig']['options']['sig_below'] = array(
+                    'title'   => html::label($field_id, rcube::Q($RCMAIL->gettext('sigbelow'))),
+                    'content' => $input->show($RCMAIL->config->get('sig_below') ? 1 : 0),
+                );
+            }
+
             if (!isset($no_override['strip_existing_sig'])) {
                 if (!$current) {
                     continue 2;

--
Gitblit v1.9.1