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)
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)
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
1.sql = SELECT @grId := '{{grId:C0:digit}}' AS _grId
......@@ -194,9 +198,11 @@ Setup in :ref:`configuration`
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}}
......@@ -225,46 +231,69 @@ The following QFQ code could be used for that purpose (put it in a QFQ PageConte
Form Submit Log page
--------------------
For debugging purposes you may like to add a Form Submit Log page in the frontend.
The following QFQ code could be used for that purpose (put it in a QFQ PageContent element)::
.. warning::
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
20.shead = <form onchange='this.submit()' class='form-inline'><input type='hidden' name='id' value='{{pageAlias:T0}}'>
20 {
sql = SELECT "'", id, IF(id = '{{formId:SC0}}', "' selected>", "'>"), name
FROM Form
ORDER BY name
head = <label for='formId'>Form:</label> <select name='formId' id='formId' class='form-control'><option value=0></option>
tail = </select>
rbeg = <option value=
rend = </option>
}
30 {
sql = SELECT feUser, IF(feUser = '{{feUser:SCE:alnumx}}', "' selected>", "'>"), feUser
FROM FormSubmitLog
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='
rend = </option>
10 {
sql = SELECT ''
shead = <form onchange='this.submit()' class='form-inline'><input type='hidden' name='id' value='{{pageAlias:T0}}'>
stail = </form>
# Dropdown: Form
20 {
sql = SELECT "'", f.id, IF( f.id = '{{formId:SC0}}', "' selected>", "'>"), f.name, ' (', QIFEMPTY(COUNT(fsl.id),'-'), ')'
FROM Form AS f
LEFT JOIN FormSubmitLog AS fsl
ON fsl.formId=f.id
GROUP BY f.id
ORDER BY f.name
head = <label for='formId'>Form:</label> <select name='formId' id='formId' class='form-control'><option value=0></option>
tail = </select>
rbeg = <option value=
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
50 {
sql = SELECT l.id
, CONCAT('<b>Form</b>: ', f.name
, '<br><b>Record Id</b>: ', l.recordId
, '<br><b>Fe User</b>: ', l.feUser
, '<br><b>Date</b>: ', l.created
, '<br><b>Page Id</b>: ', l.pageId
, '<br><b>Session Id</b>: ', l.sessionId
, '<br><b>IP Address</b>: ', l.clientIp
, '<br><b>User Agent</b>: ', l.userAgent
, '<br><b>SIP Data</b>: <div style="margin-left:20px;">'
, '<script>var data = ', l.sipData, "; for (var key in data) {
, CONCAT('<b>Form</b>: ', f.name
, '<br><b>Record Id</b>: ', l.recordId
, '<br><b>Fe User</b>: ', l.feUser
, '<br><b>Date</b>: ', l.created
, '<br><b>Page Id</b>: ', l.pageId
, '<br><b>Session Id</b>: ', l.sessionId
, '<br><b>IP Address</b>: ', l.clientIp
, '<br><b>User Agent</b>: ', l.userAgent
, '<br><b>SIP Data</b>: <div style="margin-left:20px;">'
, "<script>var data = JSON.parse('", l.sipData, "'); for (var key in data) {
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>")
FROM FormSubmitLog AS l
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
fbeg = <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