forked from masterking32/WoWServerWebTerminal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathajax.php
53 lines (50 loc) · 1.44 KB
/
ajax.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* @author Amin Mahmoudi (MasterkinG)
* @copyright Copyright (c) 2019 - 2022, MsaterkinG32 Team, Inc. (https://masterking32.com)
* @link https://masterking32.com
* @Github https://github.com/masterking32/wow-telegram
* @Description It's not masterking32 framework !
*/
include 'config.php';
if (empty($_SESSION["CM_Login"])) {
echo "Need to login!";
exit();
}
if (empty($_POST['command'])) {
echo "Command is not valid !";
exit();
}
if(is_array($_POST['command']))
{
echo "Command is not valid !";
exit();
}
$result = 'No have result!';
try {
$conn = new SoapClient(NULL, array(
'location' => 'http://' . $soap_connection_info['soap_host'] . ':' . $soap_connection_info['soap_port'] . '/',
'uri' => $soap_connection_info['soap_uri'],
'style' => SOAP_RPC,
'login' => $soap_connection_info['soap_user'],
'password' => $soap_connection_info['soap_pass']
));
$result = $conn->executeCommand(new SoapParam($_POST['command'], 'command'));
unset($conn);
} catch (Exception $e) {
if (!empty(Debug_Mode)) {
$result = $e;
} else {
$result = 'Have error on soap!';
}
if (strpos($e, 'There is no such command') !== false) {
$result = 'There is no such command!';
}
}
$paragraphs = '';
foreach (explode("\n", $result) as $line) {
if (trim($line)) {
$paragraphs .= '<p>' . $line . '</p>';
}
}
echo $paragraphs;