284,14 → 284,11 |
$sql = "SELECT UserName, AcctStartTime, AcctStopTime, acctsessiontime FROM radacct WHERE UserName='$user[5]' ORDER BY AcctStartTime DESC LIMIT 0, $nb_connection_history"; |
$res = @da_sql_query($link, $config, $sql); |
if ($res) { |
$a_connection = ''; |
$a_connected = 0; |
$connection_history = '<ul>'; |
while (($row = @da_sql_fetch_array($res,$config))) { |
$start_conn = date_create($row['acctstarttime']); |
if (empty($row['acctstoptime'])) { |
$connected = $l_connected; |
$a_connected++; |
} else { |
$connected = secondsToDuration($row['acctsessiontime']); |
} |
298,11 → 295,16 |
$connection_history .= '<li>'.date_format($start_conn, 'd M Y - H:i:s')." - ($connected)</li>"; |
} |
$connection_history .= '</ul>'; |
if ($a_connected > 1) { |
$a_connection = $l_a_connection.' '.$a_connected.' '.$l_a_connection_time; |
} |
} |
|
// Retrieve number of open session |
$sql = "SELECT COUNT(*) AS nb_open FROM radacct WHERE username = '$user[5]' AND acctstoptime IS NULL;"; |
$res = @da_sql_query($link, $config, $sql); |
if ($res) { |
$row = @da_sql_fetch_array($search,$config); |
$nb_open_session = $row['nb_open']; |
} |
|
// Retrieve first name & last name |
$sql = "SELECT Name FROM userinfo WHERE UserName='$user[5]'"; |
$res = @da_sql_query($link, $config, $sql); |
370,7 → 372,7 |
</tr> |
<tr> |
<td class="alert"> |
<?= ((isset($a_connection)) ? $a_connection : '') ?> |
<?= ((isset($nb_open_session) && ($nb_open_session > 1)) ? $l_a_connection.' '.$nb_open_session.' '.$l_a_connection_time : '') ?> |
</td> |
</tr> |
<tr> |