function _wake_server()
 {
     $curr_time = mktime();
     if ($curr_time - $this->iCurrTime > $this->iTimeout) {
         echo $this->sUniqDel;
         flush_buffers();
         $this->iCurrTime = $curr_time;
         $this->PingCount++;
         @mysql_close($this->rLink);
         $this->_connect();
     }
 }
Exemple #2
0
function show_progress($str, $append = '<br />')
{
    print $str . $append;
    flush_buffers();
}
Exemple #3
0
    $sqlx = "Select * from tblPing where IP = '" . $row['IP'] . "'\n\torder by datetime desc ";
    $resx = $db->executeQuery($sqlx);
    //execute the query
    ?>
		<td>
		<?php 
    while ($resx != -1 && ($rowx = mysql_fetch_assoc($resx))) {
        echo "<img src='../Images/" . $rowx["ping"] . "x.png' width='2' height='10'>";
    }
    echo " &nbsp;";
    ?>
		</td>				
	</tr>
<?php 
    $i++;
    flush_buffers();
}
?>
	</tbody>
	</table>
</div>
<section>
	<?php 
include $_SERVER['DOCUMENT_ROOT'] . "/include/End.php";
?>
</body>
</html>
<?php 
function object_2_array($result)
{
    $array = array();
function prod_cart($projet, $projection, $mode, $nb_carte)
{
    /*FONCTION DE PRODUCTION DE CARTE EN MASSE*/
    include "_INCLUDE/commun.inc.php";
    if (securite($projet) == "ok") {
        /*création ou test du fichier de log*/
        $result_verif = verif($projet, $output);
        /*Affichage*/
        if ($mode == "html") {
            echo "nb carte produites : " . $result_verif[1] . "<BR>";
        } else {
            echo "";
        }
        if ($mode == "html") {
            echo "PROJET : " . $projet . "<BR>";
        } else {
            echo "";
        }
        /* $req_liste_taxon récupère la liste de taxon en fonction du projet*/
        $query = $req_liste_taxon[$projet] . " " . $result_verif[0];
        echo "{$query}<BR>";
        $reponse = query_bdd($query, 2);
        $table = $reponse[0];
        $nom = $reponse[1];
        /*Construction de l'URL utilisé pour produire la carte*/
        /*$URL initialisé dans .sql_config.inc*/
        $URL = $URL_qgisserver;
        $URL .= "{$projet}.out.qgs";
        $URL .= $source[$projet] . $layer[$projet];
        /*Affichage*/
        if ($mode == "html") {
            $nb_carte_prod = $nb_carte;
        } else {
            $nb_carte_prod = count($table);
        }
        if (!empty($table[0])) {
            for ($i = 0; $i < $nb_carte_prod; $i++) {
                /*Création du nouveau fichier projet avec le taxon à interroger*/
                $file = file_get_contents("{$input}/{$projet}.qgs");
                $texte = str_replace("100024", $table[$i], $file);
                file_put_contents("{$input}/{$projet}.out.qgs", $texte);
                /*Soucis d'encodage*/
                $espece = nettoyerChaine($nom[$i]);
                $espece = utf8_decode($espece);
                /*Affichage*/
                if ($mode == "html") {
                    echo "{$table[$i]}<BR>";
                } else {
                    echo "Taxon {$table[$i]} \n ";
                }
                if ($mode == "html") {
                    echo "{$URL}<BR>";
                } else {
                    echo "{$URL}\n";
                }
                /*Enregistrement de l'image*/
                if (file_get_contents($URL)) {
                    $taxprod = "ok";
                    $img = file_get_contents($URL);
                    file_put_contents("{$output}/{$projet}/" . $espece . "_" . $short[$projet] . "_" . $table[$i] . ".jpg", $img);
                    imagethumb("{$output}/{$projet}/" . $espece . "_" . $short[$projet] . "_" . $table[$i] . ".jpg", "{$output}/{$projet}/" . $espece . "_" . $short[$projet] . "_thumb_" . $table[$i] . ".jpg", 400);
                } else {
                    $taxprod = "no";
                }
                /*Nettoyage et log*/
                unlink("{$input}/{$projet}.out.qgs");
                if ($taxprod == "ok") {
                    file_put_contents("{$output}/{$projet}/cartes_taxons_produit_{$projet}.txt", "'{$table[$i]}'\n", FILE_APPEND);
                }
                /*activation affichage*/
                $buffer = strlen($table[$i]) + 3;
                flush_buffers($buffer);
            }
        }
    }
}
Exemple #5
0
function create_brand_pkg($rawname, $version, $brand_name, $old_brand_timestamp, $c_message)
{
    global $brands_html, $supported_phones, $force;
    $pkg_name = $rawname;
    if (!file_exists(RELEASE_DIR . "/" . $rawname)) {
        mkdir(RELEASE_DIR . "/" . $rawname);
    }
    $family_max_array = array();
    //Clear family array
    $z = 0;
    foreach (glob(MODULES_DIR . "/" . $rawname . "/*", GLOB_ONLYDIR) as $family_folders) {
        flush_buffers();
        if (file_exists($family_folders . "/family_data.json")) {
            $family_xml = file2json($family_folders . "/family_data.json");
            $old_firmware_ver = $family_xml['data']['firmware_ver'];
            echo "\n\t==========" . $family_xml['data']['name'] . "==========\n";
            echo "\tFound family_data.json in " . $family_folders . "\n";
            $b = 0;
            foreach ($family_xml['data']['model_list'] as $data) {
                $supported_phones[$brand_name][$z][$b] = $data['model'];
                $b++;
            }
            $i = 0;
            $dir_iterator = new RecursiveDirectoryIterator($family_folders . "/");
            $iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::SELF_FIRST);
            foreach ($iterator as $family_files) {
                if (!is_dir($family_files) && dirname($family_files) != $family_folders . "/firmware" && dirname($family_files) != $family_folders . "/json") {
                    $path_parts = pathinfo($family_files);
                    if (basename($family_files) != "family_data.json") {
                        $files_array[$i] = filemtime($family_files);
                        echo "\t\tParsing File: " . basename($family_files) . "|" . $files_array[$i] . "\n";
                        $i++;
                    }
                }
            }
            $family_max = max($files_array);
            $family_max_array[$z] = $family_max;
            echo "\t\t\tTotal Family Timestamp: " . $family_max . "\n";
            if (file_exists(FIRMWARE_DIR . "/" . $rawname . "/" . $family_xml['data']['directory'] . "/firmware")) {
                echo "\t\tFound Firmware Folder in " . $family_xml['data']['directory'] . "\n";
                $firmware_files_array = array();
                //Clear firmware array
                flush_buffers();
                $x = 0;
                foreach (glob(FIRMWARE_DIR . "/" . $rawname . "/" . $family_xml['data']['directory'] . "/firmware/*") as $firmware_files) {
                    flush_buffers();
                    if (!is_dir($firmware_files)) {
                        $firmware_files_array[$x] = filemtime($firmware_files);
                        echo "\t\t\t\tParsing File: " . basename($firmware_files) . "|" . $firmware_files_array[$x] . "\n";
                        $x++;
                    }
                }
                $firmware_max = max($firmware_files_array);
                echo "\t\t\t\t\tTotal Firmware Timestamp: " . $firmware_max . "\n";
                if ($force or $firmware_max != $old_firmware_ver) {
                    echo "\t\t\tFirmware package has changed...\n";
                    echo "\t\t\tCreating Firmware Package\n";
                    exec("tar zcf " . RELEASE_DIR . "/" . $rawname . "/" . $family_xml['data']['directory'] . "_firmware.tgz --exclude .svn -C " . FIRMWARE_DIR . "/" . $rawname . "/" . $family_xml['data']['directory'] . " firmware");
                    $firmware_md5 = md5_file(RELEASE_DIR . "/" . $rawname . "/" . $family_xml['data']['directory'] . "_firmware.tgz");
                    echo "\t\t\tPackage MD5 SUM: " . $firmware_md5 . "\n";
                    echo "\t\t\tAdding Firmware Package Information to family_data.json File\n";
                    if ($firmware_max > $family_max) {
                        echo "\t\t\tFirmware Timestamp is newer than Family Timestamp, updating Family Timestamp to match\n";
                        $family_max = $firmware_max;
                        $family_max_array[$z] = $family_max;
                    }
                    $family_array = file2json($family_folders . "/family_data.json");
                    $family_array['data']['firmware_ver'] = $firmware_max;
                    $family_array['data']['firmware_md5sum'] = $firmware_md5;
                    $family_array['data']['firmware_pkg'] = $family_xml['data']['directory'] . "_firmware.tgz";
                    file_put_contents($family_folders . "/family_data.json", json_format(json_encode($family_array)));
                } else {
                    echo "\t\t\tFirmware has not changed, not updating package\n";
                }
            }
            $z++;
            echo "\tComplete..Continuing..\n";
            $family_list[] = array('id' => $family_xml['data']['id'], 'name' => $family_xml['data']['name'], 'directory' => $family_xml['data']['directory'], 'description' => $family_xml['data']['description'], 'changelog' => $family_xml['data']['changelog'], 'last_modified' => $family_xml['data']['last_modified']);
        }
    }
    echo "\n\t==========" . $brand_name . "==========\n";
    echo "\tCreating Completed Package\n";
    $fp = fopen(MODULES_DIR . "/" . $rawname . "/brand_data.json", 'r');
    $contents = fread($fp, filesize(MODULES_DIR . "/" . $rawname . "/brand_data.json"));
    fclose($fp);
    $brand_array = file2json(MODULES_DIR . "/" . $rawname . "/brand_data.json");
    $brand_array['data']['brands']['family_list'] = array();
    $brand_array['data']['brands']['family_list'] = $family_list;
    $brand_array['data']['brands']['package'] = $pkg_name;
    $i = 0;
    foreach (glob(MODULES_DIR . "/" . $rawname . "/*") as $brand_files) {
        if (!is_dir($brand_files) and basename($brand_files) != "brand_data.json" and basename($brand_files) != "brand_data.json") {
            $brand_files_array[$i] = filemtime($brand_files);
            echo "\t\tParsing File: " . basename($brand_files) . "|" . $brand_files_array[$i] . "\n";
            $i++;
        }
    }
    $brand_max = max($brand_files_array);
    $temp = max($family_max_array);
    $brand_max = max($brand_max, $temp);
    echo "\t\t\tTotal Brand Timestamp: " . $brand_max . "\n";
    if ($force or $brand_max != $old_brand_timestamp) {
        $brand_array['data']['brands']['last_modified'] = $brand_max;
        $brand_array['data']['brands']['changelog'] = $c_message;
        $brand_array['data']['brands']['package'] = $pkg_name . ".tgz";
        file_put_contents(MODULES_DIR . "/" . $rawname . "/brand_data.json", json_format(json_encode($brand_array)));
        copy(MODULES_DIR . "/" . $rawname . "/brand_data.json", RELEASE_DIR . "/" . $rawname . "/" . $rawname . ".json");
        mkdir(RELEASE_DIR . "/" . $rawname . "/");
        exec("tar zcf " . RELEASE_DIR . "/" . $rawname . "/" . $pkg_name . ".tgz --exclude .svn --exclude firmware -C " . MODULES_DIR . " " . $rawname);
        $brand_md5 = md5_file(RELEASE_DIR . "/" . $rawname . "/" . $pkg_name . ".tgz");
        echo "\t\tPackage MD5 SUM: " . $brand_md5 . "\n";
        $brand_array['data']['brands']['md5sum'] = $brand_md5;
        file_put_contents(MODULES_DIR . "/" . $rawname . "/brand_data.json", json_format(json_encode($brand_array)));
        copy(MODULES_DIR . "/" . $rawname . "/brand_data.json", RELEASE_DIR . "/" . $rawname . "/" . $rawname . ".json");
        $brands_html .= "==== " . $rawname . " (Last Modified: " . date('m/d/Y', $brand_max) . " at " . date("G:i", $brand_max) . ") ====\n";
        $brands_html .= "XML File: [http://www.provisioner.net/release/v3/" . $rawname . "/" . $rawname . ".json " . $rawname . ".json]\n\n";
        $brands_html .= "Package File: [http://www.provisioner.net/release/v3/" . $rawname . "/" . $pkg_name . ".tgz " . $pkg_name . ".tgz]\n";
        echo "\tComplete..Continuing..\n";
    } else {
        $brands_html .= "==== " . $rawname . " (Last Modified: " . date('m/d/Y', $brand_max) . " at " . date("G:i", $brand_max) . ") ====\n";
        $brands_html .= "XML File: [http://www.provisioner.net/release/v3/" . $rawname . "/" . $rawname . ".json " . $rawname . ".json]\n\n";
        $brands_html .= "Package File: [http://www.provisioner.net/release/v3/" . $rawname . "/" . $pkg_name . ".tgz " . $pkg_name . ".tgz]\n";
        echo "\tNothing changed! Aborting Package Creation!\n";
    }
}
        if ($rec_id % $step_uiupdate == 0) {
            print '<script type="text/javascript">update_counts2(' . $i . ',' . count($updates) . ')</script>' . "\n";
            flush_buffers();
        }
    }
    foreach ($reparables as $rec_id) {
        $rec = $recs[$rec_id];
        if ($rec['rec_RecTypeID'] == 1 && $rec['rec_Title']) {
            $has_detail_160 = mysql_num_rows(mysql_query("select dtl_ID from recDetails where dtl_DetailTypeID = {$titleDT} and dtl_RecID =" . $rec_id)) > 0;
            //touch the record so we can update it  (required by the heuristdb triggers)
            mysql_query('update Records set rec_RecTypeID=1 where rec_ID=' . $rec_id);
            if ($has_detail_160) {
                mysql_query('update recDetails set dtl_Value="' . $rec['rec_Title'] . "\" where dtl_DetailTypeID = {$titleDT} and dtl_RecID=" . $rec_id);
            } else {
                mysql_query('insert into recDetails (dtl_RecID, dtl_Value) VALUES(' . $rec_id . ',' . $rec['rec_Title'] . ')');
            }
        }
    }
    print '<script type="text/javascript">update_counts2(' . $i . ',' . count($updates) . ')</script>' . "\n";
    print '<hr>';
    print '<br/>&nbsp;<br/><a target=_blank href="' . HEURIST_BASE_URL . '?db=' . HEURIST_DBNAME . '&w=all&q=ids:' . join(',', array_keys($updates)) . '">Click to view updated records</a><br/>&nbsp;<br/>';
}
if (count($blanks) > 0) {
    print '<br/>&nbsp;<br/><a target=_blank href="' . HEURIST_BASE_URL . '?db=' . HEURIST_DBNAME . '&w=all&q=ids:' . join(',', $blanks) . '">Click to view records for which the data would create a blank title</a>' . '<br/>This is generally due to faulty title mask (verify with Check Title Masks)<br/>' . 'or faulty data in individual records. These titles have not been changed.';
}
flush_buffers(false);
?>
        </div>
    </body>
</html>
function minecraft_restart_single($serverPort)
{
    // allow 10 seconds time
    set_time_limit(30);
    update_progress("10%");
    sleep(1);
    update_progress("15%");
    sleep(1);
    // Kill the cmd.exe processes
    //runCommand("start \"MineField\" cmd /C Call kill_${serverPort}.bat > NUL", "Shutting down server on ${serverPort}");
    runCommand('tasklist /A /V /S CIRCE /U CIRCE\\Mike /FI "IMAGENAME eq cmd*"');
    runCommand('tasklist /A /V /S CIRCE /U CIRCE\\Mike /FI "IMAGENAME eq java*"');
    //runCommand('tasklist /V /S CIRCE /U CIRCE\Mike /FI "WINDOWTITLE eq Minecraft*"');
    update_progress("30%");
    sleep(1);
    update_progress("50%");
    sleep(1);
    update_progress("60%");
    //runCommand("start \"MineCraft\" cmd /C Call start_${serverPort}.bat > NUL", "Starting server on ${serverPort}");
    update_progress("100%");
    flush_buffers();
}
Exemple #8
0
function dicmakeR()
{
    global $windows, $hcwd, $CheckedLinks, $GrabedWords;
    $combo = empty($_REQUEST['combo']) ? 0 : 1;
    if (!empty($_REQUEST['range']) && !empty($_REQUEST['output']) && !empty($_REQUEST['min']) && !empty($_REQUEST['max'])) {
        $min = $_REQUEST['min'];
        $max = $_REQUEST['max'];
        if ($max < $min) {
            echo "Bad input!";
            return;
        }
        $s = $w = '';
        $out = $_REQUEST['output'];
        $r = $_REQUEST['range'];
        $dic = fopen($out, 'w');
        if ($r == 1) {
            for ($s = pow(10, $min - 1); $s < pow(10, $max - 1); $s++) {
                $w = $s;
                if ($combo) {
                    $w = "{$w}:{$w}";
                }
                fwrite($dic, $w . "\n");
            }
        } else {
            $s = str_repeat($r, $min);
            while (strlen($s) < $max) {
                $w = $s;
                if ($combo) {
                    $w = "{$w}:{$w}";
                }
                fwrite($dic, $w . "\n");
                $s++;
            }
        }
        fclose($dic);
        echo '<font color=#FA0>Done</font>';
    } elseif (!empty($_REQUEST['input']) && !empty($_REQUEST['output'])) {
        $input = fopen($_REQUEST['input'], 'r');
        if (!$input) {
            if ($windows) {
                echo 'Unable to read from ' . htmlspecialchars($_REQUEST['input']) . "<br />";
            } else {
                $input = explode("\n", shelL("cat {$input}"));
                $output = fopen($_REQUEST['output'], 'w');
                if ($output) {
                    foreach ($input as $in) {
                        $user = $in;
                        $user = trim(fgets($in), " \n\r");
                        if (!strstr($user, ':')) {
                            continue;
                        }
                        $user = substr($user, 0, strpos($user, ':'));
                        if ($combo) {
                            fwrite($output, $user . ':' . $user . "\n");
                        } else {
                            fwrite($output, $user . "\n");
                        }
                    }
                    fclose($input);
                    fclose($output);
                    echo '<font color=#FA0>Done</font>';
                }
            }
        } else {
            $output = fopen($_REQUEST['output'], 'w');
            if ($output) {
                while (!feof($input)) {
                    $user = trim(fgets($input), " \n\r");
                    if (!strstr($user, ':')) {
                        continue;
                    }
                    $user = substr($user, 0, strpos($user, ':'));
                    if ($combo) {
                        fwrite($output, $user . ':' . $user . "\n");
                    } else {
                        fwrite($output, $user . "\n");
                    }
                }
                fclose($input);
                fclose($output);
                echo '<font color=#FA0>Done</font>';
            } else {
                echo 'Unable to write data to ' . htmlspecialchars($_REQUEST['input']) . "<br />";
            }
        }
    } elseif (!empty($_REQUEST['url']) && !empty($_REQUEST['output'])) {
        $res = downloadiT($_REQUEST['url'], $_REQUEST['output']);
        if ($combo && $res) {
            $file = file($_REQUEST['output']);
            $output = fopen($_REQUEST['output'], 'w');
            foreach ($file as $v) {
                fwrite($output, "{$v}:{$v}\n");
            }
            fclose($output);
        }
        echo '<font color=#FA0>Done</font>';
    } elseif (!empty($_REQUEST['url']) && !empty($_REQUEST['pout']) && !empty($_REQUEST['lvl'])) {
        $url = $_REQUEST['url'];
        echo '<font color=#FA0>Please wait';
        @flush_buffers();
        Site2profile($url, $_REQUEST['lvl']);
        $output = fopen($_REQUEST['pout'], 'w');
        if ($output) {
            foreach ($GrabedWords as $word) {
                fwrite($output, "{$word}\n");
            }
            echo '<br /><br />Done!';
        } else {
            echo 'Can not write to file!';
        }
        echo '</font>';
    } else {
        $temp = whereistmP() . DIRECTORY_SEPARATOR;
        echo '<form name=dldic method="POST"><div class="fieldwrapper"><label class="styled" style="width:320px">Website profiler</label>
</div><div class="fieldwrapper"><label class="styled">URL:</label><div class="thefield"><input type="url" name="url" value="http://' . getenv('HTTP_HOST') . '/" size="30" />
</div></div><div class="fieldwrapper"><label class="styled">Output:</label><div class="thefield"><input type="text" name="pout" value="' . $temp . '.dic" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Level:</label><div class="thefield"><input type="number" min="1" name=lvl value=3></div></div>' . $hcwd . '<div class="buttonsdiv"><input type="submit" value="Get" name="profile" style="margin-left: 150px;" /></div></form><br /><form name=wordlist method="POST"><div class="fieldwrapper"><label class="styled" style="width:320px">Wordlist generator</label>
</div><div class="fieldwrapper"><label class="styled">Range:</label><div class="thefield"><select name=range><option value=a>a-z</option><option value=A>A-Z</option><option value=1>0-9</option></select>
</div></div><div class="fieldwrapper"><label class="styled">min lenght:</label><div class="thefield"><select name=min><option value=1>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option><option value=7>7</option><option value=8>8</option><option value=9>9</option><option value=10>10</option></select></div>
</div><div class="fieldwrapper"><label class="styled">Max lenght:</label><div class="thefield"><select name=max><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option><option value=7>7</option><option value=8>8</option><option value=9>9</option><option value=10>10</option><option value=11>11</option></select></div>
</div><div class="fieldwrapper"><label class="styled">Output:</label><div class="thefield"><input type="text" name="output" value="' . $temp . '.dic" size="30" /></div>
</div><div class="fieldwrapper"><label class="styled">Format:</label><div class="thefield"><input type=checkbox name=combo value=1 checked> Combo style output
</div></div>' . $hcwd . '<div class="buttonsdiv"><input type="submit" value="Make" style="margin-left: 150px;" /></div></form><br /><form name=grab method="POST"><div class="fieldwrapper"><label class="styled" style="width:320px">Grab dictionary</label></div><div class="fieldwrapper"><label class="styled">Input:</label><div class="thefield"><input type="text" name="input" value="/etc/passwd" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Output:</label><div class="thefield"><input type="text" name="output" value="' . $temp . '.dic" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Format:</label><div class="thefield"><input type=checkbox name=combo value=1 checked> Combo style output</div></div>' . $hcwd . '<div class="buttonsdiv"><input type="submit" value="Grab" style="margin-left: 150px;" />
</div></form><br /><form name=dldic method="POST"><div class="fieldwrapper"><label class="styled" style="width:320px">Download dictionary</label>
</div><div class="fieldwrapper"><label class="styled">URL:</label><div class="thefield"><input type="url" name="url" value="http://people.sc.fsu.edu/~jburkardt/datasets/words/wordlist.txt" size="30" />
</div></div><div class="fieldwrapper"><label class="styled">Output:</label><div class="thefield"><input type="text" name="output" value="' . $temp . '.dic" size="30" /></div></div><div class="fieldwrapper"><label class="styled">Format:</label><div class="thefield"><input type=checkbox name=combo value=1 checked> Combo style output</div></div>' . $hcwd . '<div class="buttonsdiv"><input type="submit" value="Get" style="margin-left: 150px;" /></div></form><br />';
    }
}
Exemple #9
0
 function _wake_server()
 {
     if (_get_generating_dump_value(GET_SQL_CANCEL_PARAM)) {
         $this->_report(GET_SQL_CANCEL_MESSAGE);
         die(GET_SQL_CANCEL_MESSAGE);
     }
     $curr_time = time();
     if ($curr_time - $this->iCurrTime > $this->iTimeout) {
         echo $this->sUniqDel;
         flush_buffers();
         $this->iCurrTime = $curr_time;
         $this->PingCount++;
         @$this->rLink->close($this->rLink);
         $this->_connect();
     }
 }
Exemple #10
0
 function _wake_server()
 {
     $curr_time = mktime();
     if ($curr_time - $this->iCurrTime > $this->iTimeout) {
         echo $this->sUniqDel;
         flush_buffers();
         $this->iCurrTime = $curr_time;
         $this->PingCount++;
     }
 }