remove unneeded functions; fix ip-assigning when a domain is an alias of another domain and the ip's from the alias-domain are being read, no check for ssl/non-ssl was made resulting in an integrity constraint violation in the database

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2014-12-22 13:32:37 +01:00
parent 366e0f6061
commit 0406948c4b
3 changed files with 8 additions and 72 deletions

View File

@@ -1361,12 +1361,19 @@ if ($page == 'domains'
if ($aliasdomain != 0) {
// Overwrite given ipandports with these of the "main" domain
$ipandports = array();
$ssl_ipandports = array();
$origipresult_stmt = Database::prepare("
SELECT `id_ipandports` FROM `" . TABLE_DOMAINTOIP ."` WHERE `id_domain` = :aliasdomain
");
Database::pexecute($origipresult_stmt, array('aliasdomain' => $aliasdomain));
$ipdata_stmt = Database::prepare("SELECT * FROM `".TABLE_PANEL_IPSANDPORTS."` WHERE `id` = :ipid");
while ($origip = $origipresult_stmt->fetch(PDO::FETCH_ASSOC)) {
$ipandports[] = $origip['id_ipandports'];
$_origip_tmp = Database::pexecute_first($ipdata_stmt, array('ipid' => $origip['id_ipandports']));
if ($_origip_tmp['ssl'] == 0) {
$ipandports[] = $origip['id_ipandports'];
} else {
$ssl_ipandports[] = $origip['id_ipandports'];
}
}
$aliasdomain_check_stmt = Database::prepare("
SELECT `d`.`id` FROM `" . TABLE_PANEL_DOMAINS . "` `d`, `" . TABLE_PANEL_CUSTOMERS . "` `c`