} } else { echo 'Error connecting to DB Server ' . $row['ip'] . ':' . $row['port'] . ': ' . $remotesql->error . "\r\n"; } } } flush(); # Web Quotas if ($checkTypeOfServer == 'all' or $checkTypeOfServer == 'vh') { echo "Checking Quota usage\r\n"; $query = $sql->prepare("SELECT `webMasterID`,`ip`,`resellerID` FROM `webMaster` WHERE `active`='Y'"); $query->execute(); while ($row = $query->fetch(PDO::FETCH_ASSOC)) { echo 'Checking webMaster ' . $row['ip'] . ' with webMasterID ' . $row['webMasterID'] . "\r\n"; $httpd = new HttpdManagement($row['webMasterID'], $row['resellerID']); $httpd->ssh2Connect(); $httpd->checkQuotaUsage(); } } flush(); # Gather statistics if ($checkTypeOfServer == 'all' or $checkTypeOfServer == 'st') { $query = $sql->prepare("SELECT u.`id`,u.`cname`,u.`resellerid`,u.`accounttype`,s.`brandname` FROM `userdata` AS u LEFT JOIN `settings` AS s ON u.`resellerid`=s.`resellerid` WHERE u.`active`='Y'"); $query->execute(); while ($row = $query->fetch(PDO::FETCH_ASSOC)) { if ($row['accounttype'] == 'a' and !isset($adminStatsCollected) or $row['accounttype'] != 'a') { echo "Gathering statistics for user " . $row['cname'] . " with ID " . $row['id'] . " \r\n"; $statsArray = array('gameMasterInstalled' => 0, 'gameMasterActive' => 0, 'gameMasterSlotsAvailable' => 0, 'gameMasterServerAvailable' => 0, 'gameMasterCrashed' => 0, 'gameserverInstalled' => 0, 'gameserverActive' => 0, 'gameserverSlotsInstalled' => 0, 'gameserverSlotsActive' => 0, 'gameserverSlotsUsed' => 0, 'gameserverNoPassword' => 0, 'gameserverNoTag' => 0, 'gameserverNotRunning' => 0, 'mysqlMasterInstalled' => 0, 'mysqlMasterActive' => 0, 'mysqlMasterDBAvailable' => 0, 'mysqlMasterCrashed' => 0, 'mysqlDBInstalled' => 0, 'mysqlDBActive' => 0, 'mysqlDBSpaceUsed' => 0, 'ticketsCompleted' => 0, 'ticketsInProcess' => 0, 'ticketsNew' => 0, 'userAmount' => 0, 'userAmountActive' => 0, 'virtualMasterInstalled' => 0, 'virtualMasterActive' => 0, 'virtualMasterVserverAvailable' => 0, 'virtualInstalled' => 0, 'virtualActive' => 0, 'voiceMasterInstalled' => 0, 'voiceMasterActive' => 0, 'voiceMasterServerAvailable' => 0, 'voiceMasterSlotsAvailable' => 0, 'voiceMasterCrashed' => 0, 'voiceserverInstalled' => 0, 'voiceserverActive' => 0, 'voiceserverSlotsInstalled' => 0, 'voiceserverSlotsActive' => 0, 'voiceserverSlotsUsed' => 0, 'voiceserverCrashed' => 0, 'voiceserverTrafficAllowed' => 0, 'voiceserverTrafficUsed' => 0, 'webMasterInstalled' => 0, 'webMasterActive' => 0, 'webMasterSpaceAvailable' => 0, 'webMasterVhostAvailable' => 0, 'webspaceInstalled' => 0, 'webspaceActive' => 0, 'webspaceSpaceGiven' => 0, 'webspaceSpaceGivenActive' => 0, 'webspaceSpaceUsed' => 0); if ($row['accounttype'] == 'a') { $insertID = 0; $adminStatsCollected = true;
} else { $template_file = 'userpanel_404.tpl'; } } } else { if (isset($webMasterID, $dns) and $ui->st('d', 'get') == 'ri' and $ui->id('id', 10, 'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'), $substituteAccess['ws']))) { $id = $ui->id('id', 10, 'get'); // Nothing submitted yet, display the delete form if (!$ui->st('action', 'post')) { // Check if we could find an entry and if not display 404 page $template_file = 'userpanel_web_vhost_ri.tpl'; // User submitted remove the entry } else { if ($ui->st('action', 'post') == 'ri') { $vhostObject = new HttpdManagement($webMasterID, $reseller_id); if ($vhostObject != false and $vhostObject->ssh2Connect() and $vhostObject->sftpConnect()) { $vhostObject->vhostReinstall($id); $vhostObject->restartHttpdServer(); $template_file = $spracheResponse->table_del; $loguseraction = '%ri% %webvhost% ' . $dns; $insertlog->execute(); } else { $template_file = $spracheResponse->error_table; } // Request did not add up. Display 404 error. } else { $template_file = 'userpanel_404.tpl'; } } } else { if (isset($dns) and $ui->st('d', 'get') == 'if' and $ui->id('id', 10, 'get') and (!isset($_SESSION['sID']) or in_array($ui->id('id', 10, 'get'), $substituteAccess['ws']))) {
* * Sie sollten eine Kopie der GNU General Public License zusammen mit diesem * Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>. */ $query = $sql->prepare("SELECT `hostID`,`resellerID` FROM `jobs` WHERE (`status` IS NULL OR `status`='1') AND `type`='wv' GROUP BY `hostID`"); $query2 = $sql->prepare("SELECT * FROM `jobs` WHERE (`status` IS NULL OR `status`='1') AND `type`='wv' AND `hostID`=?"); $query3 = $sql->prepare("DELETE FROM `webVhost` WHERE `webVhostID`=? LIMIT 1"); $query4 = $sql->prepare("SELECT `active` FROM `webVhost` WHERE `webVhostID`=? LIMIT 1"); $query5 = $sql->prepare("UPDATE `jobs` SET `status`='3' WHERE `jobID`=? LIMIT 1"); $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 {