Пример #1
0
     $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);
                 }
                 $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']));
Пример #2
0
         $errors['dns'] = $sprache->dns;
     }
 }
 // No need to check if we can connect if the user messed up the input fields anyway
 if (count($errors) == 0) {
     $connection = new TS3($masterServerData['ssh2ip'], $masterServerData['queryport'], 'serveradmin', $masterServerData['decryptedquerypassword']);
     $errorcode = $connection->errorcode;
     if (strpos($errorcode, 'error id=0') === false) {
         $errors['ts3Connect'] = $errorcode;
     }
 }
 // Submitted values are OK
 if (count($errors) == 0) {
     // Make the inserts or updates define the log entry and get the affected rows from insert
     if ($ui->st('action', 'post') == 'ad') {
         $localServerID = $connection->AddServer($slots, $ip, $port, $initialpassword, $name, array($forcewelcome, $welcome), $max_download_total_bandwidth, $max_upload_total_bandwidth, array($forcebanner, $hostbanner_url), $hostbanner_gfx_url, array($forcebutton, $hostbutton_url), $hostbutton_gfx_url, $hostbutton_tooltip);
         if (isid($localServerID, 255)) {
             $username = strtolower(getusername($userID));
             $query = $sql->prepare("INSERT INTO `voice_server` (`active`,`backup`,`lendserver`,`userid`,`masterserver`,`ip`,`port`,`slots`,`initialpassword`,`password`,`forcebanner`,`forcebutton`,`forceservertag`,`forcewelcome`,`max_download_total_bandwidth`,`max_upload_total_bandwidth`,`localserverid`,`dns`,`maxtraffic`,`serverCreated`,`flexSlots`,`flexSlotsFree`,`flexSlotsPercent`,`autoRestart`,`externalID`,`resellerid`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,NOW(),?,?,?,?,?,?)");
             $query->execute(array($active, $backup, $lendserver, $userID, $rootID, $ip, $port, $slots, $initialpassword, $password, $forcebanner, $forcebutton, $forceservertag, $forcewelcome, $max_download_total_bandwidth, $max_upload_total_bandwidth, $localServerID, $dns, $maxtraffic, $flexSlots, $flexSlotsFree, $flexSlotsPercent, $autoRestart, $externalID, $resellerLockupID));
             $rowCount = $query->rowCount();
             $id = $sql->lastInsertId();
         } else {
             $ts3ErrorCode = 'TS errorcode: ' . $localServerID;
         }
         $loguseraction = '%add% %voserver% ' . $ip . ':' . $port;
     } else {
         if ($ui->st('action', 'post') == 'md' and $id) {
             $query = $sql->prepare("UPDATE `voice_server` SET `active`=?,`backup`=?,`lendserver`=?,`ip`=?,`port`=?,`slots`=?,`password`=?,`forcebanner`=?,`forcebutton`=?,`forceservertag`=?,`forcewelcome`=?,`max_download_total_bandwidth`=?,`max_upload_total_bandwidth`=?,`dns`=?,`flexSlots`=?,`flexSlotsFree`=?,`flexSlotsPercent`=?,`maxtraffic`=?,`autoRestart`=?,`externalID`=? WHERE `id`=? AND `resellerid`=? LIMIT 1");
             $query->execute(array($active, $backup, $lendserver, $ip, $port, $slots, $password, $forcebanner, $forcebutton, $forceservertag, $forcewelcome, $max_download_total_bandwidth, $max_upload_total_bandwidth, $dns, $flexSlots, $flexSlotsFree, $flexSlotsPercent, $maxtraffic, $autoRestart, $externalID, $id, $resellerLockupID));
             $rowCount = $query->rowCount();