From 3292439a61ddbf8e222093282873e079ca1748a6 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Thu, 9 Feb 2017 12:15:08 +0000 Subject: [PATCH] Disable terminal usage in demo mode --- lib/terminal-xhr.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/terminal-xhr.php b/lib/terminal-xhr.php index 6516057..df232fe 100644 --- a/lib/terminal-xhr.php +++ b/lib/terminal-xhr.php @@ -21,6 +21,13 @@ if(!empty($_REQUEST['command'])) { $output = "".$cwd."\n$> ".$_REQUEST['command']."\n\n"; } +// If in demo mode, display message and go no further +if ($demoMode) { + $output .= "Sorry, shell usage not enabled in demo mode\n\n"; + echo $output; + exit; +} + // If command contains cd but no dir if (preg_match('/^[[:blank:]]*cd[[:blank:]]*$/', @$_REQUEST['command'])) { $_SESSION['cwd'] = getcwd(); //dirname(__FILE__);