alors je vais plutôt faire un petit schéma
SITE WEB-------------------------------------MACHINE
page accueil------------------------page restart
Intégrer page restart dans page accueil
Sachant que page restart protégée par .htaccess
Est-ce compréhensible ? :$
Sinon je vais vous mettre les codes peut-être ?
Page Accueil
<?php
// -------------------------------------------------------------------------//
// Nuked-KlaN - PHP Portal //
// http://www.nuked-klan.org //
// -------------------------------------------------------------------------//
// This program is free software. you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License. //
// -------------------------------------------------------------------------//
if (!defined("INDEX_CHECK"))
{
die ("<div style=\"text-align: center;\">You cannot open this page directly</div>");
}
global $nuked, $language, $user;
translate("modules/News/lang/" . $language . ".lang.php");
// Inclusion système Captcha
if (!$user)
{
$visiteur = 0;
}
else
{
$visiteur = $user[1];
}if ($visiteur >= 3){
?>
<div id="centre">
<div style="width:100%; height:19px;"></div>
<div style="background-color:#ecf6f;padding:10px;border:double 4px #207bdf;width:auto;text-align:center;display:none;" id="NKmess"></div>
<div class="news">
<div class="titre_news">
<h2>Page D'administration du serveur</h2>
</div>
<div class="cont_news" style="display: block; ">
<div>
<?php
include_once ("play.team-nc.fr/restart_skp/index.php");
?>
</div>
</div>
</div>
</div>
<?php
}
else
{
?>
<div id="centre">
<div class="cont_news" style="display: block; ">
<h2>Vous n'avez pas accès à cette page !</h2>
</div>
</div>
<?php
}
?>
Page restart
<?php
function sendcmd($cmd){
if (!function_exists("ssh2_connect")) die("function ssh2_connect doesn't exist");
if(!($con = ssh2_connect("**.**.**.**", 22))){
echo "fail: unable to establish connection\n";
} else {
if(!ssh2_auth_password($con, "**********", "***********")) {
echo "fail: unable to authenticate\n";
} else {
echo "Redémarré."; ?>
<html>
<head>
<meta http-equiv="refresh" content="2; URL=index.php?file=Restart_skp">
</head>
</html>
<?php
if (!($stream = ssh2_exec ($con, $cmd ))) {
echo "fail: unable to execute command\n";
}
}
}
}
if (isset($_POST['submitted'])) {
if ($_POST['public'] == "yes")
sendcmd("screen -S SKP -X quit;cd /root/SKP/COD6/;screen -A -d -m -S SKP wine iw4.exe +set party_maxplayers 16 +set net_port 28965 +exec server.cfg +map_rotate;cd /root/SKP/;screen -S SKPb -X quit;screen -A -d -m -S SKPb python ./B3/b3_run.py -c ./B3/b3/conf/b3.xml");
if ($_POST['publicb3'] == "yes")
sendcmd("cd /root/SKP/;screen -S SKPb -X quit;screen -A -d -m -S SKPb python ./B3/b3_run.py -c ./B3/b3/conf/b3.xml");
}
else {
?><div>
<form method="post" action="index.php">
<h2>Page de redémarrage :</h2>
<input type="hidden" name="submitted" value="" />
<h3>Public</h3>
<input type="checkbox" name="public" value="yes" /> Redémarrer le serveur<br />
<input type="checkbox" name="publicb3" value="yes" /> Redémarrer le B3<br />
<input type="submit" value="Redémarrer" />
</form></div>
<?php
}
?>