Commit b418037a authored by Marius Cramer's avatar Marius Cramer

- ported some patches

parent a563d594
......@@ -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+bsc4DPkxRpuqkZ1orisoBAiguuhkUhPSvZRBA3u6gsK94g9jDFP9aHcAV3EKNNYX8i3RcNJ4M4nTiROJCYykIzbGZKvouk68vYbyS/cUbz+RrJZpzkO5Sv3eajaJhRDvUwg21nKK4VcF5WKPgFH6PZZw/7dJXC6S6lczunfbI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HwfpQ0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQBnG392D9QU+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
......@@ -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');
-- --------------------------------------------------------
......
......@@ -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']);
}
}
......
......@@ -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
//#################################
......
......@@ -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();
......
......@@ -133,7 +133,7 @@ $form["tabs"]['dns'] = array (
'range' => '60:',
'errmsg'=> 'ttl_range_error'),
),
'default' => '86400',
'default' => '3600',
'value' => '',
'width' => '10',
'maxlength' => '10'
......
......@@ -126,7 +126,7 @@ $form["tabs"]['dns'] = array (
'range' => '60:',
'errmsg'=> 'ttl_range_error'),
),
'default' => '86400',
'default' => '3600',
'value' => '',
'width' => '10',
'maxlength' => '10'
......
......@@ -142,7 +142,7 @@ $form["tabs"]['dns'] = array (
'range' => '60:',
'errmsg'=> 'ttl_range_error'),
),
'default' => '86400',
'default' => '3600',
'value' => '',
'width' => '10',
'maxlength' => '10'
......
......@@ -140,7 +140,7 @@ $form["tabs"]['dns'] = array (
'range' => '60:',
'errmsg'=> 'ttl_range_error'),
),
'default' => '86400',
'default' => '3600',
'value' => '',
'width' => '10',
'maxlength' => '10'
......
......@@ -120,7 +120,7 @@ $form["tabs"]['dns'] = array (
'range' => '60:',
'errmsg'=> 'ttl_range_error'),
),
'default' => '86400',
'default' => '3600',
'value' => '',
'width' => '10',
'maxlength' => '10'
......
......@@ -132,7 +132,7 @@ $form["tabs"]['dns'] = array (
'range' => '60:',
'errmsg'=> 'ttl_range_error'),
),
'default' => '86400',
'default' => '3600',
'value' => '',
'width' => '10',
'maxlength' => '10'
......
......@@ -141,7 +141,7 @@ $form["tabs"]['dns'] = array (
'range' => '60:',
'errmsg'=> 'ttl_range_error'),
),
'default' => '86400',
'default' => '3600',
'value' => '',
'width' => '10',
'maxlength' => '10'
......
......@@ -140,7 +140,7 @@ $form["tabs"]['dns'] = array (
'range' => '60:',
'errmsg'=> 'ttl_range_error'),
),
'default' => '86400',
'default' => '3600',
'value' => '',
'width' => '10',
'maxlength' => '10'
......
......@@ -140,7 +140,7 @@ $form["tabs"]['dns'] = array (
'range' => '60:',
'errmsg'=> 'ttl_range_error'),
),
'default' => '86400',
'default' => '3600',
'value' => '',
'width' => '10',
'maxlength' => '10'
......
......@@ -133,7 +133,7 @@ $form["tabs"]['dns'] = array (
'range' => '60:',
'errmsg'=> 'ttl_range_error'),
),
'default' => '86400',
'default' => '3600',
'value' => '',
'width' => '10',
'maxlength' => '10'
......
......@@ -197,7 +197,7 @@ $form["tabs"]['dns_soa'] = array (
'range' => '60:',
'errmsg'=> 'minimum_range_error'),
),
'default' => '86400',
'default' => '3600',
'value' => '',
'width' => '10',
'maxlength' => '10'
......
......@@ -127,7 +127,7 @@ $form["tabs"]['dns'] = array (
'range' => '60:',
'errmsg'=> 'ttl_range_error'),
),
'default' => '86400',
'default' => '3600',
'value' => '',
'width' => '10',
'maxlength' => '10'
......
......@@ -131,7 +131,7 @@ $form["tabs"]['dns'] = array (
'range' => '60:',
'errmsg'=> 'ttl_range_error'),
),
'default' => '86400',
'default' => '3600',
'value' => '',
'width' => '10',
'maxlength' => '10'
......
......@@ -137,7 +137,7 @@ $form["tabs"]['dns'] = array (
'range' => '60:',
'errmsg'=> 'ttl_range_error'),
),
'default' => '86400',
'default' => '3600',
'value' => '',
'width' => '10',
'maxlength' => '10'
......
......@@ -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'));
?>
......@@ -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>
......
......@@ -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(
......
......@@ -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',
......
......@@ -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',
......
......@@ -23,7 +23,7 @@ try {
'type' => 'alias',
'data' => 'hostmachine',
'aux' => '0',
'ttl' => '86400',
'ttl' => '3600',
'active' => 'y',
'stamp' => 'CURRENT_TIMESTAMP',
'serial' => '1',
......
......@@ -23,7 +23,7 @@ try {
'type' => 'cname',
'data' => 'hostmachine',
'aux' => '0',
'ttl' => '86400',
'ttl' => '3600',
'active' => 'y',
'stamp' => 'CURRENT_TIMESTAMP',
'serial' => '1',
......
......@@ -23,7 +23,7 @@ try {
'type' => 'hinfo',
'data' => '"Pentium Pro" Linux',
'aux' => '0',
'ttl' => '86400',
'ttl' => '3600',
'active' => 'y',
'stamp' => 'CURRENT_TIMESTAMP',
'serial' => '1',
......
......@@ -23,7 +23,7 @@ try {
'type' => 'mx',
'data' => 'mail',
'aux' => '0',
'ttl' => '86400',
'ttl' => '3600',
'active' => 'y',
'stamp' => 'CURRENT_TIMESTAMP',
'serial' => '1',
......
......@@ -23,7 +23,7 @@ try {
'type' => 'ns',
'data' => 'ns1',
'aux' => '0',
'ttl' => '86400',
'ttl' => '3600',
'active' => 'y',
'stamp' => 'CURRENT_TIMESTAMP',
'serial' => '1',
......
......@@ -23,7 +23,7 @@ try {
'type' => 'ptr',
'data' => 'webmaster.test.int.',
'aux' => '0',
'ttl' => '86400',
'ttl' => '3600',
'active' => 'y',
'stamp' => 'CURRENT_TIMESTAMP',
'serial' => '1',
......
......@@ -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',
......
......@@ -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',
......
......@@ -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',
......
......@@ -25,8 +25,8 @@ try {
'refresh' => '28800',
'retry' => '7200',
'expire' => '604800',
'minimum' => '86400',
'ttl' => '86400',
'minimum' => '3600',
'ttl' => '3600',
'active' => 'y',
'xfer' => '',
'also_notify' => '',
......
......@@ -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);
......
......@@ -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,
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment