<% local msg = {} if _SESSION["logined"] ~= nil then local domain = _GET["domain"] or _POST["domain"] if domain == nil then rawset(msg, "code", -2) rawset(msg, "error", "Domain does not exist!") print(json.encode(msg)) else local data= {} rawset(data, "welcome", c_GetOptionStr(domain,DOPTION_MESSAGE_WELCOME_STR)) rawset(data, "login", c_GetOptionStr(domain,DOPTION_MESSAGE_LOGIN_STR)) rawset(data, "change_dir", c_GetOptionStr(domain,DOPTION_MESSAGE_CHANGE_DIR_STR)) rawset(data, "dir_list", c_GetOptionStr(domain,DOPTION_MESSAGE_DIR_LIST_STR)) rawset(data, "file_upload", c_GetOptionStr(domain,DOPTION_MESSAGE_FILE_UPLOAD_STR)) rawset(data, "file_download", c_GetOptionStr(domain,DOPTION_MESSAGE_FILE_DOWNLOAD_STR)) rawset(data, "system_command", c_GetOptionStr(domain,DOPTION_MESSAGE_SYSTEM_COMMAND_STR)) rawset(data, "quit_command", c_GetOptionStr(domain,DOPTION_MESSAGE_QUIT_COMMAND_STR)) rawset(msg, "code", 0) rawset(msg, "data", data) print(json.encode(msg)) end else rawset(msg, "code", -1) rawset(msg, "error", "not logged in") print(json.encode(msg)) end %>