lirantal / daloradius

daloRADIUS is an advanced RADIUS web management application for managing hotspots and general-purpose ISP deployments. It features user management, graphical reporting, accounting, a billing engine, and integrates with OpenStreetMap for geolocation. The system is based on FreeRADIUS with which it shares access to the backend database.
http://www.daloradius.com
GNU General Public License v2.0
669 stars 341 forks source link

Daloradius v2.1b - Access-Reject in Expiration module - Date format issue. #533

Open rajaeem opened 4 months ago

rajaeem commented 4 months ago

Hello, It seems as if there is an issue with the date value format in the radcheck table.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Quick User Add'
  2. Click on 'Expiration'
  3. Choose a date.
  4. Connect.
  5. RADIUS Reply = Access-Reject

Log (1) sql: EXPAND SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{SQL-User-Name}' ORDER BY id (1) sql: --> SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'username' ORDER BY id (1) sql: Executing select query: SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'username' ORDER BY id (1) sql: ERROR: Error parsing value: failed to parse time string "2024-08-23" (1) sql: ERROR: Error parsing user data from database result (1) sql: ERROR: Error getting check attributes rlm_sql (sql): Released connection (7) Need 2 more connections to reach min connections (3) rlm_sql (sql): Opening additional connection (8), 1 of 31 pending slots used rlm_sql_mysql: Starting connect to MySQL server rlm_sql_mysql: Connected to database 'radius' on Localhost via UNIX socket, server version 10.5.22-MariaDB, protocol version 10 (1) [sql] = fail (1) } # authorize = fail (1) Invalid user (sql: Error parsing value: failed to parse time string "2024-08-23"): [username] (from client REDACTED port 0) (1) Using Post-Auth-Type Reject

Expected behavior Access-Accept

FIX

Change the date format. From 2024-08-23 To 23 Aug 2024 12:00. https://freeradius.org/documentation/freeradius-server/4.0.0/howto/modules/expiration/index.html

Log (2) sql: EXPAND SELECT groupname FROM radusergroup WHERE username = '%{SQL-User-Name}' ORDER BY priority (2) sql: --> SELECT groupname FROM radusergroup WHERE username = 'username' ORDER BY priority (2) sql: Executing select query: SELECT groupname FROM radusergroup WHERE username = 'username' ORDER BY priority (2) sql: User not found in any groups rlm_sql (sql): Released connection (9) (2) [sql] = ok (2) expiration: Account will expire at 'Aug 23 2024 12:00:00 +0330' (2) [expiration] = ok (2) [logintime] = noop

Screenshots Screenshot 2024-06-15 054043

Regards,

filippolauria commented 4 months ago

@rajaeem please refer to the answer provided in #538.