Menu

#70 Issue with CSV export of 'Last Connection Attempts'

v0.9
closed
nobody
1
2016-10-31
2016-09-22
No

A fault was reported on a job with an install of daloradius where the CSV export of the report 'Last Connection Attempts'. The fault was identified with the error report as follows:

Database error
Error Message: DB Error: no such field
Debug info: SELECT user, pass, reply, date FROM radpostauth WHERE (username LIKE '%') AND (authdate >='2016-09-01' AND authdate <='2016-09-30') ORDER BY User ASC [nativecode=1054 ** Unknown column 'user' in 'field list']

Upon investigation into the code for daloradius, it was discovered there was a bug in the SQL query used to generate the requested report. The query as discovered was as follows:

$sql = "SELECT user, pass, reply, date FROM ".$configValues['CONFIG_DB_TBL_RADPOSTAUTH']." $reportQuery ORDER BY User ASC";

This SQL query requests information on 4 fields in the database. These fields exist, but in the database names used by default by freeradius they are named slightly differently. For reference, in the database they are named respectively "username, pass, reply, authdate".

This appears to be a bug. To the best of my knowledge in daloradius the database mapping used is identical to the defaults set by freeradius. In this instance it is not so I suspect it's a bug.

To resolve this issue on the instance I was working on, the following changes were made to the SQL query.

$sql = "SELECT username, pass, reply, authdate FROM ".$configValues['CONFIG_DB_TBL_RADPOSTAUTH']." $reportQuery ORDER BY username ASC";

This was tested and shown to work in our environment.

Discussion

  • Liran Tal

    Liran Tal - 2016-10-31

    Thanks.
    This issue has been fixed on GitHub latest master branch: https://github.com/lirantal/daloradius/issues/19

     
  • Liran Tal

    Liran Tal - 2016-10-31
    • status: open --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB