$query->execute(array($id, $resellerLockupID)); while ($row = $query->fetch(PDO::FETCH_ASSOC)) { $webMasterID = $row['webMasterID']; $user = trim($row['cname'] . ' ' . trim($row['vname'] . ' ' . $row['name'])); $dns = strlen($row['description']) == 0 ? 'web-' . $id : $row['description']; } // Nothing submitted yet, display the delete form if (!$ui->st('action', 'post') and isset($user)) { // Check if we could find an entry and if not display 404 page $template_file = $query->rowCount() > 0 ? 'admin_web_vhost_dl.tpl' : 'admin_404.tpl'; // User submitted remove the entry } else { if ($ui->st('action', 'post') == 'dl' and isset($user)) { $vhostObject = new HttpdManagement($webMasterID, $resellerLockupID); if ($vhostObject != false and $vhostObject->ssh2Connect() and $vhostObject->sftpConnect()) { $vhostObject->vhostDelete($id); $vhostObject->restartHttpdServer(); } $query = $sql->prepare("DELETE FROM `webVhost` WHERE `webVhostID`=? AND `resellerID`=? LIMIT 1"); $query->execute(array($id, $resellerLockupID)); $queryCount = $query->rowCount(); $query = $sql->prepare("DELETE d.* FROM `webVhostDomain` d LEFT JOIN `webVhost` v ON d.`webVhostID`=v.`webVhostID` WHERE v.`webVhostID` IS NULL"); $query->execute(); $queryCount += $query->rowCount(); // Check if a row was affected meaning an entry could be deleted. If yes add log entry and display success message if ($query->rowCount() > 0) { $template_file = $spracheResponse->table_del; $loguseraction = '%del% %webvhost% ' . $dns; $insertlog->execute(); // Nothing was deleted, display an error } else {
$query6 = $sql->prepare("UPDATE `webVhost` SET `jobPending`='N' WHERE `webVhostID`=? LIMIT 1"); $query7 = $sql->prepare("UPDATE `jobs` SET `status`='1' WHERE (`status` IS NULL OR `status`='1') AND `type`='wv' AND `hostID`=?"); $query8 = $sql->prepare("UPDATE `jobs` SET `action`='dl' WHERE `hostID`=? AND `type`='wv'"); $query->execute(); while ($row = $query->fetch(PDO::FETCH_ASSOC)) { $vhostObject = new HttpdManagement($row['hostID'], $row['resellerID']); if ($vhostObject != false and $vhostObject->ssh2Connect() and $vhostObject->sftpConnect() or $vhostObject->masterNotfound) { if ($vhostObject->masterNotfound) { $query8->execute(array($row['hostID'])); } $query2->execute(array($row['hostID'])); while ($row2 = $query2->fetch(PDO::FETCH_ASSOC)) { $extraData = @json_decode($row2['extraData']); if ($row2['action'] == 'dl') { if (!$vhostObject->masterNotfound) { $vhostObject->vhostDelete($row2['affectedID']); } $query3->execute(array($row2['affectedID'])); } else { if ($row2['action'] == 'ad') { $vhostObject->vhostCreate($row2['affectedID']); } else { if ($row2['action'] == 'md') { $query4->execute(array($row2['affectedID'])); $active = $query4->fetchColumn(); if ($active == 'N' or property_exists($extraData, 'newActive') and $extraData->newActive == 'N') { $vhostObject->setInactive($row2['affectedID']); } else { $vhostObject->vhostMod($row2['affectedID']); } } else {