Exemplo n.º 1
0
 if (!isset($ui->post['dbpassword']) or !gamestring($ui->post['dbpassword'])) {
     $error = 1;
 }
 if (!isset($ui->post['table_name']) or !gamestring($ui->post['table_name'])) {
     $error = 1;
 }
 if (!isset($ui->post['column_sourceip']) or !gamestring($ui->post['column_sourceip'])) {
     $error = 1;
 }
 if (!isset($ui->post['column_destip']) or !gamestring($ui->post['column_destip'])) {
     $error = 1;
 }
 if (!isset($ui->post['column_byte']) or !gamestring($ui->post['column_byte'])) {
     $error = 1;
 }
 if (!isset($ui->post['column_date']) or !gamestring($ui->post['column_date'])) {
     $error = 1;
 }
 if (!isset($ui->post['multiplier']) or !isinteger($ui->post['multiplier'])) {
     $error = 1;
 }
 if (!isset($ui->post['text_colour_1']) or !validate_int($ui->post['text_colour_1'], 0, 255) and $ui->post['text_colour_1'] != 0) {
     $error = 1;
 }
 if (!isset($ui->post['text_colour_2']) or !validate_int($ui->post['text_colour_2'], 0, 255) and $ui->post['text_colour_2'] != 0) {
     $error = 1;
 }
 if (!isset($ui->post['text_colour_3']) or !validate_int($ui->post['text_colour_3'], 0, 255) and $ui->post['text_colour_3'] != 0) {
     $error = 1;
 }
 if (!isset($ui->post['barin_colour_1']) or !validate_int($ui->post['barin_colour_1'], 0, 255) and $ui->post['barin_colour_1'] != 0) {
Exemplo n.º 2
0
         $query->execute(array($localID, $singleShorten, $resellerID));
         while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
             if ($row['list_id'] === null) {
                 $modcmd = '';
                 foreach (explode("\r\n", $row['modcmds']) as $line) {
                     if (preg_match('/^(\\[[\\w\\/\\.\\-\\_\\= ]{1,}\\])$/', $line)) {
                         $cmdName = trim($line, '[]');
                         $ex = preg_split("/\\=/", $cmdName, -1, PREG_SPLIT_NO_EMPTY);
                         if (isset($ex[1]) and trim($ex[1]) == 'default') {
                             $modcmd = trim($ex[0]);
                             break;
                         }
                     }
                 }
                 $query2->execute(array($row['id'], $localID, $row['map'], $row['mapGroup'], $row['cmd'], $modcmd, $row['tic'], $row['fps'], $row['gamemod'], $row['gamemod2'], $resellerID));
                 if (!isset($lastServerID) or isset($data['primary']) and gamestring($data['primary']) and $shorten == $data['primary']) {
                     $lastServerID = $sql->lastInsertId();
                 }
             } else {
                 unset($installedGameList[$row['list_id']]);
             }
         }
     }
     // Remove games that no longer exists
     $query = $sql->prepare("DELETE FROM `serverlist` WHERE `id`=? AND `switchID`=? AND `resellerid`=? LIMIT 1");
     foreach ($installedGameList as $removeID => $shorten) {
         $query->execute(array($removeID, $localID, $resellerID));
         $gamesToBeRemoved[] = $shorten;
     }
 }
 $customID = $localID;