Example #1
0
 //******************************************************
 $db = mysql_connect($hostnameBDD, $userBDD, $passBDD);
 mysql_select_db($database, $db);
 // *** Lecture BDD config  ***
 $sql = 'SELECT * FROM moteurs';
 $req = mysql_query($sql) or die('Erreur SQL !<p>' . $sql . '</p>' . mysql_error());
 if (NbOpensim() >= 4) {
     $btn = 'disabled';
 } else {
     $btn = $btnN3;
 }
 if (INI_Conf("Parametre_OSMW", "Autorized") == '1') {
     $btn = '';
 }
 // echo '<h4>Liste des Simulateurs ajoutes au Manager</h4>';
 echo '<p>Nombre total de Simulateurs <span class="badge">' . NbOpensim() . '</span></p>';
 echo '<table class="table table-hover">';
 echo '<tr>';
 echo '<th>Name</th>';
 echo '<th>Version</th>';
 echo '<th>Path</th>';
 echo '<th>HG url</th>';
 echo '<th>Database</th>';
 echo '<th>Edit</th>';
 echo '<th>Delete</th>';
 echo '</tr>';
 while ($data = mysql_fetch_assoc($req)) {
     echo '<tr>';
     echo '<form method=post action="">';
     echo '<input type="hidden" name="osAutorise" value="' . $data['osAutorise'] . '" >';
     echo '<tr>';
Example #2
0
                     $data = "";
                     while ($buf = fread($stream, 4096)) {
                         echo $data .= $buf . '<br>';
                     }
                     fclose($stream);
                 }
             }
         }
         //echo '<br>******************************** <br>Fin Config Serveur Name:'.INI_Conf_Moteur($key,"name").'<br>********************************<br>';
         //echo "<hr><br>";
     }
 }
 // *************** ACTION BOUTON TOUS ARRETER ***********************
 // *******************************************************************
 if ($_POST['cmd'] == 'TOUS ARRETER') {
     echo 'Nombre de serveurs : ' . NbOpensim() . '<br>';
     // on se connecte à MySQL
     $db = mysql_connect($hostnameBDD, $userBDD, $passBDD);
     mysql_select_db($database, $db);
     $sql = 'SELECT * FROM moteurs';
     $req = mysql_query($sql) or die('Erreur SQL !<br>' . $sql . '<br>' . mysql_error());
     while ($data = mysql_fetch_assoc($req)) {
         echo '<hr>Serveur Name:' . $data["name"] . ' - Version:' . $data["version"] . '<br>';
         echo $commande = "cd " . $data["address"] . ";./ScreenSend " . $data["name"] . " shutdown";
         // Test de connection par serveur *********************************
         if (!function_exists("ssh2_connect")) {
             die("function ssh2_connect doesn't exist");
         }
         // log in at server1.example.com on port 22
         if (!($con = ssh2_connect($hostnameSSH, 22))) {
             echo "fail: unable to establish connection\n";