Пример #1
0
 if (isset($queryip, $volocalserverid)) {
     $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->st('action', 'post') == 'dl') {
             $return = $connection->banDel($volocalserverid, $ui->id('bannID', 19, 'post'));
             $template_file = $return ? $spracheResponse->ts_query_success . $return : $spracheResponse->error_table;
         } else {
             if ($ui->st('action', 'post') == 'ad') {
                 if ($ui->w('banType', 1, 'post') == 'I' and $ui->ip4('ip', 'post')) {
                     $banCmd = 'banadd ip=' . $ui->ip4('ip', 'post');
                 } else {
                     if ($ui->w('banType', 1, 'post') == 'N' and strlen($ui->escaped('name', 'post')) > 0) {
                         $banCmd = 'banadd name=' . $connection->ReplaceToTS3($ui->escaped('name', 'post'));
                     } else {
                         if ($ui->w('banType', 1, 'post') == 'U' and $ui->id('clientUID', 19, 'post')) {
                             $banCmd = 'banclient clid=' . $ui->id('clientUID', 19, 'post');
                         }
                     }
                 }
                 if (isset($banCmd)) {
                     if ($ui->id('time', 19, 'post') > 0) {
                         $banCmd .= ' time=' . $ui->id('time', 19, 'post');
                     }
                     if (strlen($ui->escaped('name', 'post')) > 0) {
                         $banCmd .= ' banreason=' . $connection->ReplaceToTS3($ui->escaped('banReason', 'post'));
                     }
                     $return = $connection->banAdd($volocalserverid, $banCmd);
                     $template_file = $return ? $spracheResponse->ts_query_success . $return : $spracheResponse->error_table;