<% local msg = {} if _SESSION["logined"] ~= nil then local domain = _GET["domain"] or _POST["domain"] if domain == nil or c_IsGrantedDomainAdmin(domain) == false then rawset(msg, "code", -2) rawset(msg, "error", "no permission") print(json.encode(msg)) else local salt_string = c_GetOptionStr(domain,DOPTION_SALTING_STRING) if (_SESSION["admin_readonly"] ~= nil and _SESSION["admin_readonly"] == 1) or (_SESSION["admin_domainadmin"] ~= nil and _SESSION["admin_domainadmin"] == 1) then salt_string = "" end local data = {} rawset(data, "salting_string", salt_string) rawset(data, "enable_fxp", c_GetOptionInt(domain,DOPTION_ENABLE_FXP_INT) == 1) rawset(data, "enable_utf8_on", c_GetOptionInt(domain,DOPTION_ENABLE_UTF8ON) == 1) rawset(data, "enable_auth_tls", c_GetOptionInt(domain,DOPTION_ENABLE_AUTH) == 1) rawset(data, "list_time_gmt", c_GetOptionInt(domain,DOPTION_LIST_TIME_GMT) == 1) rawset(data, "enable_domain_logo", c_GetOptionInt(domain,DOPTION_ENABLE_DOMAINLOGO_INT) == 1) rawset(data, "enable_welcome_message", c_GetOptionInt(domain,DOPTION_ENABLE_WELCOME_MSG) == 1) rawset(data, "welcome_message", c_GetOptionStr(domain,DOPTION_WELCOME_MESSAGE)) rawset(data, "buffer_size", c_GetOptionInt(domain,DOPTION_BUFFERSIZE_INT)) rawset(data, "ssh_banner", c_GetOptionStr(domain,DOPTION_SSH_BANNER)) rawset(data, "nowcert", c_GetOptionStr(domain,DOPTION_SSL_NAME_STR)) rawset(data, "ssl_cert_list", c_GetSSLCertList()) rawset(data, "nowkey", c_GetOptionStr(domain,DOPTION_SSH_NAME_STR)) rawset(data, "ssh_key_list", c_GetSSHKeyList()) rawset(data, "nowconf", c_GetOptionStr(domain,DOPTION_SMTP_NAME_STR)) rawset(data, "smtp_conf_list", Split(c_GetSMTPList(),"\n")) rawset(data, "enable_modez", c_GetOptionInt(domain,DOPTION_ENABLE_MODEZ_INT) == 1) rawset(data, "zlevel_default", c_GetOptionInt(domain,DOPTION_DEFAULT_ZLEVEL_INT)) rawset(data, "zlevel_min", c_GetOptionInt(domain,DOPTION_MIN_ZLEVEL_INT)) rawset(data, "zlevel_max", c_GetOptionInt(domain,DOPTION_MAX_ZLEVEL_INT)) rawset(data, "enable_log", c_GetOptionInt(domain,DOPTION_LOGFILE_ENABLE_INT) == 1) rawset(data, "log_filename", c_GetOptionStr(domain,DOPTION_LOGFILE_NAME_STR)) rawset(data, "log_maxsize", c_GetOptionInt(domain,DOPTION_LOGFILE_MAXSIZE_INT)) rawset(data, "log_compress", c_GetOptionInt(domain,DOPTION_LOGFILE_COMPRESS_INT) == 1) rawset(data, "log_millisecond", c_GetOptionInt(domain,DOPTION_ENABLE_LOG_MILLISECOND) == 1) rawset(data, "enable_logfile_message", c_GetOptionInt(domain,DOPTION_LOGFILE_MESSAGE_INT) == 1) rawset(data, "enable_logfile_security", c_GetOptionInt(domain,DOPTION_LOGFILE_SECURITY_INT) == 1) rawset(data, "enable_logfile_ftpcmd", c_GetOptionInt(domain,DOPTION_LOGFILE_FTP_COMMAND_INT) == 1) rawset(data, "enable_logfile_ftpresp", c_GetOptionInt(domain,DOPTION_LOGFILE_FTP_RESPONSE_INT) == 1) rawset(data, "enable_logfile_webcmd", c_GetOptionInt(domain,DOPTION_LOGFILE_WEB_COMMAND_INT) == 1) rawset(data, "enable_logfile_webresp", c_GetOptionInt(domain,DOPTION_LOGFILE_WEB_RESPONSE_INT) == 1) rawset(data, "enable_logfile_sshcmd", c_GetOptionInt(domain,DOPTION_LOGFILE_SSH_COMMAND_INT) == 1) rawset(data, "enable_logfile_sshresp", c_GetOptionInt(domain,DOPTION_LOGFILE_SSH_RESPONSE_INT) == 1) rawset(data, "enable_logfile_odbcerr", c_GetOptionInt(domain,DOPTION_LOGFILE_ODBC_ERROR_INT) == 1) rawset(data, "enable_logfile_mysqlerr", c_GetOptionInt(domain,DOPTION_LOGFILE_MYSQL_ERROR_INT) == 1) rawset(data, "enable_logfile_luaerr", c_GetOptionInt(domain,DOPTION_LOGFILE_LUA_ERROR_INT) == 1) rawset(data, "enable_logfile_mailerr", c_GetOptionInt(domain,DOPTION_LOGFILE_MAIL_ERROR_INT) == 1) rawset(data, "enable_logfile_fileerr", c_GetOptionInt(domain,DOPTION_LOGFILE_FILE_ERROR_INT) == 1) rawset(data, "enable_logfile_normalerr", c_GetOptionInt(domain,DOPTION_LOGFILE_NORMAL_ERROR_INT) == 1) rawset(data, "enable_logscrn_message", c_GetOptionInt(domain,DOPTION_LOGSCREEN_MESSAGE_INT) == 1) rawset(data, "enable_logscrn_security", c_GetOptionInt(domain,DOPTION_LOGSCREEN_SECURITY_INT) == 1) rawset(data, "enable_logscrn_ftpcmd", c_GetOptionInt(domain,DOPTION_LOGSCREEN_FTP_COMMAND_INT) == 1) rawset(data, "enable_logscrn_ftpresp", c_GetOptionInt(domain,DOPTION_LOGSCREEN_FTP_RESPONSE_INT) == 1) rawset(data, "enable_logscrn_webcmd", c_GetOptionInt(domain,DOPTION_LOGSCREEN_WEB_COMMAND_INT) == 1) rawset(data, "enable_logscrn_webresp", c_GetOptionInt(domain,DOPTION_LOGSCREEN_WEB_RESPONSE_INT) == 1) rawset(data, "enable_logscrn_sshcmd", c_GetOptionInt(domain,DOPTION_LOGSCREEN_SSH_COMMAND_INT) == 1) rawset(data, "enable_logscrn_sshresp", c_GetOptionInt(domain,DOPTION_LOGSCREEN_SSH_RESPONSE_INT) == 1) rawset(data, "enable_logscrn_odbcerr", c_GetOptionInt(domain,DOPTION_LOGSCREEN_ODBC_ERROR_INT) == 1) rawset(data, "enable_logscrn_mysqlerr", c_GetOptionInt(domain,DOPTION_LOGSCREEN_MYSQL_ERROR_INT) == 1) rawset(data, "enable_logscrn_luaerr", c_GetOptionInt(domain,DOPTION_LOGSCREEN_LUA_ERROR_INT) == 1) rawset(data, "enable_logscrn_mailerr", c_GetOptionInt(domain,DOPTION_LOGSCREEN_MAIL_ERROR_INT) == 1) rawset(data, "enable_logscrn_fileerr", c_GetOptionInt(domain,DOPTION_LOGSCREEN_FILE_ERROR_INT) == 1) rawset(data, "enable_logscrn_normalerr", c_GetOptionInt(domain,DOPTION_LOGSCREEN_NORMAL_ERROR_INT) == 1) rawset(data, "max_session", c_GetOptionInt(domain,DOPTION_DOMAIN_MAX_SESSION_INT)) rawset(data, "max_ipsession", c_GetOptionInt(domain,DOPTION_DOMAIN_PER_IP_MAX_SESSION_INT)) rawset(data, "max_session_per_user", c_GetOptionInt(domain,DOPTION_PER_ACCOUNT_MAX_SESSIONS_INT)) rawset(data, "max_ipsession_for_user", c_GetOptionInt(domain,DOPTION_PER_ACCOUNT_PER_IP_MAX_SESSIONS_INT)) rawset(data, "connection_timeout", c_GetOptionInt(domain,DOPTION_COMMAND_TIMEOUT_INT)) rawset(data, "data_transfer_timeout", c_GetOptionInt(domain,DOPTION_TRANSFER_TIMEOUT_INT)) rawset(data, "http_keepalive", c_GetOptionInt(domain,DOPTION_HTTP_KEEP_ALIVE) == 1) rawset(data, "tls_session_timeout", c_GetOptionInt(domain,DOPTION_TLS_SESSION_TIMEOUT)) rawset(data, "domain_downspeed", c_GetOptionInt(domain,DOPTION_DOMAIN_MAX_DOWN_SPEED_INT)) rawset(data, "domain_upspeed", c_GetOptionInt(domain,DOPTION_DOMAIN_MAX_UP_SPEED_INT)) rawset(data, "session_downspeed", c_GetOptionInt(domain,DOPTION_PER_SESSION_MAX_DOWN_SPEED_INT)) rawset(data, "session_upspeed", c_GetOptionInt(domain,DOPTION_PER_SESSION_MAX_UP_SPEED_INT)) rawset(data, "user_downspeed", c_GetOptionInt(domain,DOPTION_PER_USER_MAX_DOWN_SPEED_INT)) rawset(data, "user_upspeed", c_GetOptionInt(domain,DOPTION_PER_USER_MAX_UP_SPEED_INT)) rawset(data, "enable_weblink", c_GetOptionInt(domain,DOPTION_ENABLE_WEBLINK_INT) == 1) rawset(data, "enable_uploadlink", c_GetOptionInt(domain,DOPTION_ENABLE_UPLOADLINK_INT) == 1) rawset(data, "show_subfolder", c_GetOptionInt(domain,DOPTION_ENABLE_WEBLINK_SUBFOLDER) == 1) rawset(data, "keep_old_weblink", c_GetOptionInt(domain,DOPTION_KEEP_OLD_WEBLINK) == 1) rawset(data, "anonymous_weblink", c_GetOptionInt(domain,DOPTION_ANONYMOUS_WEBLINK) == 1) rawset(data, "uplink_overwrite", c_GetOptionInt(domain,DOPTION_UPLINK_OVERWRITE) == 1) rawset(data, "weblink_domain", c_GetOptionStr(domain,DOPTION_WEBLINK_URL)) rawset(data, "pasv_active", c_GetOptionInt(domain,DOPTION_ALLOW_PASSIVE_ACTIVE)) rawset(data, "pasv_method", c_GetOptionInt(domain,DOPTION_PASSTYPE_INT)) rawset(data, "pasv_fixed_ip", c_GetOptionStr(domain,DOPTION_FIXEDIP_STR)) rawset(data, "pasv_web_ip", c_GetOptionStr(domain,DOPTION_WEB_IP_STR)) rawset(data, "pasv_dns_ip", c_GetOptionStr(domain,DOPTION_DNS_IP_STR)) rawset(data, "pasv_ip_refresh", c_GetOptionInt(domain,DOPTION_PASV_IP_REFRESH_INTERVAL_INT)) rawset(data, "passive_listener_timeout", c_GetOptionInt(domain,DOPTION_PASSIVE_LISTENER_TIMEOUT)) rawset(data, "pasv_min_port", c_GetOptionInt(domain,DOPTION_PASSPORTMIN_INT)) rawset(data, "pasv_max_port", c_GetOptionInt(domain,DOPTION_PASSPORTMAX_INT)) rawset(data, "auto_pasv_ip", c_GetOptionInt(domain,DOPTION_USE_LOCAL_IP_PASSIVE_INT) == 1) rawset(data, "auto_passive_forward", c_GetOptionInt(domain,DOPTION_AUTO_PASSIVE_FORWARD) == 1) rawset(data, "auto_active_forward", c_GetOptionInt(domain,DOPTION_AUTO_ACTIVE_FORWARD) == 1) rawset(data, "enable_symbolic_link", c_GetOptionInt(domain,DOPTION_ENABLE_SYMBOLIC_LINK) == 1) rawset(data, "sha256_password", c_GetOptionInt(domain,DOPTION_ENABLE_SHA256) == 1) rawset(data, "enable_salting", c_GetOptionInt(domain,DOPTION_ENABLE_PASS_SALTING) == 1) rawset(data, "changepass_firstlogon", c_GetOptionInt(domain,DOPTION_CHANGEPASS_FIRSTLOGON) == 1) rawset(data, "min_password", c_GetOptionInt(domain,DOPTION_PASSWORD_LEN_INT)) rawset(data, "password_complexity1", c_GetOptionInt(domain,DOPTION_INC_NUMBER_INT) == 1) rawset(data, "password_complexity2", c_GetOptionInt(domain,DOPTION_INC_LOWERCASE_INT) == 1) rawset(data, "password_complexity3", c_GetOptionInt(domain,DOPTION_INC_UPPERCASE_INT) == 1) rawset(data, "password_complexity4", c_GetOptionInt(domain,DOPTION_INC_NONALPHANUMERIC_INT) == 1) rawset(data, "enable_hammer", c_GetOptionInt(domain,DOPTION_ANTI_HAMMER_ENABLE_INT) == 1) rawset(data, "send_message", c_GetOptionInt(domain,DOPTION_ANTI_HAMMER_SEND_MESSAGE_INT) == 1) rawset(data, "block_time", c_GetOptionInt(domain,DOPTION_ANTI_HAMMER_BLOCK_TIME_INT)) rawset(data, "failed_count", c_GetOptionInt(domain,DOPTION_ANTI_HAMMER_LOGIN_FAILED_COUNTS_INT)) rawset(data, "failed_interval", c_GetOptionInt(domain,DOPTION_ANTI_HAMMER_INTERVAL_INT)) rawset(data, "enable_https_redirect", c_GetOptionInt(domain,DOPTION_ENABLE_HTTPS_REDIRECT) == 1) rawset(data, "https_redirect_port", c_GetOptionInt(domain,DOPTION_HTTPS_REDIRECT_PORT)) rawset(data, "http_headers", c_GetOptionStr(domain,DOPTION_HTTP_HEADER_STR)) rawset(data, "log_permission", c_GetOptionStr(domain,DOPTION_LOG_FILE_PERM)) rawset(msg, "code", 0) rawset(msg, "data", data) print(json.encodeReplace(msg)) end else rawset(msg, "code", -1) rawset(msg, "error", "not logged in") print(json.encode(msg)) end %>