////////////////////////////////////////////////////////////// // Exit ////////////////////////////////////////////////////////////// $_SESSION['term_auth'] = 'false'; $output = '[CLOSED]'; } else { if (!isset($_SESSION['term_auth']) || $_SESSION['term_auth'] != 'true') { ////////////////////////////////////////////////////////////// // Authentication ////////////////////////////////////////////////////////////// if ($command == PASSWORD) { $_SESSION['term_auth'] = 'true'; $output = '[AUTHENTICATED]'; } else { $output = 'Enter Password:'******''; $command = explode("&&", $command); foreach ($command as $c) { $Terminal->command = $c; $output .= $Terminal->Process(); } } } echo htmlentities($output);
} else { ////////////////////////////////////////////////////////////// // Execution ////////////////////////////////////////////////////////////// // Split && $Terminal = new Terminal(); $output = ''; $command = explode("&&", $command); foreach ($command as $c) { if ($c == "cd") { $c .= ' ' . ROOT; } else { if ($c == "l") { $c .= "s"; } else { if ($c == "la") { $c = "ls -a"; } else { if ($c == "lal") { $c = "ls -al"; } } } } $Terminal->command = $c; $result = $Terminal->Process(); $output .= $result; } } } echo htmlentities($output);