Exemple #1
0
                proc_close($p);
            } else {
                $stdout = shell_exec($_REQUEST['command']);
                $_SESSION['output'] .= htmlspecialchars($stdout, ENT_COMPAT, 'UTF-8');
            }
        }
    }
}
// end phpTerm
/*##########################################################
## The main thing starts here
## All output ist XHTML
##########################################################*/
$terminal = new phpTerm();
$terminal->logout(@$_GET['logout']);
if (!$terminal->checkPassword($passwd)) {
    header('WWW-Authenticate: Basic realm="PHP-Terminal"');
    header('HTTP/1.0 401 Unauthorized');
} else {
    $terminal->initVars();
    $terminal->buildCommandHistory();
    $terminal->buildJavaHistory();
    if (!isset($_SESSION['prompt'])) {
        $terminal->formatPrompt();
    }
    $terminal->outputHandle($aliases);
    if (isset($_GET['color'])) {
        $_SESSION['color'] = $_GET['color'];
    }
    /*
    echo '<?xml version="1.0" encoding="UTF-8" ?>' . "\n";