<?php
$ssh2 = new ogcp_ssh2();
if($ssh2->ConnectwAuth($serverinfo["MachIP"],(int)$serverinfo["MachPort"],$serverinfo["MachUser"],$serverinfo["MachPass"])) {
$icerik = stream_get_contents($ssh2->Exec('cd '.$serverinfo["ServerPath"].'; tail -15 screenlog.0'));
} else {
$icerik = "";
}
if(isset($_POST["sbmt"], $_POST["cmdd"])) {
$_POST["cmdd"] = strip_tags(htmlspecialchars(addslashes($_POST["cmdd"])));
$durum = false;
$bad_commands = array(
"screen","-dr","-X","quit","shutdown","exit",";","sv_downloadurl","hostname","rcon_password","sv_contact","sv_maxrate","sv_minrate","sv_maxupdaterate","sv_minupdaterate","sys_ticrate","fps_max","fps_modem"
);
for($i=0; $i < count($bad_commands); $i++) {
if(strpos($_POST["cmdd"],$bad_commands[$i]) !== false) { $durum = true; break; }
}
$komut = "screen -S {$serverinfo["Screen"]} -X -p0 eval \"stuff '{$_POST["cmdd"]}'^m\"";
if(!$durum) {
$shell = @$ssh2->Exec($komut);
} else {
$shell = false;
}
if($shell != false) {
print('<div class="alert success"><span class="hide">×</span><strong>Başarılı!</strong> '.$_POST["cmdd"].' komutu gonderildi!</div>');
$icerik = stream_get_contents(@$ssh2->Exec('cd '.$serverinfo["ServerPath"].'; tail -15 screenlog.0'));
} else {
print('<div class="alert error"><span class="hide">×</span><strong>Başarısız!</strong> '.$_POST["cmdd"].' komutu gonderilemedi!</div>');
}
}
?>
How can I make the screen managers live? I have provided the html and php codes above, I would appreciate if you could help :)