Exemple #1
0
## 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";
    */
    ?>
<!--<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>PHP-Terminal </title>
  <?php 
    $terminal->setTerminalColor(@$_SESSION['color']);
    ?>