Fixed duplicate creation of directory protection, fixes #1450

Signed-off-by: Roman Schmerold (BNoiZe) <bnoize@froxlor.org>
This commit is contained in:
Roman Schmerold (BNoiZe)
2014-10-11 09:08:27 +02:00
parent fe5eff890f
commit a7450dfe37

View File

@@ -696,7 +696,7 @@ class nginx {
protected function getHtpasswds($domain) { protected function getHtpasswds($domain) {
$result_stmt = Database::prepare(" $result_stmt = Database::prepare("
SELECT DISTINCT * SELECT *
FROM `" . TABLE_PANEL_HTPASSWDS . "` AS a FROM `" . TABLE_PANEL_HTPASSWDS . "` AS a
JOIN `" . TABLE_PANEL_DOMAINS . "` AS b USING (`customerid`) JOIN `" . TABLE_PANEL_DOMAINS . "` AS b USING (`customerid`)
WHERE b.customerid = :customerid AND b.domain = :domain WHERE b.customerid = :customerid AND b.domain = :domain
@@ -733,6 +733,10 @@ class nginx {
$x++; $x++;
} }
} }
// Remove duplicate entries
$returnval = array_map("unserialize", array_unique(array_map("serialize", $returnval)));
return $returnval; return $returnval;
} }