Possible fix for radius accounting

This commit is contained in:
Matteo Biscosi 2024-06-06 06:16:05 -04:00
parent 678052f6fc
commit 90ebaa3903
2 changed files with 17 additions and 17 deletions

View file

@ -57,25 +57,24 @@ function radius_handler.accountingStart(name, username, password)
local ip_address = get_first_ip(name)
local current_time = os.time()
math.randomseed(current_time)
local accounting_started = interface.radiusAccountingStart(username --[[ Username ]] , name --[[ MAC Address ]] ,
session_id, ip_address --[[ First IP Address ]] , current_time)
-- local accounting_started = interface.radiusAccountingStart(username --[[ Username ]] , name --[[ MAC Address ]] ,
-- session_id, ip_address --[[ First IP Address ]] , current_time)
-- if accounting_started then
local json = require("dkjson")
local key = string.format(redis_accounting_key, name)
local user_data = {
name = name,
username = username,
password = password,
session_id = session_id,
start_session_time = current_time,
ip_address = ip_address
}
if accounting_started then
local json = require("dkjson")
local key = string.format(redis_accounting_key, name)
local user_data = {
name = name,
username = username,
password = password,
session_id = session_id,
start_session_time = current_time,
ip_address = ip_address
}
ntop.setCache(key, json.encode(user_data))
-- end
ntop.setCache(key, json.encode(user_data))
end
return accounting_started
return true
end
-- ##############################################