require "auth.php";
if (!defined("LOCALE_LIBRARY")) {
    include LIBRARY_PATH . "locale.library";
}
if (!defined("OOPHTML_LIBRARY")) {
    include LIBRARY_PATH . "oophtml.library";
}
if (!defined("ADMINGUI_LIBRARY")) {
    include LIBRARY_PATH . "admingui.library";
}
if (!defined("MODULES_LIBRARY")) {
    include LIBRARY_PATH . "modules.library";
}
$adloc = new Locale("xmlrpcgateway", AMP_LOCALE);
$page = new HtmlPage($adloc->GetStr("title"));
$page->add(pagecaption($adloc->GetStr("title")));
$modcfg = new moduleconfig($env["ampdb"], "xmlrpcgateway");
switch ($env["disp"]["pass"]) {
    case "setcfg":
        $modcfg->setkey("DEST_HOST", $env["disp"]["desthost"]);
        $modcfg->setkey("DEST_PORT", $env["disp"]["destport"]);
        $modcfg->setkey("DEST_CGI", $env["disp"]["destcgi"]);
        break;
}
switch ($env["disp"]["act"]) {
    case "def":
        $table[0][0] = new htmltext($adloc->GetStr("hostdesc"));
        $table[1][0] = new htmlformtext("", "desthost", $modcfg->getkey("DEST_HOST"), "", 20);
        $table[0][1] = new htmltext($adloc->GetStr("hostnote"));
        $table[0][1]->colspan = 2;
        $table[0][2] = new htmltext($adloc->GetStr("portdesc"));