diff --git a/install/sql/incremental/upd_dev_collection.sql b/install/sql/incremental/upd_dev_collection.sql
index 6eea12b71af63f848737554fd43b8626140b8c48..4395655c62622efdd007355b0106789a3da36489 100644
--- a/install/sql/incremental/upd_dev_collection.sql
+++ b/install/sql/incremental/upd_dev_collection.sql
@@ -20,7 +20,7 @@ mbox={EMAIL}.
 refresh=7200
 retry=540
 expire=604800
-minimum=86400
+minimum=3600
 ttl=3600
 
 [DNS_RECORDS]
@@ -134,3 +134,9 @@ CREATE TABLE `xmpp_user` (
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
 
 -- --------------------------------------------------------
+
+UPDATE `dbispconfig`.`sys_ini` SET `default_logo` = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABBCAYAAACU5+uOAAAItUlEQVR42u1dCWwVVRStUJZCK6HsFNAgWpaCJkKICZKApKUFhURQpEnZF4EEUJZYEEpBIamgkQpUQBZRW7YCBqQsggsQEAgKLbIGCYsSCNqyQ8D76h18Hd/MvJk/n/bXc5KT+TNz79vPzNv+/2FhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAe++s0akTsRZxMnE6cGkKcxkwhPofaBPwWRzxxB/EO8UGI8xhxEGoV8EscY8qBKFRcgdoFAhXHC+VUHAbHo5aBQASyrZwL5DoxEjUNeBXI9XIuEMEE1DTgVSA3FA3qIDEtBLnTQiBDUNOAV4EUKhpURojmZQQEAjwKgSwK0bykWQgEU74ABAKBABAIBOIJffoNrkRsS0whDiMO5uNw4gBiSxvfGOJrbDtMOgr2JNa18HmZmETsopnGp4h9xdF0TcQRb8NEPkawTzv2qaWIoybnZYRUBoJD+difGAuBlCy0qsRM4mfERcTFfGygsBUF/xFxE/EQ8RixwIbi/j7il8R3iE8qwuxAXMJxuuFiTvNMYleb/E0gXiI+cOBaISTJrzLxcw2/+8Q5pjjfNNkM0RDILLadpbimw+bsc4DPkxRpuqkZ1orisoBAiguuhkUhPSvZRBA3u6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w4K3mOJv23J8jme23RsEAMqqQJrb9PnnEbPEVpUAuJD4Mf/PoCqeONQCUJYFElGKf7ojpnqjUQtAWRdJaf1t2w8ofSAUBNKulATSEaUPhIpIRj9icbyFUgdCTSRTeR0i2HwfpQ0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQBnG392D9QU+JXhxAAAAAElFTkSuQmCC' WHERE `sys_ini`.`sysini_id` = 1;
+
+ALTER TABLE `directive_snippets` ADD `required_php_snippets` VARCHAR(255) NOT NULL DEFAULT '' AFTER `customer_viewable`;
+ALTER TABLE `dns_rr` CHANGE `ttl` `ttl` INT(11) UNSIGNED NOT NULL DEFAULT '3600';
+ALTER TABLE `dns_soa` CHANGE `minimum` `minimum` INT(11) UNSIGNED NOT NULL DEFAULT '3600', CHANGE `ttl` `ttl` INT(11) UNSIGNED NOT NULL DEFAULT '3600';
\ No newline at end of file
diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql
index 5011f16f9fbdb769fe9b424b1e777b9e5dd89e07..a020d028a4c03640671af5f81c24b423c3e7a2dd 100644
--- a/install/sql/ispconfig3.sql
+++ b/install/sql/ispconfig3.sql
@@ -442,6 +442,7 @@ CREATE TABLE IF NOT EXISTS `directive_snippets` (
   `type` varchar(255) DEFAULT NULL,
   `snippet` mediumtext,
   `customer_viewable` ENUM('n','y') NOT NULL DEFAULT 'n',
+  `required_php_snippets` varchar(255) NOT NULL DEFAULT '',
   `active` enum('n','y') NOT NULL DEFAULT 'y',
   PRIMARY KEY (`directive_snippets_id`)
 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -465,7 +466,7 @@ CREATE TABLE `dns_rr` (
   `type` enum('A','AAAA','ALIAS','CNAME','HINFO','MX','NAPTR','NS','PTR','RP','SRV','TXT') default NULL,
   `data` TEXT NOT NULL DEFAULT '',
   `aux` int(11) unsigned NOT NULL default '0',
-  `ttl` int(11) unsigned NOT NULL default '86400',
+  `ttl` int(11) unsigned NOT NULL default '3600',
   `active` enum('N','Y') NOT NULL default 'Y',
   `stamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
   `serial` int(10) unsigned default NULL,
@@ -517,8 +518,8 @@ CREATE TABLE `dns_soa` (
   `refresh` int(11) unsigned NOT NULL default '28800',
   `retry` int(11) unsigned NOT NULL default '7200',
   `expire` int(11) unsigned NOT NULL default '604800',
-  `minimum` int(11) unsigned NOT NULL default '86400',
-  `ttl` int(11) unsigned NOT NULL default '86400',
+  `minimum` int(11) unsigned NOT NULL default '3600',
+  `ttl` int(11) unsigned NOT NULL default '3600',
   `active` enum('N','Y') NOT NULL DEFAULT 'N',
   `xfer` varchar(255) NOT NULL DEFAULT '',
   `also_notify` varchar(255) default NULL,
@@ -2316,7 +2317,7 @@ INSERT INTO `country` (`iso`, `name`, `printable_name`, `iso3`, `numcode`, `eu`)
 -- Dumping data for table `dns_template`
 -- 
 
-INSERT INTO `dns_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `name`, `fields`, `template`, `visible`) VALUES (1, 1, 1, 'riud', 'riud', '', 'Default', 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM', '[ZONE]\norigin={DOMAIN}.\nns={NS1}.\nmbox={EMAIL}.\nrefresh=7200\nretry=540\nexpire=604800\nminimum=86400\nttl=3600\n\n[DNS_RECORDS]\nA|{DOMAIN}.|{IP}|0|3600\nA|www|{IP}|0|3600\nA|mail|{IP}|0|3600\nNS|{DOMAIN}.|{NS1}.|0|3600\nNS|{DOMAIN}.|{NS2}.|0|3600\nMX|{DOMAIN}.|mail.{DOMAIN}.|10|3600\nTXT|{DOMAIN}.|v=spf1 mx a ~all|0|3600', 'y');
+INSERT INTO `dns_template` (`template_id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `name`, `fields`, `template`, `visible`) VALUES (1, 1, 1, 'riud', 'riud', '', 'Default', 'DOMAIN,IP,NS1,NS2,EMAIL,DKIM', '[ZONE]\norigin={DOMAIN}.\nns={NS1}.\nmbox={EMAIL}.\nrefresh=7200\nretry=540\nexpire=604800\nminimum=3600\nttl=3600\n\n[DNS_RECORDS]\nA|{DOMAIN}.|{IP}|0|3600\nA|www|{IP}|0|3600\nA|mail|{IP}|0|3600\nNS|{DOMAIN}.|{NS1}.|0|3600\nNS|{DOMAIN}.|{NS2}.|0|3600\nMX|{DOMAIN}.|mail.{DOMAIN}.|10|3600\nTXT|{DOMAIN}.|v=spf1 mx a ~all|0|3600', 'y');
 
 
 -- --------------------------------------------------------
diff --git a/interface/lib/classes/validate_dkim.inc.php b/interface/lib/classes/validate_dkim.inc.php
index 71fd8c5454a847b1877cd9d74e81502538803851..5d7fb8f1e369a88930ca90379ee90be5af2cb203 100644
--- a/interface/lib/classes/validate_dkim.inc.php
+++ b/interface/lib/classes/validate_dkim.inc.php
@@ -62,8 +62,10 @@ class validate_dkim {
 	 */
 	function check_template($field_name, $field_value, $validator) {
 		$dkim=false;
-		foreach($field_value as $field ) { if($field == 'DKIM') $dkim=true; }
-		if ($dkim && $field_value[0]!='DOMAIN') return $this->get_error($validator['errmsg']);
+		if(is_array($field_value) && !empty($field_value)){
+			foreach($field_value as $field ) { if($field == 'DKIM') $dkim=true; }
+			if ($dkim && $field_value[0]!='DOMAIN') return $this->get_error($validator['errmsg']);
+		}
 	}
 
 
diff --git a/interface/web/admin/form/directive_snippets.tform.php b/interface/web/admin/form/directive_snippets.tform.php
index 8db725b95fe11c7c453641fd67b3518f4fdab740..0c2502c6c4a4c1ef4b5a8cceaa5bd295ba6e0894 100644
--- a/interface/web/admin/form/directive_snippets.tform.php
+++ b/interface/web/admin/form/directive_snippets.tform.php
@@ -105,6 +105,17 @@ $form["tabs"]['directive_snippets'] = array (
 			'default' => 'y',
 			'value'  => array(0 => 'n', 1 => 'y')
 		),
+		'required_php_snippets' => array (
+			'datatype' => 'VARCHAR',
+			'formtype' => 'CHECKBOXARRAY',
+			'default' => '',
+			'datasource' => array (  'type' => 'SQL',
+				'querystring' => "SELECT directive_snippets_id,name FROM directive_snippets WHERE type = 'php' AND active = 'y'ORDER BY name",
+				'keyfield' => 'directive_snippets_id',
+				'valuefield' => 'name'
+			),
+			'separator' => ',',
+		),
 		//#################################
 		// ENDE Datatable fields
 		//#################################
diff --git a/interface/web/admin/templates/directive_snippets_edit.htm b/interface/web/admin/templates/directive_snippets_edit.htm
index 7729fc163d8b118e0862a29e511e99a8ed6f375c..21b76867ec12d468ff7371222951e1ef809276aa 100644
--- a/interface/web/admin/templates/directive_snippets_edit.htm
+++ b/interface/web/admin/templates/directive_snippets_edit.htm
@@ -17,6 +17,12 @@
 			<div class="form-group">
                 <label for="snippet" class="col-sm-3 control-label">{tmpl_var name='snippet_txt'}</label>
                 <div class="col-sm-9"><textarea class="form-control" name="snippet" id="snippet" rows='10' cols='50'>{tmpl_var name='snippet'}</textarea></div><span class="nginx"> &nbsp; {tmpl_var name='variables_txt'}: </span><a href="javascript:void(0);" class="addPlaceholder nginx">{DOCROOT}</a><span class="nginx">, </span><a href="javascript:void(0);" class="addPlaceholder nginx">{FASTCGIPASS}</a>
+            </div>
+			<div class="form-group php">
+                <label class="col-sm-3 control-label">{tmpl_var name='required_php_snippets_txt'}</label>
+                <div class="col-sm-9">
+                    {tmpl_var name='required_php_snippets'}
+                </div>
             </div>
 			<div class="form-group">
                 <label class="col-sm-3 control-label">{tmpl_var name='customer_viewable_txt'}</label>
@@ -48,15 +54,19 @@
 	
 	if (jQuery('#type').val() != 'nginx' && jQuery('#type').val() != 'apache') {
 		jQuery('#customer_viewable').closest('div.ctrlHolder:visible').hide();
-	}else {
+		jQuery('.php:visible').hide();
+	} else {
 		jQuery('#customer_viewable').closest('div.ctrlHolder:hidden').show();
+		jQuery('.php:hidden').show();
 	}
     
     jQuery('#type').change(function(){
 		if (jQuery(this).val() != 'nginx' && jQuery(this).val() != 'apache') {
 			jQuery('#customer_viewable').closest('div.ctrlHolder:visible').hide();
+			jQuery('.php:visible').hide();
 		} else {
 			jQuery('#customer_viewable').closest('div.ctrlHolder:hidden').show();
+			jQuery('.php:hidden').show();
 		}
         if(jQuery(this).val() == 'nginx'){
             jQuery('.nginx:hidden').show();
diff --git a/interface/web/dns/form/dns_a.tform.php b/interface/web/dns/form/dns_a.tform.php
index 95aa5b81c0d6cb1a5ccd0c43789c69bacee2fd99..cd5a3eb9ab070ea877a2e283f655b2d9fa59d0ef 100644
--- a/interface/web/dns/form/dns_a.tform.php
+++ b/interface/web/dns/form/dns_a.tform.php
@@ -133,7 +133,7 @@ $form["tabs"]['dns'] = array (
 					'range' => '60:',
 					'errmsg'=> 'ttl_range_error'),
 			),
-			'default' => '86400',
+			'default' => '3600',
 			'value'  => '',
 			'width'  => '10',
 			'maxlength' => '10'
diff --git a/interface/web/dns/form/dns_aaaa.tform.php b/interface/web/dns/form/dns_aaaa.tform.php
index 47bbac39c2911c957e254e44080d7744aa813432..d381d518795728e5918aa6c93a0d7bbceedaf459 100644
--- a/interface/web/dns/form/dns_aaaa.tform.php
+++ b/interface/web/dns/form/dns_aaaa.tform.php
@@ -126,7 +126,7 @@ $form["tabs"]['dns'] = array (
 					'range' => '60:',
 					'errmsg'=> 'ttl_range_error'),
 			),
-			'default' => '86400',
+			'default' => '3600',
 			'value'  => '',
 			'width'  => '10',
 			'maxlength' => '10'
diff --git a/interface/web/dns/form/dns_alias.tform.php b/interface/web/dns/form/dns_alias.tform.php
index 663bf84278e83b1de1df7e04a716711de2960283..defcda08532e74039423b745b743d41d83642819 100644
--- a/interface/web/dns/form/dns_alias.tform.php
+++ b/interface/web/dns/form/dns_alias.tform.php
@@ -142,7 +142,7 @@ $form["tabs"]['dns'] = array (
 					'range' => '60:',
 					'errmsg'=> 'ttl_range_error'),
 			),
-			'default' => '86400',
+			'default' => '3600',
 			'value'  => '',
 			'width'  => '10',
 			'maxlength' => '10'
diff --git a/interface/web/dns/form/dns_cname.tform.php b/interface/web/dns/form/dns_cname.tform.php
index 957e6e19e5256a470a4751b8c4c0e89a89d5d9c1..5fdf8c9b4ea00fe3718e471240ca48ae687828cb 100644
--- a/interface/web/dns/form/dns_cname.tform.php
+++ b/interface/web/dns/form/dns_cname.tform.php
@@ -140,7 +140,7 @@ $form["tabs"]['dns'] = array (
 					'range' => '60:',
 					'errmsg'=> 'ttl_range_error'),
 			),
-			'default' => '86400',
+			'default' => '3600',
 			'value'  => '',
 			'width'  => '10',
 			'maxlength' => '10'
diff --git a/interface/web/dns/form/dns_dkim.tform.php b/interface/web/dns/form/dns_dkim.tform.php
index bbc1214f2280768a0d21288689d10d125ee60097..550255da4639827709946ecb2416c99cd9cf519e 100644
--- a/interface/web/dns/form/dns_dkim.tform.php
+++ b/interface/web/dns/form/dns_dkim.tform.php
@@ -120,7 +120,7 @@ $form["tabs"]['dns'] = array (
 							'range' => '60:',
 							'errmsg'=> 'ttl_range_error'),
 			),
-			'default' => '86400',
+			'default' => '3600',
 			'value'  => '',
 			'width'  => '10',
 			'maxlength' => '10'
diff --git a/interface/web/dns/form/dns_hinfo.tform.php b/interface/web/dns/form/dns_hinfo.tform.php
index 231bdfc65a6a5fac8dc8ee187dbb44f31c239abf..76c8c79dc0f66cac2787aaeaaf977c134aadf35f 100644
--- a/interface/web/dns/form/dns_hinfo.tform.php
+++ b/interface/web/dns/form/dns_hinfo.tform.php
@@ -132,7 +132,7 @@ $form["tabs"]['dns'] = array (
 					'range' => '60:',
 					'errmsg'=> 'ttl_range_error'),
 			),
-			'default' => '86400',
+			'default' => '3600',
 			'value'  => '',
 			'width'  => '10',
 			'maxlength' => '10'
diff --git a/interface/web/dns/form/dns_mx.tform.php b/interface/web/dns/form/dns_mx.tform.php
index d5faeebcfa011c685ba75c676942c77199463d40..9aace37ae7858a9b2197e320c70a00182578e45a 100644
--- a/interface/web/dns/form/dns_mx.tform.php
+++ b/interface/web/dns/form/dns_mx.tform.php
@@ -141,7 +141,7 @@ $form["tabs"]['dns'] = array (
 					'range' => '60:',
 					'errmsg'=> 'ttl_range_error'),
 			),
-			'default' => '86400',
+			'default' => '3600',
 			'value'  => '',
 			'width'  => '10',
 			'maxlength' => '10'
diff --git a/interface/web/dns/form/dns_ns.tform.php b/interface/web/dns/form/dns_ns.tform.php
index 82b30901fdbfb8244699796cdf6fd903203991dd..063a896de3719f8c9bd6da4543383dcfa5720f88 100644
--- a/interface/web/dns/form/dns_ns.tform.php
+++ b/interface/web/dns/form/dns_ns.tform.php
@@ -140,7 +140,7 @@ $form["tabs"]['dns'] = array (
 					'range' => '60:',
 					'errmsg'=> 'ttl_range_error'),
 			),
-			'default' => '86400',
+			'default' => '3600',
 			'value'  => '',
 			'width'  => '10',
 			'maxlength' => '10'
diff --git a/interface/web/dns/form/dns_ptr.tform.php b/interface/web/dns/form/dns_ptr.tform.php
index 59a91e7c8fff26e98579ffc40f719491242de453..4cc0462522e0fc4e42aff1f28afbe2f830b694c4 100644
--- a/interface/web/dns/form/dns_ptr.tform.php
+++ b/interface/web/dns/form/dns_ptr.tform.php
@@ -140,7 +140,7 @@ $form["tabs"]['dns'] = array (
 					'range' => '60:',
 					'errmsg'=> 'ttl_range_error'),
 			),
-			'default' => '86400',
+			'default' => '3600',
 			'value'  => '',
 			'width'  => '10',
 			'maxlength' => '10'
diff --git a/interface/web/dns/form/dns_rp.tform.php b/interface/web/dns/form/dns_rp.tform.php
index 35b8e55ad149e97e0fd83fc4e549a4df9d89c655..5f4610a45bb397a247078ad08404c3e7319233c9 100644
--- a/interface/web/dns/form/dns_rp.tform.php
+++ b/interface/web/dns/form/dns_rp.tform.php
@@ -133,7 +133,7 @@ $form["tabs"]['dns'] = array (
 					'range' => '60:',
 					'errmsg'=> 'ttl_range_error'),
 			),
-			'default' => '86400',
+			'default' => '3600',
 			'value'  => '',
 			'width'  => '10',
 			'maxlength' => '10'
diff --git a/interface/web/dns/form/dns_soa.tform.php b/interface/web/dns/form/dns_soa.tform.php
index 1e4f9a63e1b047c9950b3b3345a8527059b717c4..02afa86c53d28af488c8c49bcc8e8a7fbbd67ccd 100644
--- a/interface/web/dns/form/dns_soa.tform.php
+++ b/interface/web/dns/form/dns_soa.tform.php
@@ -197,7 +197,7 @@ $form["tabs"]['dns_soa'] = array (
 					'range' => '60:',
 					'errmsg'=> 'minimum_range_error'),
 			),
-			'default' => '86400',
+			'default' => '3600',
 			'value'  => '',
 			'width'  => '10',
 			'maxlength' => '10'
diff --git a/interface/web/dns/form/dns_spf.tform.php b/interface/web/dns/form/dns_spf.tform.php
index 00ccb7628c70d3722a03d46a93b0db3da1fdbe58..ea2cf8310c8310477cb98365d9a29ed8c3dc259a 100644
--- a/interface/web/dns/form/dns_spf.tform.php
+++ b/interface/web/dns/form/dns_spf.tform.php
@@ -127,7 +127,7 @@ $form["tabs"]['dns'] = array (
 					'range' => '60:',
 					'errmsg'=> 'ttl_range_error'),
 			),
-			'default' => '86400',
+			'default' => '3600',
 			'value'  => '',
 			'width'  => '10',
 			'maxlength' => '10'
diff --git a/interface/web/dns/form/dns_srv.tform.php b/interface/web/dns/form/dns_srv.tform.php
index 2f35fd53dda6ff14472edcb43f1b8c2831f7d436..ee0674fd1931318ab95e1809e20075eab3e10150 100644
--- a/interface/web/dns/form/dns_srv.tform.php
+++ b/interface/web/dns/form/dns_srv.tform.php
@@ -131,7 +131,7 @@ $form["tabs"]['dns'] = array (
 					'range' => '60:',
 					'errmsg'=> 'ttl_range_error'),
 			),
-			'default' => '86400',
+			'default' => '3600',
 			'value'  => '',
 			'width'  => '10',
 			'maxlength' => '10'
diff --git a/interface/web/dns/form/dns_txt.tform.php b/interface/web/dns/form/dns_txt.tform.php
index 70e0fc5f0d0108d7d935c98a7a7bbb3f1f6d0e35..01b731a2e4201e86920393d5eb6a98e79ff762fc 100644
--- a/interface/web/dns/form/dns_txt.tform.php
+++ b/interface/web/dns/form/dns_txt.tform.php
@@ -137,7 +137,7 @@ $form["tabs"]['dns'] = array (
 					'range' => '60:',
 					'errmsg'=> 'ttl_range_error'),
 			),
-			'default' => '86400',
+			'default' => '3600',
 			'value'  => '',
 			'width'  => '10',
 			'maxlength' => '10'
diff --git a/interface/web/dns/list/dns_a.list.php b/interface/web/dns/list/dns_a.list.php
index 3b47cf10c279b729b7bae3018a41fdf4f335d400..65429dfa7b6ae72f9320005a0ca696edd0fafe5c 100644
--- a/interface/web/dns/list/dns_a.list.php
+++ b/interface/web/dns/list/dns_a.list.php
@@ -132,7 +132,7 @@ $liste["item"][] = array( 'field'  => "type",
 	'prefix' => "",
 	'suffix' => "",
 	'width'  => "",
-	'value'  => array('A'=>'A', 'AAAA' => 'AAAA', 'ALIAS'=>'ALIAS', 'CNAME'=>'CNAME', 'HINFO'=>'HINFO', 'MX'=>'MX', 'NS'=>'NS', 'PTR'=>'PTR', 'RP'=>'RP', 'SRV'=>'SRV', 'TXT'=>'TXT'));
+	'value'  => array('A'=>'A', 'AAAA' => 'AAAA', 'ALIAS'=>'ALIAS', 'CNAME'=>'CNAME', 'HINFO'=>'HINFO', 'MX'=>'MX', 'NS'=>'NS', 'PTR'=>'PTR', 'RP'=>'RP', 'SPF'=>'SPF', 'SRV'=>'SRV', 'TXT'=>'TXT'));
 
 
 ?>
diff --git a/interface/web/mail/templates/mail_domain_edit.htm b/interface/web/mail/templates/mail_domain_edit.htm
index f56c27d8787883b8f34ba5e69be85949fde8f51c..307b0d1531f258a0db7d79e44a25170ff374ebd7 100644
--- a/interface/web/mail/templates/mail_domain_edit.htm
+++ b/interface/web/mail/templates/mail_domain_edit.htm
@@ -86,7 +86,7 @@
 			<tmpl_else>
 				<input type="hidden" name="domain_module" value="0" id="domain_module" />
 			</tmpl_if>
-            <div class="col-sm-3"></div><div class="col-sm-9"><button class="btn btn-default formbutton-default" type="button" data-toggle="collapse" data-target="#toggle-dkim" aria-expanded="false" aria-controls="toggle-dkim">{tmpl_var name='dkim_settings_txt'}</button></div>
+            <div class="col-sm-12"><button class="btn btn-default formbutton-default" type="button" data-toggle="collapse" data-target="#toggle-dkim" aria-expanded="false" aria-controls="toggle-dkim">{tmpl_var name='dkim_settings_txt'}</button></div>
             <div id="toggle-dkim" class="collapse">
               <div class="form-group">
                 <label class="col-sm-3 control-label">{tmpl_var name='dkim_txt'}</label>
diff --git a/interface/web/tools/dns_import_tupa.php b/interface/web/tools/dns_import_tupa.php
index b45a11b605d4f29f837e952b809cceaf722fa72c..b81a83bdec6277f32bcf5842312a49842fea5ac3 100644
--- a/interface/web/tools/dns_import_tupa.php
+++ b/interface/web/tools/dns_import_tupa.php
@@ -96,7 +96,7 @@ if(isset($_POST['start']) && $_POST['start'] == 1) {
 					$refresh = 7200;
 					$retry =  540;
 					$expire = 604800;
-					$minimum = 86400;
+					$minimum = 3600;
 					$ttl = $soa['ttl'];
 
 					$insert_data = array(
diff --git a/remoting_client/examples/dns_a_add.php b/remoting_client/examples/dns_a_add.php
index 6bcb33c6680ad55f82e38582a501495242f196d5..b669daaa1c745ff4cd3917141b8d3bb179e15d73 100644
--- a/remoting_client/examples/dns_a_add.php
+++ b/remoting_client/examples/dns_a_add.php
@@ -23,7 +23,7 @@ try {
 		'type' => 'a',
 		'data' => '192.168.1.88',
 		'aux' => '0',
-		'ttl' => '86400',
+		'ttl' => '3600',
 		'active' => 'y',
 		'stamp' => 'CURRENT_TIMESTAMP',
 		'serial' => '1',
diff --git a/remoting_client/examples/dns_aaaa_add.php b/remoting_client/examples/dns_aaaa_add.php
index 4ee460b5be90a5f9a04653d600519e7bf8d53ee9..eff4148f2881785206439fcda3a98b8ddb406648 100644
--- a/remoting_client/examples/dns_aaaa_add.php
+++ b/remoting_client/examples/dns_aaaa_add.php
@@ -23,7 +23,7 @@ try {
 		'type' => 'aaaa',
 		'data' => '3ffe:b00:c18:3::a',
 		'aux' => '0',
-		'ttl' => '86400',
+		'ttl' => '3600',
 		'active' => 'y',
 		'stamp' => 'CURRENT_TIMESTAMP',
 		'serial' => '1',
diff --git a/remoting_client/examples/dns_alias_add.php b/remoting_client/examples/dns_alias_add.php
index 5b1c684cef0743704581e52d58c8b370388e3284..dd8a4da4b0b6349e203b5ff89c5524fca74e2a39 100644
--- a/remoting_client/examples/dns_alias_add.php
+++ b/remoting_client/examples/dns_alias_add.php
@@ -23,7 +23,7 @@ try {
 		'type' => 'alias',
 		'data' => 'hostmachine',
 		'aux' => '0',
-		'ttl' => '86400',
+		'ttl' => '3600',
 		'active' => 'y',
 		'stamp' => 'CURRENT_TIMESTAMP',
 		'serial' => '1',
diff --git a/remoting_client/examples/dns_cname_add.php b/remoting_client/examples/dns_cname_add.php
index 2d70ca65b4a40c3dcd732ba585ca7867ea752350..7731a5473035106e2939416bf064f9996c07eccf 100644
--- a/remoting_client/examples/dns_cname_add.php
+++ b/remoting_client/examples/dns_cname_add.php
@@ -23,7 +23,7 @@ try {
 		'type' => 'cname',
 		'data' => 'hostmachine',
 		'aux' => '0',
-		'ttl' => '86400',
+		'ttl' => '3600',
 		'active' => 'y',
 		'stamp' => 'CURRENT_TIMESTAMP',
 		'serial' => '1',
diff --git a/remoting_client/examples/dns_hinfo_add.php b/remoting_client/examples/dns_hinfo_add.php
index a0a8c47b3c1f90035974ad3c204ac3554a65cc82..106c79083e8014eae72ed765ffb064541defd3b6 100644
--- a/remoting_client/examples/dns_hinfo_add.php
+++ b/remoting_client/examples/dns_hinfo_add.php
@@ -23,7 +23,7 @@ try {
 		'type' => 'hinfo',
 		'data' => '"Pentium Pro" Linux',
 		'aux' => '0',
-		'ttl' => '86400',
+		'ttl' => '3600',
 		'active' => 'y',
 		'stamp' => 'CURRENT_TIMESTAMP',
 		'serial' => '1',
diff --git a/remoting_client/examples/dns_mx_add.php b/remoting_client/examples/dns_mx_add.php
index b1e961780973cd069393091c4fd34114262e6de5..d0838216cde06cdec84bb792d5c6151ce7d40142 100644
--- a/remoting_client/examples/dns_mx_add.php
+++ b/remoting_client/examples/dns_mx_add.php
@@ -23,7 +23,7 @@ try {
 		'type' => 'mx',
 		'data' => 'mail',
 		'aux' => '0',
-		'ttl' => '86400',
+		'ttl' => '3600',
 		'active' => 'y',
 		'stamp' => 'CURRENT_TIMESTAMP',
 		'serial' => '1',
diff --git a/remoting_client/examples/dns_ns_add.php b/remoting_client/examples/dns_ns_add.php
index d650d2a99990e1b49ce440e7d7c6ec8cf6edd7fe..381041addf3099d1264afeb7ac075f774d329ba9 100644
--- a/remoting_client/examples/dns_ns_add.php
+++ b/remoting_client/examples/dns_ns_add.php
@@ -23,7 +23,7 @@ try {
 		'type' => 'ns',
 		'data' => 'ns1',
 		'aux' => '0',
-		'ttl' => '86400',
+		'ttl' => '3600',
 		'active' => 'y',
 		'stamp' => 'CURRENT_TIMESTAMP',
 		'serial' => '1',
diff --git a/remoting_client/examples/dns_ptr_add.php b/remoting_client/examples/dns_ptr_add.php
index 6d4ccab9faeaa3b7d26a684cf7a9f97cfa92ba8a..a2dbdf54f58da90198f324c8a7f50f43b7dbe8ba 100644
--- a/remoting_client/examples/dns_ptr_add.php
+++ b/remoting_client/examples/dns_ptr_add.php
@@ -23,7 +23,7 @@ try {
 		'type' => 'ptr',
 		'data' => 'webmaster.test.int.',
 		'aux' => '0',
-		'ttl' => '86400',
+		'ttl' => '3600',
 		'active' => 'y',
 		'stamp' => 'CURRENT_TIMESTAMP',
 		'serial' => '1',
diff --git a/remoting_client/examples/dns_rp_add.php b/remoting_client/examples/dns_rp_add.php
index a30b70370137c66294b2e77d0db123b69cc82850..27329bbe75aa8dd91f95192618d999a1229487b8 100644
--- a/remoting_client/examples/dns_rp_add.php
+++ b/remoting_client/examples/dns_rp_add.php
@@ -23,7 +23,7 @@ try {
 		'type' => 'rp',
 		'data' => 'webmaster.test.int. contactinfo.test.int',
 		'aux' => '0',
-		'ttl' => '86400',
+		'ttl' => '3600',
 		'active' => 'y',
 		'stamp' => 'CURRENT_TIMESTAMP',
 		'serial' => '1',
diff --git a/remoting_client/examples/dns_srv_add.php b/remoting_client/examples/dns_srv_add.php
index 75c7df4817f092f56c1a6d2af1bf2522d41190b7..6270db75a45f3b6c77f7e17b7455e417a22c631c 100644
--- a/remoting_client/examples/dns_srv_add.php
+++ b/remoting_client/examples/dns_srv_add.php
@@ -23,7 +23,7 @@ try {
 		'type' => 'srv',
 		'data' => '0 9 server.test.int.',
 		'aux' => '0',
-		'ttl' => '86400',
+		'ttl' => '3600',
 		'active' => 'y',
 		'stamp' => 'CURRENT_TIMESTAMP',
 		'serial' => '1',
diff --git a/remoting_client/examples/dns_txt_add.php b/remoting_client/examples/dns_txt_add.php
index 4ce025e64fcd7247bc60c51af131c366e2231bc7..90f06095ecbd770b130e5914c274c94c662d4af9 100644
--- a/remoting_client/examples/dns_txt_add.php
+++ b/remoting_client/examples/dns_txt_add.php
@@ -23,7 +23,7 @@ try {
 		'type' => 'txt',
 		'data' => 'any text can go here',
 		'aux' => '0',
-		'ttl' => '86400',
+		'ttl' => '3600',
 		'active' => 'y',
 		'stamp' => 'CURRENT_TIMESTAMP',
 		'serial' => '1',
diff --git a/remoting_client/examples/dns_zone_add.php b/remoting_client/examples/dns_zone_add.php
index 677240968266fe66f7869f09204da45f9f20bb4d..62937c0bd3c4db126e4607dbc56e7fb144217564 100644
--- a/remoting_client/examples/dns_zone_add.php
+++ b/remoting_client/examples/dns_zone_add.php
@@ -25,8 +25,8 @@ try {
 		'refresh' => '28800',
 		'retry' => '7200',
 		'expire' => '604800',
-		'minimum' => '86400',
-		'ttl' => '86400',
+		'minimum' => '3600',
+		'ttl' => '3600',
 		'active' => 'y',
 		'xfer' => '',
 		'also_notify' => '',
diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index 1676a1a7a89578b8b5bf886882415984474e13a2..43b06f3dc5f2cdd9af53838de7651e5493c01930 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/server/plugins-available/apache2_plugin.inc.php
@@ -161,6 +161,26 @@ class apache2_plugin {
 			if($master_php_ini_path != '' && substr($master_php_ini_path, -7) == 'php.ini' && is_file($master_php_ini_path)) {
 				$php_ini_content .= $app->system->file_get_contents($master_php_ini_path)."\n";
 			}
+			
+			if(intval($web_data['directive_snippets_id']) > 0){
+				$snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'nginx' AND active = 'y' AND customer_viewable = 'y'", intval($web_data['directive_snippets_id']));
+				if(isset($snippet['required_php_snippets']) && trim($snippet['required_php_snippets']) != ''){
+					$required_php_snippets = explode(',', trim($snippet['required_php_snippets']));
+					if(is_array($required_php_snippets) && !empty($required_php_snippets)){
+						foreach($required_php_snippets as $required_php_snippet){
+							$required_php_snippet = intval($required_php_snippet);
+							if($required_php_snippet > 0){
+								$php_snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'php' AND active = 'y'", $required_php_snippet);
+								$php_snippet['snippet'] = trim($php_snippet['snippet']);
+								if($php_snippet['snippet'] != ''){
+									$web_data['custom_php_ini'] .= "\n".$php_snippet['snippet'];
+								}
+							}
+						}
+					}
+				}
+			}
+		
 			$php_ini_content .= str_replace("\r", '', trim($web_data['custom_php_ini']));
 			$app->system->file_put_contents($custom_php_ini_dir.'/php.ini', $php_ini_content);
 			$app->log('Info: rewrote custom php.ini for web ' . $web_data['domain_id'] . ' (' . $web_data['domain'] . ').', LOGLEVEL_DEBUG);
@@ -1008,6 +1028,26 @@ class apache2_plugin {
 				$php_ini_content .= $app->system->file_get_contents($master_php_ini_path)."\n";
 			}
 			$php_ini_content .= str_replace("\r", '', trim($data['new']['custom_php_ini']));
+			
+			if(intval($data['new']['directive_snippets_id']) > 0){
+				$snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'nginx' AND active = 'y' AND customer_viewable = 'y'", intval($data['new']['directive_snippets_id']));
+				if(isset($snippet['required_php_snippets']) && trim($snippet['required_php_snippets']) != ''){
+					$required_php_snippets = explode(',', trim($snippet['required_php_snippets']));
+					if(is_array($required_php_snippets) && !empty($required_php_snippets)){
+						foreach($required_php_snippets as $required_php_snippet){
+							$required_php_snippet = intval($required_php_snippet);
+							if($required_php_snippet > 0){
+								$php_snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'php' AND active = 'y'", $required_php_snippet);
+								$php_snippet['snippet'] = trim($php_snippet['snippet']);
+								if($php_snippet['snippet'] != ''){
+									$php_ini_content .= "\n".$php_snippet['snippet'];
+								}
+							}
+						}
+					}
+				}
+			}
+		
 			$app->system->file_put_contents($custom_php_ini_dir.'/php.ini', $php_ini_content);
 		} else {
 			$has_custom_php_ini = false;
@@ -2864,6 +2904,26 @@ class apache2_plugin {
 		// Custom php.ini settings
 		$final_php_ini_settings = array();
 		$custom_php_ini_settings = trim($data['new']['custom_php_ini']);
+		
+		if(intval($data['new']['directive_snippets_id']) > 0){
+			$snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'apache' AND active = 'y' AND customer_viewable = 'y'", intval($data['new']['directive_snippets_id']));
+			if(isset($snippet['required_php_snippets']) && trim($snippet['required_php_snippets']) != ''){
+				$required_php_snippets = explode(',', trim($snippet['required_php_snippets']));
+				if(is_array($required_php_snippets) && !empty($required_php_snippets)){
+					foreach($required_php_snippets as $required_php_snippet){
+						$required_php_snippet = intval($required_php_snippet);
+						if($required_php_snippet > 0){
+							$php_snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'php' AND active = 'y'", $required_php_snippet);
+							$php_snippet['snippet'] = trim($php_snippet['snippet']);
+							if($php_snippet['snippet'] != ''){
+								$custom_php_ini_settings .= "\n".$php_snippet['snippet'];
+							}
+						}
+					}
+				}
+			}
+		}
+		
 		if($custom_php_ini_settings != ''){
 			// Make sure we only have Unix linebreaks
 			$custom_php_ini_settings = str_replace("\r\n", "\n", $custom_php_ini_settings);
diff --git a/server/plugins-available/bind_dlz_plugin.inc.php b/server/plugins-available/bind_dlz_plugin.inc.php
index fa839fe04ae6b8e98339d329c784ab347ff29adf..89954ccabb2a5b210d5514e53e22da8d51b59b3c 100644
--- a/server/plugins-available/bind_dlz_plugin.inc.php
+++ b/server/plugins-available/bind_dlz_plugin.inc.php
@@ -34,7 +34,7 @@ TABLE STRUCTURE of the "named" database:
 CREATE TABLE IF NOT EXISTS `records` (
   `id` int(10) unsigned NOT NULL auto_increment,
   `zone` varchar(255) NOT NULL,
-  `ttl` int(11) NOT NULL default '86400',
+  `ttl` int(11) NOT NULL default '3600',
   `type` varchar(255) NOT NULL,
   `host` varchar(255) NOT NULL default '@',
   `mx_priority` int(11) default NULL,
diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php
index de6a7a451ccfd9f53dabf6a3ca35a9c0c4ecb8dd..4ff3c8c48e8156711e0f6e241e4ec91e9d8a5d97 100644
--- a/server/plugins-available/nginx_plugin.inc.php
+++ b/server/plugins-available/nginx_plugin.inc.php
@@ -2461,6 +2461,26 @@ class nginx_plugin {
 		// Custom php.ini settings
 		$final_php_ini_settings = array();
 		$custom_php_ini_settings = trim($data['new']['custom_php_ini']);
+		
+		if(intval($data['new']['directive_snippets_id']) > 0){
+			$snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'nginx' AND active = 'y' AND customer_viewable = 'y'", intval($data['new']['directive_snippets_id']));
+			if(isset($snippet['required_php_snippets']) && trim($snippet['required_php_snippets']) != ''){
+				$required_php_snippets = explode(',', trim($snippet['required_php_snippets']));
+				if(is_array($required_php_snippets) && !empty($required_php_snippets)){
+					foreach($required_php_snippets as $required_php_snippet){
+						$required_php_snippet = intval($required_php_snippet);
+						if($required_php_snippet > 0){
+							$php_snippet = $app->db->queryOneRecord("SELECT * FROM directive_snippets WHERE directive_snippets_id = ? AND type = 'php' AND active = 'y'", $required_php_snippet);
+							$php_snippet['snippet'] = trim($php_snippet['snippet']);
+							if($php_snippet['snippet'] != ''){
+								$custom_php_ini_settings .= "\n".$php_snippet['snippet'];
+							}
+						}
+					}
+				}
+			}
+		}
+		
 		if($custom_php_ini_settings != ''){
 			// Make sure we only have Unix linebreaks
 			$custom_php_ini_settings = str_replace("\r\n", "\n", $custom_php_ini_settings);