Skip to content
Snippets Groups Projects
Commit eb4cee6d authored by Carsten  Rose's avatar Carsten Rose
Browse files

Reformat debug code

parent f57ddcd5
No related branches found
No related tags found
No related merge requests found
Pipeline #5088 passed
...@@ -127,8 +127,12 @@ Mail Log page (Table MailLog) ...@@ -127,8 +127,12 @@ Mail Log page (Table MailLog)
For debugging purposes you may like to add a Mail Log page in the frontend. For debugging purposes you may like to add a Mail Log page in the frontend.
The following QFQ code could be used for that purpose (put it in a QFQ PageContent element) The following QFQ code could be used for that purpose (put it in a QFQ PageContent element)
Note: If you do not use/have the Ggroup table, then remove the "# Filters" block. .. warning::
::
Use this code only on access restricted pages. GET/POST Parameter might be used to get access to unintended content.
Note: If you do not use/have the Ggroup table, then remove the "# Filters" block.::
# Page parameters # Page parameters
1.sql = SELECT @grId := '{{grId:C0:digit}}' AS _grId 1.sql = SELECT @grId := '{{grId:C0:digit}}' AS _grId
...@@ -194,9 +198,11 @@ Setup in :ref:`configuration` ...@@ -194,9 +198,11 @@ Setup in :ref:`configuration`
Show log files realtime Show log files realtime
----------------------- -----------------------
Display QFQ log files in realtime. .. warning::
Use this code only on access restricted pages. GET/POST Parameter might be used to get access to unintended content.
The following QFQ code could be used for that purpose (put it in a QFQ PageContent element):: Display QFQ log files in realtime. Put the following code in a QFQ page content element.::
# #
# {{logfile:SU}} # {{logfile:SU}}
...@@ -225,46 +231,69 @@ The following QFQ code could be used for that purpose (put it in a QFQ PageConte ...@@ -225,46 +231,69 @@ The following QFQ code could be used for that purpose (put it in a QFQ PageConte
Form Submit Log page Form Submit Log page
-------------------- --------------------
For debugging purposes you may like to add a Form Submit Log page in the frontend. .. warning::
The following QFQ code could be used for that purpose (put it in a QFQ PageContent element)::
Use this code only on access restricted pages. GET/POST Parameter might be used to get access to unintended content.
Check the Form Submit Log page to see what have been submitted. Put the following code in a QFQ page content element.::
#
# Show all form submit. Optional filter by Form or FeUser.
#
# {{formId:SC0}}
# {{feUser:SCE:alnumx}}
# Filters # Filters
20.shead = <form onchange='this.submit()' class='form-inline'><input type='hidden' name='id' value='{{pageAlias:T0}}'> 10 {
20 { sql = SELECT ''
sql = SELECT "'", id, IF(id = '{{formId:SC0}}', "' selected>", "'>"), name shead = <form onchange='this.submit()' class='form-inline'><input type='hidden' name='id' value='{{pageAlias:T0}}'>
FROM Form stail = </form>
ORDER BY name
head = <label for='formId'>Form:</label> <select name='formId' id='formId' class='form-control'><option value=0></option> # Dropdown: Form
tail = </select> 20 {
rbeg = <option value=
rend = </option> sql = SELECT "'", f.id, IF( f.id = '{{formId:SC0}}', "' selected>", "'>"), f.name, ' (', QIFEMPTY(COUNT(fsl.id),'-'), ')'
} FROM Form AS f
30 { LEFT JOIN FormSubmitLog AS fsl
sql = SELECT feUser, IF(feUser = '{{feUser:SCE:alnumx}}', "' selected>", "'>"), feUser ON fsl.formId=f.id
FROM FormSubmitLog GROUP BY f.id
GROUP BY feUser ORDER BY feUser ORDER BY f.name
head = <label for='feUser'>FE User:</label> <select name='feUser' id='feUser' class='form-control'><option value=''></option> head = <label for='formId'>Form:</label> <select name='formId' id='formId' class='form-control'><option value=0></option>
tail = </select> tail = </select>
rbeg = <option value=' rbeg = <option value=
rend = </option> rend = </option>
}
# Dropdown: feUser
30 {
sql = SELECT feUser, IF(feUser = '{{feUser:SCE:alnumx}}', "' selected>", "'>"), feUser, ' (', COUNT(id), ')'
FROM FormSubmitLog
WHERE feUser!=''
GROUP BY feUser
ORDER BY feUser
head = <label for='feUser'>FE User:</label> <select name='feUser' id='feUser' class='form-control'><option value=''></option>
tail = </select>
rbeg = <option value='
# just to sync syntax highlighter: '
rend = </option>
}
} }
30.stail = </form>
# Show Log # Show Log
50 { 50 {
sql = SELECT l.id sql = SELECT l.id
, CONCAT('<b>Form</b>: ', f.name , CONCAT('<b>Form</b>: ', f.name
, '<br><b>Record Id</b>: ', l.recordId , '<br><b>Record Id</b>: ', l.recordId
, '<br><b>Fe User</b>: ', l.feUser , '<br><b>Fe User</b>: ', l.feUser
, '<br><b>Date</b>: ', l.created , '<br><b>Date</b>: ', l.created
, '<br><b>Page Id</b>: ', l.pageId , '<br><b>Page Id</b>: ', l.pageId
, '<br><b>Session Id</b>: ', l.sessionId , '<br><b>Session Id</b>: ', l.sessionId
, '<br><b>IP Address</b>: ', l.clientIp , '<br><b>IP Address</b>: ', l.clientIp
, '<br><b>User Agent</b>: ', l.userAgent , '<br><b>User Agent</b>: ', l.userAgent
, '<br><b>SIP Data</b>: <div style="margin-left:20px;">' , '<br><b>SIP Data</b>: <div style="margin-left:20px;">'
, '<script>var data = ', l.sipData, "; for (var key in data) { , "<script>var data = JSON.parse('", l.sipData, "'); for (var key in data) {
document.write('<b>' + key + '</b>: ' + data[key] + '<br>'); }</script>", '</div>') document.write('<b>' + key + '</b>: ' + data[key] + '<br>'); }</script>", '</div>')
, CONCAT('<script>var data = ', l.formData, "; for (var key in data) { , CONCAT("<script>var data = JSON.parse('", l.formData, "'); for (var key in data) {
document.write('<b>' + key + '</b>: ' + data[key] + '<br>'); }</script>") document.write('<b>' + key + '</b>: ' + data[key] + '<br>'); }</script>")
FROM FormSubmitLog AS l FROM FormSubmitLog AS l
LEFT JOIN Form AS f LEFT JOIN Form AS f
...@@ -281,3 +310,4 @@ The following QFQ code could be used for that purpose (put it in a QFQ PageConte ...@@ -281,3 +310,4 @@ The following QFQ code could be used for that purpose (put it in a QFQ PageConte
fbeg = <td> fbeg = <td>
fend = </td> fend = </td>
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment