$max_upload_total_bandwidth = $row3['max_upload_total_bandwidth']; $dns = $row3['dns']; $masterserver = $row3['masterserver']; } if ($row2['action'] == 'dl' and isid($localserverid, 30)) { $command = $gsprache->del . ' voiceserverID: ' . $row2['affectedID'] . ' name:' . $row2['name']; $connection->DelServer($localserverid); $query3 = $sql->prepare("DELETE FROM `voice_server` WHERE `id`=? AND `resellerid`=? LIMIT 1"); $query3->execute(array($row2['affectedID'], $row['resellerID'])); customColumns('T', $row2['affectedID'], 'del'); $query3 = $sql->prepare("UPDATE `jobs` SET `status`='3' WHERE `jobID`=? AND `type`='vo' LIMIT 1"); $query3->execute(array($row2['jobID'])); if ($usedns == 'Y') { tsdns('dl', $queryip, $ssh2port, $ssh2user, $publickey, $keyname, $ssh2password, $mnotified, $serverdir, $bitversion, array($ip), array($port), array($dns), $row['resellerID']); } tsbackup('delete', $ssh2user, $serverdir, $masterserver, $localserverid, '*'); $query3 = $sql->prepare("DELETE v.* FROM `voice_server_backup` v LEFT JOIN `userdata` u ON v.`uid`=u.`id` WHERE u.`id` IS NULL"); $query3->execute(); } else { if ($row2['action'] == 'ad' and isset($active)) { if (isid($localserverid, 30)) { $command = $gsprache->add . ' voiceserverID: ' . $row2['affectedID'] . '; Skipping, virtual ID already exists in Easy-WI DB: ' . $localserverid; $query3 = $sql->prepare("UPDATE `jobs` SET `status`='2' WHERE `jobID`=? AND `type`='vo' LIMIT 1"); $query3->execute(array($row2['jobID'])); } else { $virtualserver_id = $connection->AddServer($slots, $ip, $port, $initialpassword, $name, array('Y', $welcome), $max_download_total_bandwidth, $max_upload_total_bandwidth, array('Y', $hostbanner_url), $hostbanner_gfx_url, array('Y', $hostbutton_url), $hostbutton_gfx_url, $hostbutton_tooltip); if (isid($virtualserver_id, 19)) { $command = $gsprache->add . ' voiceserverID: ' . $row2['affectedID'] . '; Name:' . $row2['name']; if ($active == 'N') { $connection->StopServer($virtualserver_id); }
$template_file = $spracheResponse->error_ts_query_connect . $errorcode; } else { $connection->StartServer($volocalserverid); $reply = $connection->Snapshotdeploy($volocalserverid, $snapshot); if (isset($reply[0]['id']) and $reply[0]['id'] == '0') { $move = array(); $channelListOld = @json_decode($row['channels']); $channelListDeployed = @json_decode($connection->channelList($volocalserverid)); if (is_object($channelListDeployed) and is_object($channelListOld)) { foreach ($channelListOld as $k => $v) { if (isset($channelListDeployed->{$k})) { $move[$v] = $channelListDeployed->{$k}; } } } tsbackup('deploy', $ssh2user, $serverdir, $masterserver, $volocalserverid, $ui->id('id', 10, 'post'), $move); $query = $sql->prepare("SELECT CONCAT(`ip`,':',`port`) AS `address` FROM `voice_server` WHERE `id`=? AND `userid`=? AND `resellerid`=? LIMIT 1"); $query->execute(array($row['sid'], $user_id, $reseller_id)); $address = $query->fetchColumn(); $loguseraction = '%use% %voserver% %backup% ' . $row['name'] . ' ' . $address; $insertlog->execute(); } $template_file = $spracheResponse->ts_query_success . $reply[0]['msg']; } $connection->CloseConnection(); } } else { $template_file = $spracheResponse->token; } } }
$errorcode = $connection->errorcode; if (isset($localserverid) and strpos($errorcode, 'error id=0') !== false) { $connection->DelServer($localserverid); $errorcode = $connection->errorcode; $connection->CloseConnection(); } } if ($ui->w('safeDelete', 1, 'post') != 'S' or isset($errorcode) and strpos($errorcode, 'error id=0') !== false) { $query = $sql->prepare("DELETE FROM `voice_server` WHERE `id`=? AND `resellerid`=? LIMIT 1"); $query->execute(array($id, $resellerLockupID)); $query = $sql->prepare("UPDATE `jobs` SET `status`='2' WHERE `affectedID`=? AND `type`='vo'"); $query->execute(array($id)); customColumns('T', $id, 'del'); $query = $sql->prepare("DELETE b.* FROM `voice_server_backup` b LEFT JOIN `voice_server` v ON b.`sid`=v.`id` WHERE v.`id` IS NULL"); $query->execute(); tsbackup('delete', $ssh2user, $serverdir, $rootID, $localserverid, '*'); $template_file = $spracheResponse->table_del; $loguseraction = '%del% %voserver% ' . $ip . ':' . $port; $insertlog->execute(); if (isset($usedns) and $usedns == 'Y') { if (isset($tsdnsServerID) and isid($tsdnsServerID, 10)) { $query = $sql->prepare("SELECT *,AES_DECRYPT(`ssh2port`,:aeskey) AS `decryptedssh2port`,AES_DECRYPT(`ssh2user`,:aeskey) AS `decryptedssh2user`,AES_DECRYPT(`ssh2password`,:aeskey) AS `decryptedssh2password` FROM `voice_tsdns` WHERE `active`='Y' AND `id`=:id AND (`resellerid`=:reseller_id OR `managedForID`=:managedForID) LIMIT 1"); $query->execute(array(':aeskey' => $aeskey, ':id' => $tsdnsServerID, ':reseller_id' => $resellerLockupID, ':managedForID' => $admin_id)); while ($row = $query->fetch(PDO::FETCH_ASSOC)) { $publickey = $row['publickey']; $queryip = $row['ssh2ip']; $ssh2port = $row['decryptedssh2port']; $ssh2user = $row['decryptedssh2user']; $ssh2password = $row['decryptedssh2password']; $serverdir = $row['serverdir']; $keyname = $row['keyname'];