$resellerLockupID = $row['resellerID']; $appServer = new AppServer($row['hostID']); $query2->execute(array($row['hostID'])); while ($row2 = $query2->fetch(PDO::FETCH_ASSOC)) { $appServer->getAppServerDetails($row2['affectedID']); $extraData = @json_decode($row2['extraData']); $query3->execute(array($row2['affectedID'])); while ($row3 = $query3->fetch(PDO::FETCH_ASSOC)) { $gsIP = $row3['serverip']; $port = $row3['port']; $protectedAllowed = $row3['pallowed']; } if ($query3->rowCount() > 0) { if ($row2['action'] == 'dl') { $appServer->stopAppHard(); $appServer->userCud('del', 'both'); $query4->execute(array($row2['affectedID'])); customColumns('G', $row2['affectedID'], 'del'); $query5->execute(array($row2['jobID'])); $command = $gsprache->del . ' gsswitchID: ' . $row2['affectedID'] . ' name:' . $row2['name'] . ' gsswitchID:' . $row2['affectedID']; } else { if ($row2['action'] == 'ad' or $row2['action'] == 'md' and is_object($extraData)) { $installGames = (is_object($extraData) and property_exists($extraData, 'installGames') and preg_match('/[APN]/', $extraData->installGames)) ? $extraData->installGames : 'N'; // userCrud will set the user to inactive $appServer->userCud('add'); $appServer->setQuota(); if ($row2['action'] == 'ad') { if ($installGames == 'P') { $appServer->addApp(array(), true); } else { if ($installGames == 'A') {
$ftppass = $ui->password('ftppass', 100, 'post'); if ($ftpAccess == 'Y') { $query = $sql->prepare("UPDATE `gsswitch` SET `serverid`=?,`ftppassword`=AES_ENCRYPT(?,?) WHERE `id`=? AND `resellerid`=? LIMIT 1"); $query->execute(array($switchID, $ftppass, $aeskey, $id, $resellerLockupID)); $updated = $query->rowCount() > 0 ? true : $updated; if (isset($oldID, $switchID, $oldProtected) and $oldID != $switchID and $oldProtected == 'Y') { $query = $sql->prepare("UPDATE `gsswitch` SET `protected`='N' WHERE `id`=? AND `resellerid`=? LIMIT 1"); $query->execute(array($id, $resellerLockupID)); $updated = $query->rowCount() > 0 ? true : $updated; } } if ($updated) { $appServer = new AppServer($rootID); $appServer->getAppServerDetails($id); if (isset($oldPass, $ftppass) and $ftppass != $oldPass) { $appServer->userCud('add'); } if (isset($oldID, $switchID, $oldServerTemplate, $serverTemplate) and ($oldID != $switchID or $oldServerTemplate != $serverTemplate)) { $appServer->startApp(); } $loguseraction = '%mod% %gserver% ' . $server; $insertlog->execute(); $template_file = $spracheResponse->table_add; $appServer->execute(); if (isset($dbConnect['debug']) and $dbConnect['debug'] == 1) { $template_file .= '<br><pre>' . implode("\r\n", $appServer->debug()) . '</pre>'; } } else { $template_file = $spracheResponse->error_table; } } else {