Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane James Rose */ include "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; if (permission_exists('exec_command_line') || permission_exists('exec_php_command') || permission_exists('exec_switch')) { //access granted } else { echo "access denied"; exit; } //add multi-lingual support require_once "app_languages.php"; foreach($text as $key => $value) { $text[$key] = $value[$_SESSION['domain']['language']['code']]; } //get the html values and set them as variables if (count($_POST)>0) { $shell_cmd = trim($_POST["shell_cmd"]); $php_cmd = trim($_POST["php_cmd"]); $switch_cmd = trim($_POST["switch_cmd"]); } //show the header require_once "resources/header.php"; //edit area echo " \n"; echo " "; //show the header echo "
"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo " \n"; echo "\n"; //show the result if (count($_POST)>0) { echo " \n"; echo " \n"; echo " "; } //html form echo "\n"; if (permission_exists('exec_command_line')) { echo "\n"; echo "\n"; echo "
".$text['label-execute']."
\n"; echo " ".$text['description-execute']."\n"; echo "
\n"; echo "
\n"; echo "
\n"; //shell_cmd if (strlen($shell_cmd) > 0 && permission_exists('exec_command_line')) { echo "$shell_cmd\n"; echo "\n"; echo "
";
			echo htmlentities($shell_result);
			echo "
\n"; } //php_cmd if (strlen($php_cmd) > 0 && permission_exists('exec_php_command')) { //echo "\n"; echo "
";
			$php_result = eval($php_cmd);
			echo htmlentities($php_result);
			echo "
\n"; } //fs cmd if (strlen($switch_cmd) > 0 && permission_exists('exec_switch')) { echo "$switch_cmd\n"; echo "
";
			$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
			if ($fp) {
				$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
				//$switch_result = eval($switch_cmd);
				echo htmlentities($switch_result);
			}
			echo "
\n"; } echo "
\n"; echo "
\n"; echo " ".$text['label-shell'].":\n"; echo "\n"; echo "