$queryip = $row['ssh2ip']; } else { if ($addedby == 1) { $query2 = $sql->prepare("SELECT `ip` FROM `rserverdata` WHERE `id`=? AND `resellerid`=? LIMIT 1"); $query2->execute(array($row['rootid'], $reseller_id)); $queryip = $query2->fetchColumn(); } } $connection = new TS3($queryip, $queryport, 'serveradmin', $querypassword); $errorcode = $connection->errorcode; if (strpos($errorcode, 'error id=0') === false) { $template_file = $spracheResponse->error_ts_query_connect . $errorcode; } else { if ($ui->smallletters('action', 2, 'get') == 're') { $uptime = 2; $reply = $connection->StopServer($volocalserverid); $reply = $connection->StartServer($volocalserverid); $loguseraction = '%start% %voserver% ' . $row['ip'] . ':' . $row['port']; $insertlog->execute(); } else { if ($ui->smallletters('action', 2, 'get') == 'so') { $uptime = 1; $reply = $connection->StopServer($volocalserverid); $loguseraction = '%stop% %voserver% ' . $row['ip'] . ':' . $row['port']; $insertlog->execute(); } } if (isset($reply)) { $query2 = $sql->prepare("UPDATE `voice_server` SET `uptime`=? WHERE `id`=? AND `resellerid`=? LIMIT 1"); $query2->execute(array($uptime, $id, $reseller_id)); $template_file = $spracheResponse->ts_query_success . $reply[0]['msg'];
$querypassword = $row2['decryptedquerypassword']; $addedby = $row2['addedby']; $localserverid = $row2['localserverid']; if ($addedby == 2) { $queryip = $row2['ssh2ip']; } else { if ($addedby == 1) { $query4->execute(array($row2['rootid'], $reseller_id)); $queryip = $query4->fetchColumn(); } } } $connection = new TS3($queryip, $queryport, 'serveradmin', $querypassword); $errorcode = $connection->errorcode; if (strpos($errorcode, 'error id=0') !== false) { $connection->StopServer($localserverid); } $connection->CloseConnection(); } } } else { $rcon = $row['rcon']; $password = $row['password']; $slots = $row['slots']; if ($servertype == 'g') { if (!$ui->id('xml', 1, 'post') and (!isset($_SESSION['lend']['gs']) or $_SESSION['lend']['gs'] != $serverid)) { $lendIPBlock = true; } $gsstillrunning = true; $description = ''; $serverip = '';
} 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); } $query3 = $sql->prepare("UPDATE `voice_server` SET `localserverid`=?,`jobPending`='N' WHERE `id`=? LIMIT 1"); $query3->execute(array($virtualserver_id, $row2['affectedID'])); $serverName = $ip . ':' . $port; $addressList = $serverName; if ($usedns == 'Y') { $addressList .= ', ' . $dns; $template_file = tsdns('md', $queryip, $ssh2port, $ssh2user, $publickey, $keyname, $ssh2password, $mnotified, $serverdir, $bitversion, array($ip), array($port), array($dns), $row['resellerID']); } $query3 = $sql->prepare("UPDATE `jobs` SET `status`='3' WHERE `affectedID`=? AND `type`='vo' LIMIT 1"); $query3->execute(array($row2['affectedID'])); $mailConnectInfo = array('ip' => $ip, 'port' => $port); sendmail('emailserverinstall', $userId, $serverName, $addressList, $mailConnectInfo); } else { $command = $gsprache->add . ' voiceserverID: ' . $row2['affectedID'] . '; Error: ' . $virtualserver_id;
$addList[] = 'i_needed_modify_power_virtualserver_modify_welcomemessage'; } } if (isset($addList)) { $connection->AdminPermissions($localServerID, 'add', $addList); } if (isset($removeList)) { $connection->AdminPermissions($localServerID, 'del', $removeList); } $rowCount += count($addList) + count($removeList); $loguseraction = '%mod% %voserver% ' . $ip . ':' . $port; } } if (isset($localServerID) and isid($localServerID, 255)) { if ($active == 'N') { $connection->StopServer($localServerID); } else { if ($ui->st('action', 'post') == 'md' and $active == 'Y' and $oldActive == 'N') { $connection->StartServer($localServerID); } } $serverName = $ip . ':' . $port; $connectList = array($serverName); if ($masterServerData['usedns'] == 'Y') { if ($ui->st('action', 'post') == 'ad' and $dns == strtolower($username . '.' . $masterServerData['defaultdns']) or $dns == $masterServerData['defaultdns']) { $dns = strtolower($id . '.' . $masterServerData['defaultdns']); $serverName = $dns; $connectList[] = $dns; $query = $sql->prepare("UPDATE `voice_server` SET `dns`=? WHERE `id`=? LIMIT 1"); $query->execute(array($dns, $id)); $rowCount += $query->rowCount();