* You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ require_once '../../core/init.php'; $user->checkLogin(true); // Check his rights if ($userInfo['rights_igcmds'] < 100) { header('Location: ' . HOME_URL . 'panel/accessDenied.php'); die; } // In-game command class $igc = new IgCommands(null, null, null, null, $db, $config, null, $settings); $pageTitle = $lang['tool_igcmds']; include CORE_DIR . '/cp_header.php'; if (isset($_GET['id'])) { $cmd = $igc->getCommand($_GET['id']); } else { $cmd = $igc->getCommand(0); } if ($cmd['code'] == 'OK') { $cmd = $cmd['cmd']; $status = ''; if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['cmd']) && isset($_POST['func']) && isset($_POST['response']) && isset($_POST['rights'])) { sleep(2); $errors = array(); // Clean the post variables foreach ($_POST as $key => $value) { $_POST[$key] = trim($value); } // Some checks // Check command
include CORE_DIR . '/cp_header.php'; $status = ''; if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['cmd']) && isset($_POST['func']) && isset($_POST['response']) && isset($_POST['rights'])) { sleep(2); $errors = array(); // Clean the post variables foreach ($_POST as $key => $value) { $_POST[$key] = trim($value); } // Some checks // Check command if (empty($_POST['cmd'])) { $errors[] = $lang['tool_acc_err2']; } // Check if command exits $result = $igc->getCommand(strtolower($_POST['cmd'])); if ($result['code'] == 'OK') { $errors[] = $lang['tool_igcmds_err3']; } // Check function $cmds = $igc->getAvailableCmdFunctions(); if (!isset($cmds[$_POST['func']])) { $errors[] = $lang['tool_igcmds_err4']; } // Check response if (strlen($_POST['response']) > 75) { $errors[] = $lang['tool_igcmds_err5']; } // Set the private response setting $_POST['response_priv'] = 'no'; if (isset($_POST['response_priv'])) {