<?
// controls_wml.php
//
// Copyright, Exolution GmbH / Michael Kerrisk, Sep 2000
// http://www.exolution.com/wapsh   mailto:wapsh@exolution.de
//
// This software is Open Source licensed under the terms of the Trolltech QPL
// version 1.0.  See http://www.exolution.de/wapsh for further information.
//
// ------------------------------------------------------------------------
//
// This is the main page for displaying shell output and reading shell input.
//
//
    require("common.inc");
    require("getloginhosts.inc");

    if (isset($ctype)) {
        $clientType = $ctype;
    }

    // Produce header dependent on client type

    if ($clientType == "http") {
        header("Content-type: text/html");
    } else {
        header("Content-type: text/vnd.wap.wml");
    }  
    require("displayfuncs.inc");
    if ($clientType == "http") {
        require("command_html.inc");
        require("common_html.inc");

    echo '<?xml version="1.0" encoding="iso-8859-1"?>';
?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>

<card title="<? echo SYSTEM_NAME; ?> Control Chars" newcontext="true">

<?
    if ($setOptions & OPT_ALLOWCONTROLCHARS == 0) {
	echo sParaBlk("Control characters are not enabled");
    } else {
	echo '<p>';

	echo 'Enter ctrl char ';
	echo '<input name="fCtrlChar" size="1" maxlength="1" format="*m"/>';

	wmlSubmitAnchor("Send ctrl char", "command.php", "post", 
		$shCommFields . '<postfield name="sendCtrl" value="y"/>' .
			'<postfield name="ctrlChar" value="$(fCtrlChar)"/>');

	echo '</p>';
	echo '<p>';

	echo '*** or select one of...';
	echo '<br/>';

	wmlSubmitAnchor("Interrupt (^C)", "command.php", "post", 
		$shCommFields . '<postfield name="intChar" value="y"/>');

	echo '<br/>';

	wmlSubmitAnchor("EOF (^D)", "command.php", "post", 
		$shCommFields . '<postfield name="eofChar" value="y"/>');

	echo '<br/>';

	wmlSubmitAnchor("Suspend (^Z)", "command.php", "post", 
		$shCommFields . '<postfield name="suspChar" value="y"/>');
	
	echo '<br/>';

	wmlSubmitAnchor("Quit (^\)", "command.php", "post", 
		$shCommFields . '<postfield name="quitChar" value="y"/>');
	
	echo '<br/>';

	wmlSubmitAnchor("Escape (^[)", "command.php", "post", 
		$shCommFields . '<postfield name="escChar" value="y"/>');
	
	echo '</p>';
    } // if

    wmlSoftkeyHomeLink();

?>

</card>
</wml>
