|
18 | 18 | $pass = $_POST['pass'];
|
19 | 19 | $path = $_POST['path'];
|
20 | 20 |
|
| 21 | + $finstall = $_POST['finstall']; |
21 | 22 |
|
22 | 23 | $ercon = (int)$_POST['ercon'];
|
23 | 24 | $essh = (int)$_POST['essh'];
|
|
39 | 40 |
|
40 | 41 | echo "Starting configuration, please wait...<br>";
|
41 | 42 |
|
42 |
| - if($ercon) |
43 |
| - { |
44 |
| - $query = new SampRcon($ips, $port, $rcon); |
45 |
| - if(!$query->connect()) |
46 |
| - die(No("Connection error. Retry.",1)); |
47 |
| - |
48 |
| - if(count($query->getCommandList()) <= 1) // if invalid, returns one element with error message |
49 |
| - exit(No("RCON password - The RCON is invalid, please insert a valid RCON to continue. Make sure there's no <code>rcon 0</code> in your <code>server.cfg</code>. Otherwise, change it to <code>rcon 1</code> to enable remote rcon commands.")); |
50 |
| - else |
51 |
| - Ok("RCON password - Accepted.<br>"); |
52 |
| - } |
53 |
| - |
54 |
| - if($essh) |
| 43 | + if($finstall) |
| 44 | + No("[FORCE INSTALLATION] RCON and SSH controls have been skipped!<br>"); |
| 45 | + else |
55 | 46 | {
|
56 |
| - $ssh = new Net_SSH2($ips); |
57 |
| - if (!$ssh->login($user, $pass)) |
58 |
| - exit(No('SSH access - Login incorrect. Please, retry.')); |
59 |
| - else |
60 |
| - { |
61 |
| - if(trim($ssh->exec('find '.$path.'samp03svr')) != $path."samp03svr") |
62 |
| - 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.")); |
63 |
| - else |
64 |
| - Ok('SSH access - Done. <br>'); |
65 |
| - } |
| 47 | + if($ercon) |
| 48 | + { |
| 49 | + $query = new SampRcon($ips, $port, $rcon); |
| 50 | + if(!$query->connect()) |
| 51 | + die(No("Connection error. Retry.",1)); |
| 52 | + |
| 53 | + if(count($query->getCommandList()) <= 1) // if invalid, returns one element with error message |
| 54 | + exit(No("RCON password - The RCON is invalid, please insert a valid RCON to continue. Make sure there's no <code>rcon 0</code> in your <code>server.cfg</code>. Otherwise, change it to <code>rcon 1</code> to enable remote rcon commands.")); |
| 55 | + else |
| 56 | + Ok("RCON password - Accepted.<br>"); |
| 57 | + } |
| 58 | + |
| 59 | + if($essh) |
| 60 | + { |
| 61 | + $ssh = new Net_SSH2($ips); |
| 62 | + if (!$ssh->login($user, $pass)) |
| 63 | + exit(No('SSH access - Login incorrect. Please, retry.')); |
| 64 | + else |
| 65 | + { |
| 66 | + if(trim($ssh->exec('find '.$path.'samp03svr')) != $path."samp03svr") |
| 67 | + 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.")); |
| 68 | + else |
| 69 | + Ok('SSH access - Done. <br>'); |
| 70 | + } |
| 71 | + } |
66 | 72 | }
|
67 | 73 |
|
68 | 74 |
|
69 |
| - |
70 | 75 | $rcon = str_replace('"', '\"', $rcon);
|
71 | 76 | $pass = str_replace('"', '\"', $pass);
|
72 | 77 |
|
|
150 | 155 | $lock = fopen("installed.lock", "x");
|
151 | 156 | if($lock) Ok("Configuration completed! Wait..");
|
152 | 157 | else die($errorPermissions);
|
153 |
| - sleep(1); |
| 158 | + sleep(3); |
154 | 159 | location("install.php");
|
155 | 160 | }
|
156 | 161 | else
|
|
0 commit comments