Commit e69a5b3f authored by Till Brehm's avatar Till Brehm

Merge branch 'stable-3.1' into 'stable-3.1'

Stable 3.1

See merge request !950
parents b1657076 b450032f
Pipeline #2771 passed with stage
in 6 minutes and 26 seconds
......@@ -2478,24 +2478,13 @@ class installer_base {
//* copy the ISPConfig security part
$command = 'cp -rf ../security '.$install_dir;
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
//* Apply changed security_settings.ini values to new security_settings.ini file
if(is_file('/usr/local/ispconfig/security/security_settings.ini~')) {
$security_settings_old = ini_to_array(file_get_contents('/usr/local/ispconfig/security/security_settings.ini~'));
$security_settings_new = ini_to_array(file_get_contents('/usr/local/ispconfig/security/security_settings.ini'));
if(is_array($security_settings_new) && is_array($security_settings_old)) {
foreach($security_settings_new as $section => $sval) {
if(is_array($sval)) {
foreach($sval as $key => $val) {
if(isset($security_settings_old[$section]) && isset($security_settings_old[$section][$key])) {
$security_settings_new[$section][$key] = $security_settings_old[$section][$key];
}
}
}
}
file_put_contents('/usr/local/ispconfig/security/security_settings.ini',array_to_ini($security_settings_new));
}
$configfile = 'security_settings.ini';
if(is_file($install_dir.'/security/'.$configfile)) {
copy($install_dir.'/security/'.$configfile, $install_dir.'/security/'.$configfile.'~');
}
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master');
wf($install_dir.'/security/'.$configfile, $content);
//* Create a symlink, so ISPConfig is accessible via web
// Replaced by a separate vhost definition for port 8080
......
......@@ -189,6 +189,7 @@ class listform_actions {
//* substitute value for select fields
if(is_array($app->listform->listDef['item']) && count($app->listform->listDef['item']) > 0) {
foreach($app->listform->listDef['item'] as $field) {
if($rec['active'] == 'n') $rec['warn_inactive'] = 'y';
$key = $field['field'];
if(isset($field['formtype']) && $field['formtype'] == 'SELECT') {
if(strtolower($rec[$key]) == 'y' or strtolower($rec[$key]) == 'n') {
......
......@@ -14,4 +14,6 @@ $wb['php_fpm_init_script_txt'] = 'Pfad zum PHP-FPM Init Script';
$wb['php_fpm_ini_dir_txt'] = 'Pfad zum php.ini Verzeichnis';
$wb['php_fpm_pool_dir_txt'] = 'Pfad zum PHP-FPM Pool Verzeichnis';
$wb['active_txt'] = 'Aktiv';
$wb['php_in_use_error'] = 'Diese PHP-Version wird noch benutzt.';
$wb['php_name_in_use_error'] = 'Der Name kann nicht geändert werden.';
?>
......@@ -14,4 +14,6 @@ $wb['php_fpm_init_script_txt'] = 'Path to the PHP-FPM init script';
$wb['php_fpm_ini_dir_txt'] = 'Path to the php.ini directory';
$wb['php_fpm_pool_dir_txt'] = 'Path to the PHP-FPM pool directory';
$wb['active_txt'] = 'Active';
$wb['php_in_use_error'] = 'This PHP-Version is in use.';
$wb['php_name_in_use_error'] = 'The name can not be changed.';
?>
......@@ -46,7 +46,39 @@ require_once '../../lib/app.inc.php';
$app->auth->check_module_permissions('admin');
$app->auth->check_security_permissions('admin_allow_server_php');
$app->uses("tform_actions");
$app->tform_actions->onDelete();
$app->uses('tpl,tform,tform_actions');
$app->load('tform_actions');
class page_action extends tform_actions {
function onBeforeDelete() {
global $app; $conf;
$check = array();
// fastcgi
if(!empty(trim($this->dataRecord['php_fastcgi_binary']))) $check[] = trim($this->dataRecord['php_fastcgi_binary']);
if(!empty(trim($this->dataRecord['php_fastcgi_ini_dir']))) $check[] = trim($this->dataRecord['php_fastcgi_ini_dir']);
if(!empty($check)) $fastcgi_check = implode(':', $check);
unset($check);
// fpm
if(!empty(trim($this->dataRecord['php_fpm_init_script']))) $check[] = trim($this->dataRecord['php_fpm_init_script']);
if(!empty(trim($this->dataRecord['php_fpm_ini_dir']))) $check[] = trim($this->dataRecord['php_fpm_ini_dir']);
if(!empty(trim($this->dataRecord['php_fpm_pool_dir']))) $check[] = trim($this->dataRecord['php_fpm_pool_dir']);
if(!empty($check)) $fpm_check = implode(':', $check);
$sql = 'SELECT domain_id FROM web_domain WHERE server_id = ? AND fastcgi_php_version LIKE ?';
if(isset($fastcgi_check)) $web_domains_fastcgi = $app->db->queryAllRecords($sql, $this->dataRecord['server_id'], '%:'.$fastcgi_check);
if(isset($fpm_check)) $web_domains_fpm = $app->db->queryAllRecords($sql, $this->dataRecord['server_id'], '%:'.$fpm_check);
if(!empty($webdomains_fastcgi) || !empty($web_domains_fpm)) $app->error($app->tform->lng('php_in_use_error'));
}
}
$page = new page_action;
$page->onDelete();
?>
......@@ -50,7 +50,35 @@ $app->uses('tpl,tform,tform_actions');
$app->load('tform_actions');
class page_action extends tform_actions {
function onSubmit() {
global $app;
if(isset($this->id) && $this->id > 0 && $app->tform->getCurrentTab() == 'php_name') {
$rec = $app->db->queryOneRecord('SELECT * FROM server_php WHERE server_php_id = ?', $this->id);
if($rec['name'] != $this->dataRecord['name']) {
$check = array();
// fastcgi
if($rec['php_fastcgi_binary'] != '') $check[] = $rec['php_fastcgi_binary'];
if($rec['php_fastcgi_ini_dir'] != '') $check[] = $rec['php_fastcgi_ini_dir'];
if(!empty($check)) $fastcgi_check = implode(':', $check);
unset($check);
// fpm
if($rec['php_fpm_init_script'] != '') $check[] = $rec['php_fpm_init_script'];
if($rec['php_fpm_ini_dir'] != '') $check[] = $rec['php_fpm_ini_dir'];
if($rec['php_fpm_pool_dir'] != '') $check[] = $rec['php_fpm_pool_dir'];
if(!empty($check)) $fpm_check = implode(':', $check);
$sql = 'SELECT domain_id FROM web_domain WHERE server_id = ? AND fastcgi_php_version LIKE ?';
if(isset($fastcgi_check)) $web_domains_fastcgi = $app->db->queryAllRecords($sql, $this->dataRecord['server_id'], '%:'.$fastcgi_check);
if(isset($fpm_check)) $web_domains_fpm = $app->db->queryAllRecords($sql, $this->dataRecord['server_id'], '%:'.$fpm_check);
if(!empty($webdomains_fastcgi) || !empty($web_domains_fpm)) $app->error($app->tform->lng('php_in_use_error').' '.$app->tform->lng('php_name_in_use_error'));
}
}
parent::onSubmit();
}
function onBeforeUpdate() {
global $app, $conf;
......
......@@ -37,7 +37,7 @@
</thead>
<tbody>
<tmpl_loop name="records">
<tr>
<tr <tmpl_if name="warn_inactive"> class="danger" </tmpl_if> >
<tmpl_if name="vhostdomain_type" value="domain"><td><a href="#" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='id'}&type={tmpl_var name='vhostdomain_type'}">{tmpl_var name="domain_id"}</a></td></tmpl_if>
<td><a href="#" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='id'}&type={tmpl_var name='vhostdomain_type'}">{tmpl_var name="active"}</a></td>
<tmpl_if name="vhostdomain_type" value="domain"><td><a href="#" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='id'}&type={tmpl_var name='vhostdomain_type'}">{tmpl_var name="sys_groupid"}</a></td></tmpl_if>
......
......@@ -52,7 +52,7 @@
</thead>
<tbody>
<tmpl_loop name="records">
<tr>
<tr <tmpl_if name="warn_inactive"> class="danger" </tmpl_if> >
<tmpl_if name="vhostdomain_type" value="domain"><td><a href="#" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='id'}&type={tmpl_var name='vhostdomain_type'}">{tmpl_var name="domain_id"}</a></td></tmpl_if>
<td><a href="#" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='id'}&type={tmpl_var name='vhostdomain_type'}">{tmpl_var name="active"}</a></td>
<td><a href="#" data-load-content="sites/web_vhost_domain_edit.php?id={tmpl_var name='id'}&type={tmpl_var name='vhostdomain_type'}" data-toggle="tooltip" data-placement="bottom" title="{tmpl_var name='server_id'}">{tmpl_var name="server_id"}</a></td>
......
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