// Check if a row was affected during insert or update if (isset($rowCount) and $rowCount > 0) { $insertlog->execute(); $template_file = $spracheResponse->table_add; $vhostObject = new HttpdManagement($webMasterID, $resellerLockupID); if ($vhostObject != false and $vhostObject->ssh2Connect() and $vhostObject->sftpConnect()) { if ($ui->st('action', 'post') == 'ad') { $vhostObject->vhostCreate($id); } else { if ($oldActive == 'Y' and $oldActive != $active) { $vhostObject->setInactive($id); } else { if ($oldFtpPassword != $ftpPassword) { $vhostObject->changePassword($id, $ftpPassword); } else { $vhostObject->vhostMod($id, $domainRemove); } } } $vhostObject->restartHttpdServer(); } // No update or insert failed } else { $template_file = $spracheResponse->error_table; } // An error occurred during validation unset the redirect information and display the form again } else { unset($header, $text); if ($ui->st('d', 'get') == 'ad') { $table = array(); $table2 = array();
foreach ($phpConfigurationMaster as $groupName => $array) { $groupNameSelect = $ui->escaped(str_replace(' ', '', $groupName), 'post'); if ($groupNameSelect and isset($phpConfigurationMaster[$groupName][$groupNameSelect])) { $phpConfiguration[$groupName] = $groupNameSelect; } else { reset($phpConfigurationMaster[$groupName]); $phpConfiguration[$groupName] = key($phpConfigurationMaster[$groupName]); } } } $phpConfiguration = @json_encode($phpConfiguration); $query = $sql->prepare("UPDATE `webVhost` SET `description`=?,`phpConfiguration`=? WHERE `webVhostID`=? AND `userID`=? AND `resellerID`=? LIMIT 1"); $query->execute(array($ui->names('description', 255, 'post'), $phpConfiguration, $id, $user_id, $reseller_id)); $vhostObject = new HttpdManagement($webMasterID, $reseller_id); if ($query->rowCount() and $vhostObject != false and $vhostObject->ssh2Connect() and $vhostObject->sftpConnect()) { $vhostObject->vhostMod($id); $vhostObject->restartHttpdServer(); $template_file = $spracheResponse->table_add; $loguseraction = '%md% %webvhost% ' . $dns; $insertlog->execute(); } else { $template_file = $spracheResponse->error_table; } } else { if (!$ui->st('action', 'post')) { $template_file = 'userpanel_web_vhost_md.tpl'; // Request did not add up. Display 404 error. } else { $template_file = 'userpanel_404.tpl'; } }
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 { if ($row2['action'] == 'ri') { $vhostObject->vhostReinstall($row2['affectedID']); } } } } $query5->execute(array($row2['jobID'])); $query6->execute(array($row2['affectedID'])); } $vhostObject->restartHttpdServer(); } else { $theOutput->printGraph('cannot connect to web host with ID: ' . $row['hostID']); $query7->execute(array($row['hostID']));