Commit fa1371ef authored by Till Brehm's avatar Till Brehm

Merge branch '4984-fix' into 'stable-3.1'

Resolve "Very slow MySQL Queries in mail_[user|forward|alias]_edit.php"

See merge request !757
parents 60281918 b6b5e698
......@@ -76,7 +76,7 @@ class page_action extends tform_actions {
// Getting Domains of the user
// $sql = "SELECT domain FROM mail_domain WHERE ".$app->tform->getAuthSQL('r').' ORDER BY domain';
$sql = "SELECT domain FROM mail_domain WHERE domain NOT IN (SELECT SUBSTR(source,2) FROM mail_forwarding WHERE type = 'aliasdomain') AND ".$app->tform->getAuthSQL('r')." ORDER BY domain";
$sql = "SELECT domain FROM mail_domain WHERE (".$app->tform->getAuthSQL('r').") AND domain NOT IN (SELECT SUBSTR(source,2) FROM mail_forwarding WHERE type = 'aliasdomain') ORDER BY domain";
$domains = $app->db->queryAllRecords($sql);
$domain_select = '';
if(is_array($domains)) {
......
......@@ -76,7 +76,7 @@ class page_action extends tform_actions {
// Getting Domains of the user
//$sql = "SELECT domain FROM mail_domain WHERE ".$app->tform->getAuthSQL('r').' ORDER BY domain';
$sql = "SELECT domain FROM mail_domain WHERE domain NOT IN (SELECT SUBSTR(source,2) FROM mail_forwarding WHERE type = 'aliasdomain') AND ".$app->tform->getAuthSQL('r')." ORDER BY domain";
$sql = "SELECT domain FROM mail_domain WHERE (".$app->tform->getAuthSQL('r').") AND domain NOT IN (SELECT SUBSTR(source,2) FROM mail_forwarding WHERE type = 'aliasdomain') ORDER BY domain";
$domains = $app->db->queryAllRecords($sql);
$domain_select = '';
foreach( $domains as $domain) {
......
......@@ -77,7 +77,7 @@ class page_action extends tform_actions {
// Getting Domains of the user
// $sql = "SELECT domain, server_id FROM mail_domain WHERE ".$app->tform->getAuthSQL('r').' ORDER BY domain';
$sql = "SELECT domain, server_id FROM mail_domain WHERE domain NOT IN (SELECT SUBSTR(source,2) FROM mail_forwarding WHERE type = 'aliasdomain') AND ".$app->tform->getAuthSQL('r')." ORDER BY domain";
$sql = "SELECT domain, server_id FROM mail_domain WHERE (".$app->tform->getAuthSQL('r').") AND domain NOT IN (SELECT SUBSTR(source,2) FROM mail_forwarding WHERE type = 'aliasdomain') ORDER BY domain";
$domains = $app->db->queryAllRecords($sql);
$domain_select = '';
if(is_array($domains)) {
......
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