<% 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 data = {} rawset(data, "method", c_AccessDataWay(domain)) if (_SESSION["admin_readonly"] ~= nil and _SESSION["admin_readonly"] == 1) or (_SESSION["admin_domainadmin"] ~= nil and _SESSION["admin_domainadmin"] == 1) then rawset(data, "odbcusername", "*****") rawset(data, "odbcpassword", "*****") rawset(data, "mysqlusername", "*****") rawset(data, "mysqlpassword", "*****") rawset(data, "ldap_binddn", "*****") rawset(data, "ldap_bindpass", "*****") else rawset(data, "odbcusername", c_GetOptionStr(domain,DOPTION_DSN_USERNAME_STR)) rawset(data, "odbcpassword", c_GetOptionStr(domain,DOPTION_DSN_PASSWORD_STR)) rawset(data, "mysqlusername", c_GetOptionStr(domain,DOPTION_MYSQL_USERNAME_STR)) rawset(data, "mysqlpassword", c_GetOptionStr(domain,DOPTION_MYSQL_PASSWORD_STR)) rawset(data, "ldap_binddn", c_GetOptionStr(domain,DOPTION_LDAP_BINDDN_STR)) rawset(data, "ldap_bindpass", c_GetOptionStr(domain,DOPTION_LDAP_BINDPASS_STR)) end rawset(data, "odbcsource", c_GetOptionStr(domain,DOPTION_DSN_ADDRESS_STR)) rawset(data, "mysqlserver", c_GetOptionStr(domain,DOPTION_MYSQL_ADDRESS_STR)) rawset(data, "mysqlport", c_GetOptionInt(domain,DOPTION_MYSQL_PORT_INT)) rawset(data, "mysqldatabase", c_GetOptionStr(domain,DOPTION_MYSQL_DBNAME_STR)) rawset(data, "mysqlsocket", c_GetOptionStr(domain,DOPTION_MYSQL_UNIXSOCKET_STR)) rawset(data, "mysql_utf8", c_GetOptionInt(domain,DOPTION_MYSQL_SET_UTF8) == 1) rawset(data, "enable_aduser", c_GetOptionInt(domain,DOPTION_ENABLE_ADUSER_INT) == 1) rawset(data, "aduser_domain", c_GetOptionStr(domain,DOPTION_ADUSER_DOMAIN_STR)) rawset(data, "aduser_dir", c_GetOptionStr(domain,DOPTION_ADUSER_DIRPATH_STR)) rawset(data, "aduser_ntfs", c_GetOptionInt(domain,DOPTION_ENABLE_NTFS_PERMISSION) == 1) rawset(data, "aduser_owndir", c_GetOptionInt(domain,DOPTION_ADUSER_OWNDIR_INT) == 1) rawset(data, "fileread", c_GetOptionInt(domain,DOPTION_ADUSER_FILEREAD_INT) == 1) rawset(data, "filewrite", c_GetOptionInt(domain,DOPTION_ADUSER_FILEWRITE_INT)) rawset(data, "fileappend", c_GetOptionInt(domain,DOPTION_ADUSER_FILEAPPEND_INT) == 1) rawset(data, "filedelete", c_GetOptionInt(domain,DOPTION_ADUSER_FILEDELETE_INT) == 1) rawset(data, "filerename", c_GetOptionInt(domain,DOPTION_ADUSER_FILERENAME_INT) == 1) rawset(data, "dirlist", c_GetOptionInt(domain,DOPTION_ADUSER_DIRLIST_INT) == 1) rawset(data, "dirmake", c_GetOptionInt(domain,DOPTION_ADUSER_DIRCREATE_INT) == 1) rawset(data, "dirdelete", c_GetOptionInt(domain,DOPTION_ADUSER_DIRDELETE_INT) == 1) rawset(data, "dirrename", c_GetOptionInt(domain,DOPTION_ADUSER_DIRRENAME_INT) == 1) rawset(data, "zipfile", c_GetOptionInt(domain,DOPTION_ADUSER_ZIPFILE_INT) == 1) rawset(data, "unzipfile", c_GetOptionInt(domain,DOPTION_ADUSER_UNZIPFILE_INT) == 1) rawset(data, "enable_ldap", c_GetOptionInt(domain,DOPTION_ENABLE_LDAP_INT) == 1) rawset(data, "ldap_host", c_GetOptionStr(domain,DOPTION_LDAP_HOST_STR)) rawset(data, "ldap_port", c_GetOptionInt(domain,DOPTION_LDAP_PORT_INT)) rawset(data, "ldap_usessl", c_GetOptionInt(domain,DOPTION_LDAP_USESSL_INT) == 1) rawset(data, "ldap_basedn", c_GetOptionStr(domain,DOPTION_LDAP_BASEDN_STR)) rawset(data, "ldap_filter", c_GetOptionStr(domain,DOPTION_LDAP_FILTER_STR)) rawset(data, "ldap_version", c_GetOptionInt(domain,DOPTION_LDAP_VERSION_INT)) rawset(data, "ldap_timeout", c_GetOptionInt(domain,DOPTION_LDAP_TIMEOUT_INT)) rawset(data, "ldap_dir", c_GetOptionStr(domain,DOPTION_LDAP_DIRPATH_STR)) rawset(data, "ldap_owndir", c_GetOptionInt(domain,DOPTION_LDAP_OWNDIR_INT) == 1) rawset(data, "ldap_dir_lowercase", c_GetOptionInt(domain,DOPTION_LDAP_DIR_LOWERCASE_INT) == 1) rawset(data, "ldap_fileread", c_GetOptionInt(domain,DOPTION_LDAP_FILEREAD_INT) == 1) rawset(data, "ldap_filewrite", c_GetOptionInt(domain,DOPTION_LDAP_FILEWRITE_INT) == 1) rawset(data, "ldap_fileappend", c_GetOptionInt(domain,DOPTION_LDAP_FILEAPPEND_INT) == 1) rawset(data, "ldap_filedelete", c_GetOptionInt(domain,DOPTION_LDAP_FILEDELETE_INT) == 1) rawset(data, "ldap_filerename", c_GetOptionInt(domain,DOPTION_LDAP_FILERENAME_INT) == 1) rawset(data, "ldap_dirlist", c_GetOptionInt(domain,DOPTION_LDAP_DIRLIST_INT) == 1) rawset(data, "ldap_dirmake", c_GetOptionInt(domain,DOPTION_LDAP_DIRCREATE_INT) == 1) rawset(data, "ldap_dirdelete", c_GetOptionInt(domain,DOPTION_LDAP_DIRDELETE_INT) == 1) rawset(data, "ldap_dirrename", c_GetOptionInt(domain,DOPTION_LDAP_DIRRENAME_INT) == 1) rawset(data, "ldap_zipfile", c_GetOptionInt(domain,DOPTION_LDAP_ZIPFILE_INT) == 1) rawset(data, "ldap_unzipfile", c_GetOptionInt(domain,DOPTION_LDAP_UNZIPFILE_INT) == 1) rawset(data, "mapping_value", (c_GetOptionStr(domain,DOPTION_ADUSER_MAPPING_STR))) rawset(data, "ldap_mapping_value", (c_GetOptionStr(domain,DOPTION_LDAP_MAPPING_STR))) rawset(data, "ldap_groupmapping_value", (c_GetOptionStr(domain,DOPTION_LDAP_GROUP_MAPPING_STR))) rawset(data, "mapping_case_insensitive", c_GetOptionInt(domain,DOPTION_LDAPMAP_CASE_INSENSITIVE) == 1) rawset(data, "os", c_GetOsType()) 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 %>