示例#1
0
                 $serverdir = $row['serverdir'];
                 $keyname = $row['keyname'];
                 $bit = $row['bitversion'];
                 if ($externalDefaultDNS == 'Y') {
                     $defaultdns = $row['defaultdns'];
                 }
             }
         }
         $dnsarray = tsdns('li', $ip, $port, $user, $publickey, $keyname, $pass, 'N', $serverdir, $bit, array(''), array(''), array(''), $reseller_id);
     }
     if ($ui->st('d', 'get') == 'ri') {
         $connection = new TS3($ip, $queryport, 'serveradmin', $querypassword);
     }
     if ($connection->socketConnected === true and strpos($connection->errorcode, 'error id=0') !== false) {
         $i = 1;
         $servers = $connection->ImportData($dnsarray);
         $query = $sql->prepare("SELECT `id` FROM `voice_server` WHERE `localserverid`=? AND `ip`=? AND `resellerid`=? LIMIT 1");
         foreach ($servers as $virtualserver_id => $values) {
             $query->execute(array($virtualserver_id, $values['virtualserver_ip'], $reseller_id));
             $colcount = $query->rowCount();
             if ($colcount == 1 or $i > 25) {
                 unset($servers[$virtualserver_id]);
             } else {
                 $i++;
             }
         }
         $connection->CloseConnection();
     } else {
         $servers = array();
     }
 }