@uggiz said in Captive Portal - Cron - Authentication issues:
its possible to get a "Quota used" message when the users gets logged out?
A browser getting a none solicited message from a web server with info ?
Noop. Never seen that before. Browers can connect to web server, get the file (page) they are looking for, and bye bye the connection.
It is possible to have a "logout" or "you are connected" browser windows open, and have that windows load some Jave stuff that questions the current status. if it was possible to get the "max allowed" and "current" bytes used .... but .....
See for yourself :
#!/usr/local/bin/php -q
<?php
require_once("/etc/inc/util.inc");
require_once("/etc/inc/functions.inc");
require_once("/etc/inc/captiveportal.inc");
/* Read in captive portal db */
/* Determine number of logged in users for all zones */
$count_cpusers = 0;
/* Is portal activated ? */
if (is_array($config['captiveportal']))
/* For every zone, do */
foreach ($config['captiveportal'] as $cpkey => $cp)
/* Sanity check */
if (is_array($config['captiveportal'][$cpkey]))
/* Is zone enabled ? */
if (array_key_exists('enable', $config['captiveportal'][$cpkey])) {
$cpzone = $cpkey;
/* Zone selected -> count users and add */
$cpdb = captiveportal_read_db();
foreach ($cpdb as $cpent) {
print_r($cpent);
echo date("m/d/Y H:i:s\n", $cpent[0]);
echo "---------------\n";
}
}
?>
Create a file called /root/cap.php and put the above content in it.
Now call it :
php -q /root/cap.php
and you see : no 'used' info is avaible in the pfSense portal session database.
The max quota is :
[traffic_quota] => 104857600
= 100 Mbytes in my test case = Ok.
Ok ... you could, on the web server java side, get the max and used info from these files directly.
Another info source is :
32e69f3b-9c5f-4239-9d3d-417955ee1941-image.png
as the main log will be bombarded with these message (imho : they do not belong there).