<%
// This file is used SERVER SIDE only, it MUST comply to ECMA Script 5.1 and not
// use jQuery or any other client side extensions.
//
// e.g. ECMA Script 5.1 cannot parse ISO DateTime strings

"use strict";

import "/js/utility.js"

function saveWebFrontendSettings()
{

    var myth = new Myth();

    var list = getArg("setting");
    var ret = "";
    for (var key in list)
    {
        //var key = Object.keys(list)[i];
        var value = list[key];
        myth.PutSetting(myth.GetHostName(), key, value);
    }

    return ret;
}

var ret = "ERROR";
switch (getArg("_action")) // _action to avoid conflicts with http form's "action"
{
    case "saveWebFrontendSettings":
        ret = saveWebFrontendSettings();
        break;
    default:
        break;
}
%>
<%=ret%>