Commit 8bf47f66 authored by Till Brehm's avatar Till Brehm
Browse files

Merge branch '5785-fixes' into 'develop'

fixed server id and type limit on interface (from !1230)

See merge request ispconfig/ispconfig3!1231
parents 906679dd b974f84e
Pipeline #5548 passed with stage
in 9 seconds
......@@ -49,19 +49,19 @@ $app->load("tform_actions");
class page_action extends tform_actions {
function onBeforeDelete() {
global $app, $conf;
global $app;
if($this->dataRecord['type'] === 'php') {
$rlike = $this->dataRecord['directive_snippets_id'].'|,'.$this->dataRecord['directive_snippets_id'].'|'.$this->dataRecord['directive_snippets_id'].',';
$affected_snippets = $app->db->queryAllRecords('SELECT directive_snippets_id FROM directive_snippets WHERE required_php_snippets REGEXP ? AND type = ?', $rlike, 'apache');
$affected_snippets = $app->db->queryAllRecords('SELECT directive_snippets_id FROM directive_snippets WHERE required_php_snippets REGEXP ?', $rlike);
if(is_array($affected_snippets) && !empty($affected_snippets)) {
foreach($affected_snippets as $snippet) {
$sql_in[] = $snippet['directive_snippets_id'];
}
$affected_sites = $app->db->queryAllRecords('SELECT domain_id FROM web_domain WHERE server_id = ? AND directive_snippets_id IN ?', $conf['server_id'], $sql_in);
$affected_sites = $app->db->queryAllRecords('SELECT domain_id FROM web_domain WHERE directive_snippets_id IN ?', $sql_in);
}
} elseif($this->dataRecord['type'] === 'apache' || $this->dataRecord['type'] === 'nginx') {
$affected_sites = $app->db->queryAllRecords('SELECT domain_id FROM web_domain WHERE server_id = ? AND directive_snippets_id = ?', $conf['server_id'], $this->dataRecord['directive_snippets_id']);
$affected_sites = $app->db->queryAllRecords('SELECT domain_id FROM web_domain WHERE directive_snippets_id = ?', $this->dataRecord['directive_snippets_id']);
}
if(!empty($affected_sites)) {
......
......@@ -50,19 +50,19 @@ $app->uses('tpl,tform,tform_actions');
class page_action extends tform_actions {
private function getAffectedSites() {
global $app, $conf;
global $app;
if($this->dataRecord['type'] === 'php') {
$rlike = $this->dataRecord['id'].'|,'.$this->dataRecord['id'].'|'.$this->dataRecord['id'].',';
$affected_snippets = $app->db->queryAllRecords('SELECT directive_snippets_id FROM directive_snippets WHERE required_php_snippets REGEXP ? AND type = ?', $rlike, 'apache');
$affected_snippets = $app->db->queryAllRecords('SELECT directive_snippets_id FROM directive_snippets WHERE required_php_snippets REGEXP ?', $rlike);
if(is_array($affected_snippets) && !empty($affected_snippets)) {
foreach($affected_snippets as $snippet) {
$sql_in[] = $snippet['directive_snippets_id'];
}
$affected_sites = $app->db->queryAllRecords('SELECT domain_id FROM web_domain WHERE server_id = ? AND directive_snippets_id IN ?', $conf['server_id'], $sql_in);
$affected_sites = $app->db->queryAllRecords('SELECT domain_id FROM web_domain WHERE directive_snippets_id IN ?', $sql_in);
}
} elseif($this->dataRecord['type'] === 'apache' || $this->dataRecord['type'] === 'nginx') {
$affected_sites = $app->db->queryAllRecords('SELECT domain_id FROM web_domain WHERE server_id = ? AND directive_snippets_id = ?', $conf['server_id'], $this->dataRecord['id']);
$affected_sites = $app->db->queryAllRecords('SELECT domain_id FROM web_domain WHERE directive_snippets_id = ?', $this->dataRecord['id']);
}
return $affected_sites;
......
Supports Markdown
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