Skip to content
Snippets Groups Projects
Commit b974f84e authored by Marius Burkard's avatar Marius Burkard
Browse files

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

parent 906679dd
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment