/var/log/sslvpn/messages") local outputFile = db.getAttribute("environment", "name", "SSL_VPN_LOG_FILE_NAME", "value") if (ButtonType and ButtonType == "clear") then if (ACCESS_LEVEL ~= 0) then statusMessage = db.getAttribute("stringsMap", "stringId", "ADMIN_REQD", LANGUAGE) else os.execute ("echo '' > " .. outputFile) local valid = false local sslLogs = db.getRowsWhere("eventLog","component='UMI_COMP_SSLVPN'") local i = 0 if(#sslLogs ~= 0 and sslLogs ~= nil) then for k,v in pairs(sslLogs) do i = i + 1 local row = sslLogs[i] if(row ~= nil) then valid = db.deleteRowWhere("eventLog","_ROWID_=" .. row["eventLog._ROWID_"]) end end if(valid) then db.save() statusMessage = db.getAttribute("stringsMap", "stringId", "STATUS_OK", LANGUAGE) else db.rollback() statusMessage = "Clear Logs Failed" end end end web.goToPage(NextPage,true,true) else outputText = util.fileToString(outputFile) realoutputText="" sep = "\n" fields = {} outputText:gsub("([^".. sep .."]*)"..sep, function(c) table.insert(fields, c) end) for i,k in ipairs(fields) do realoutputText ="".. k.. sep .. realoutputText end outputText ="" .. realoutputText .. "" ?>