Skip to content
Permalink
Browse files

Added RCON and SSH path check

  • Loading branch information...
Maxelweb committed May 1, 2018
1 parent 4766d44 commit e4fb8007a68e7dcc353cebc27c1c21769aef02c9
@@ -37,20 +37,39 @@
else
{
echo "Starting configuration, please wait...<br>";
if($ercon)
{
$query = new SampRcon($ips, $port, $rcon);
if(!$query->connect())
die(No("Connection error. Retry.",1));
if(count($query->getCommandList()) <= 1) // if invalid, returns one element with error message
exit(No("RCON password - The RCON is invalid, please insert a valid RCON to continue."));
else
Ok("RCON password - Accepted.<br>");
}
if($essh)
{
$ssh = new Net_SSH2($ips);
if (!$ssh->login($user, $pass))
exit(No('<b>SSH access</b> - Login incorrect. Please, retry.'));
exit(No('SSH access - Login incorrect. Please, retry.'));
else
Ok('<b>SSH access</b> - Done. <br>');
{
if(trim($ssh->exec('find '.$path.'samp03svr')) != $path."samp03svr")
exit(No("SSH access - Login correct, but <u>invalid server path</u>. The path should contains the <code>samp03svr</code> execution file as well as the basic SA-MP files and folders."));
else
Ok('SSH access - Done. <br>');
}
}
$rcon = str_replace('"', '\"', $rcon);
$pass = str_replace('"', '\"', $pass);
echo "Starting configuration, please wait...<br>";
sleep(1);
$configFile = fopen("./includes/Config/parameters.config.php", "w+") or die($errorPermissions);
@@ -130,7 +149,7 @@
{
$lock = fopen("installed.lock", "x");
if($lock) Ok("Configuration completed! Wait..");
else die($errorPermissions."3");
else die($errorPermissions);
sleep(1);
location("install.php");
}
@@ -0,0 +1,13 @@

<?php
// THIS IS AN AUTO-GENERATED FILE. DON'T EDIT!
// -- SERVER REMOTE CONSOLE GUEST PAGE --
$gpage = (object) array
(
"ServerName" => "Server Tracker" ,
"ShowPlayersList" => 1 ,
"EnableStatus" => 1
);
?>
@@ -0,0 +1,14 @@

<?php
// THIS IS AN AUTO-GENERATED FILE. DON'T EDIT!
// -- SERVER REMOTE CONSOLE MODES --
$config = (object) array
(
"ShowRCON" => 1 ,
"EnableGuestPage" => 1 ,
"EnableRCON" => 1 ,
"EnableSSH" => 1
);
?>
@@ -0,0 +1,15 @@

<?php
// THIS IS AN AUTO-GENERATED FILE. BEFORE EDITING, VIEW THE DOCUMENTATION!
// -- SERVER REMOTE CONSOLE CONFIG_PARAMETERS --
@define(SRC_PASSWORD, "ciaone");
@define(IP_SERVER, "192.168.1.7");
@define(PORT_SERVER, "7777");
@define(RCON_SERVER, "ciao");
@define(SERVER_SSH_USER, "maxel");
@define(SERVER_SSH_PSW, "masterkey00");
@define(SERVER_SSH_PATH, "samp03/");
?>
@@ -20,6 +20,7 @@
error_reporting(E_ERROR);
set_include_path(get_include_path() . PATH_SEPARATOR . 'resources');
include('Net/SSH2.php');
require("includes/Class/SampRcon.class.php");
require('includes/environment.php');
require('includes/functions.php');

0 comments on commit e4fb800

Please sign in to comment.
You can’t perform that action at this time.