/web/acc/manager/htdocs/group_new.php |
---|
6,14 → 6,22 |
include("../lib/langues.php"); |
//update Filter-Id for protocol filtering |
if (isset($_POST['Filter-Proto']) && isset($_POST['Filter-Id'])) |
if (isset($_POST['Filter-Proto']) && isset($_POST['Status-Open-Required']) && isset($_POST['Filter-Id'])) |
{ |
$upId = (int)$_POST['Filter-Proto']; |
$downId = (int)$_POST['Filter-Id']; |
$upId = $upId+$downId; |
$upId = str_pad($upId, 8, '0', STR_PAD_LEFT); |
$_POST['Filter-Id'] = $upId; |
$filterId = (int)$_POST['Filter-Id']; |
$FilterProto = (int)$_POST['Filter-Proto']; |
$statusOpenRequired = (int)($_POST['Status-Open-Required'].'000'); |
$filterId = $filterId+$FilterProto+$statusOpenRequired; |
$_POST['Filter-Id'] = str_pad($filterId, 8, '0', STR_PAD_LEFT); |
} |
if (isset($_POST['Status-Open-Required'])) { |
if ($_POST['Status-Open-Required'] === '0') { |
$_POST['Idle-Timeout'] = '600'; // 10 minutes |
} else { |
$_POST['Idle-Timeout'] = ''; |
} |
$_POST['Idle-Timeout_op'] = '='; |
} |
require('/etc/freeradius-web/config.php'); |
172,6 → 180,7 |
EOM; |
foreach($show_attrs as $key => $desc){ |
if ($key === 'Idle-Timeout') continue; |
$name = $attrmap["$key"]; |
if ($name == 'none') |
continue; |
434,7 → 443,21 |
<option value=\"01000000\" >$l_proto_2</option> |
<option value=\"00100000\" >$l_proto_3</option> |
</select></td></tr>"; |
// User need to keep status page open |
print <<<EOM |
<tr class="advanced-field"> |
<td class="etiquette" colspan="$colspan"> |
<a href="help/statusOpenRequired_help.html" target=help onclick="window.open('help/statusOpenRequired_help.html','help','width=600,height=250,toolbar=no,scrollbars=no,resizable=yes')" title="$l_click_for_help"><font color="blue">$l_statusOpenRequired</font></a> |
</td> |
EOM; |
echo "<td width=20> |
<label><input type=\"radio\" name=\"Status-Open-Required\" value=\"1\" checked>$l_yes</label> |
<label><input type=\"radio\" name=\"Status-Open-Required\" value=\"0\">$l_no</label> |
</select></td> |
</tr>"; |
echo "</table><BR>"; |
} |
if ($create == 1) |
echo "<br/><center><a href=\"group_admin.php?login=$login\">$l_show_profile</a></center>"; |
/web/acc/manager/htdocs/help/statusOpenRequired_help.html |
---|
0,0 → 1,27 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
<HTML> |
<HEAD> |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
<title>Help Page</title> |
<link rel="stylesheet" href="/css/style.css" type="text/css"> |
</HEAD> |
<body> |
<center> |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> |
<tr><th>Déconnexion page status fermée - Disconnection status page closed</th></tr> |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr> |
</TABLE> |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1> |
<tr><td valign="middle" align="left"> |
Cet attribut définit si l'usager doit laisser la page status ouverte durant sa session. Dans le cas contraire, il sera déconnecté.<br> |
Si cet attribut n'est activé, l'état de l'activité de l'usager sera défini en fonction de l'activité réseau de sa machine de consultation. |
<HR> |
This attribute defines whether the user should leave the status page open during his session. If not, it will be disconnected.<br> |
If this attribute is not activated, the activity status of the user will be defined according to the network activity of his lookup machine. |
</td></tr> |
</table> |
<br> |
<a href="javascript:window.close();"><b>Fermer / Close</b></a> |
</center> |
</body> |
</html> |
/web/acc/manager/htdocs/user_edit.php |
---|
6,14 → 6,22 |
include("../lib/langues.php"); |
//update Filter-Id for protocol filtering |
if (isset($_POST['Filter-Proto']) && isset($_POST['Filter-Id0'])) |
if (isset($_POST['Filter-Proto']) && isset($_POST['Status-Open-Required']) && isset($_POST['Filter-Id0'])) |
{ |
$upId = (int)$_POST['Filter-Proto']; |
$downId = (int)$_POST['Filter-Id0']; |
$upId = $upId+$downId; |
$upId = str_pad($upId, 8, '0', STR_PAD_LEFT); |
$_POST['Filter-Id0'] = $upId; |
$filterId = (int)$_POST['Filter-Id0']; |
$FilterProto = (int)$_POST['Filter-Proto']; |
$statusOpenRequired = (int)($_POST['Status-Open-Required'].'000'); |
$filterId = $filterId+$FilterProto+$statusOpenRequired; |
$_POST['Filter-Id0'] = str_pad($filterId, 8, '0', STR_PAD_LEFT); |
} |
if (isset($_POST['Status-Open-Required'])) { |
if ($_POST['Status-Open-Required'] === '0') { |
$_POST['Idle-Timeout0'] = '600'; // 10 minutes |
} else { |
$_POST['Idle-Timeout0'] = ''; |
} |
$_POST['Idle-Timeout0_op'] = '='; |
} |
require('/etc/freeradius-web/config.php'); |
require('../lib/attrshow.php'); |
189,6 → 197,7 |
$login = $login_saved; |
foreach ($show_attrs as $key => $desc) { |
if ($key === 'Idle-Timeout') continue; |
$name = $attrmap["$key"]; |
$generic = (isset($attrmap['generic']["$key"])) ? $attrmap['generic']["$key"] : ''; |
if ($name == 'none') |
302,6 → 311,12 |
} else { |
$grp_proto = $l_proto_0; |
} |
if ($val[4] === '1') { |
$grp_statusOpenRequired = $l_yes; |
} else { |
$grp_statusOpenRequired = $l_no; |
} |
break; |
} |
370,6 → 385,7 |
} |
foreach($show_attrs as $key => $desc){ |
if ($key === 'Idle-Timeout') continue; |
$name = $attrmap["$key"]; |
$generic = (isset($attrmap['generic']["$key"])) ? $attrmap['generic']["$key"] : ''; |
if ($name == 'none') |
710,50 → 726,71 |
} |
} |
/*protocole filter*/ |
print <<<EOM |
<tr> |
<td class="etiquette" colspan="$colspan"> |
<a href="help/protocols_help.html" target=help onclick="window.open('help/protocols_help.html','help','width=600,height=250,toolbar=no,scrollbars=no,resizable=yes')" title="$l_click_for_help"><font color="blue">$l_proto</font></a> |
</td> |
/*protocole filter*/ |
print <<<EOM |
<tr> |
<td class="etiquette" colspan="$colspan"> |
<a href="help/protocols_help.html" target=help onclick="window.open('help/protocols_help.html','help','width=600,height=250,toolbar=no,scrollbars=no,resizable=yes')" title="$l_click_for_help"><font color="blue">$l_proto</font></a> |
</td> |
EOM; |
if(isset($member_groups) && $user_type != 'group') { |
echo "<td bgcolor=\"#BEBEBE\">$grp_proto</td>"; |
} |
if(isset($member_groups) && $user_type != 'group') { |
echo "<td bgcolor=\"#BEBEBE\">$grp_proto</td>"; |
} |
if ($val[2] === '1') { |
$selected = 'proto_3'; |
} else if ($val[1] === '1') { |
$selected = 'proto_2'; |
} else if ($val[0] === '1') { |
$selected = 'proto_1'; |
} else { |
$selected = 'proto_0'; |
} |
echo "<td width=20>"; |
echo "<select name='Filter-Proto'> |
<option value=\"00000000\"".(($selected === 'proto_0') ? ' selected' : '').">$l_proto_0</option> |
<option value=\"10000000\"".(($selected === 'proto_1') ? ' selected' : '').">$l_proto_1</option> |
<option value=\"01000000\"".(($selected === 'proto_2') ? ' selected' : '').">$l_proto_2</option> |
<option value=\"00100000\"".(($selected === 'proto_3') ? ' selected' : '').">$l_proto_3</option> |
</select></td> |
</tr>"; |
if ($user_type != 'group') { |
echo <<<EOM |
<tr> |
<td align=right colspan="$colspan" bgcolor="#d0ddb0"> |
$l_group_member<br><font size=-2><i>($l_main_group)</i></font> |
if ($val[2] === '1') { |
$selected = 'proto_3'; |
} else if ($val[1] === '1') { |
$selected = 'proto_2'; |
} else if ($val[0] === '1') { |
$selected = 'proto_1'; |
} else { |
$selected = 'proto_0'; |
} |
echo "<td width=20>"; |
echo "<select name='Filter-Proto'> |
<option value=\"00000000\"".(($selected === 'proto_0') ? ' selected' : '').">$l_proto_0</option> |
<option value=\"10000000\"".(($selected === 'proto_1') ? ' selected' : '').">$l_proto_1</option> |
<option value=\"01000000\"".(($selected === 'proto_2') ? ' selected' : '').">$l_proto_2</option> |
<option value=\"00100000\"".(($selected === 'proto_3') ? ' selected' : '').">$l_proto_3</option> |
</select></td> |
</tr>"; |
// User need to keep status page open |
print <<<EOM |
<tr class="advanced-field"> |
<td class="etiquette" colspan="$colspan"> |
<a href="help/statusOpenRequired_help.html" target=help onclick="window.open('help/statusOpenRequired_help.html','help','width=600,height=250,toolbar=no,scrollbars=no,resizable=yes')" title="$l_click_for_help"><font color="blue">$l_statusOpenRequired</font></a> |
</td> |
EOM; |
if (isset($member_groups)) { |
echo '<td colspan="2">'; |
} else { |
echo '<td>'; |
} |
if(isset($member_groups) && $user_type != 'group') { |
echo "<td bgcolor=\"#BEBEBE\">$grp_statusOpenRequired</td>"; |
} |
if ($val[4] === '1') { |
$selected = true; |
} else { |
$selected = false; |
} |
echo "<td width=20> |
<label><input type=\"radio\" name=\"Status-Open-Required\" value=\"1\"".(($selected) ? ' checked' : '').">$l_yes</label> |
<label><input type=\"radio\" name=\"Status-Open-Required\" value=\"0\"".((!$selected) ? ' checked' : '').">$l_no</label> |
</select></td> |
</tr>"; |
if ($user_type != 'group') { |
echo <<<EOM |
<tr> |
<td align=right colspan="$colspan" bgcolor="#d0ddb0"> |
$l_group_member<br><font size=-2><i>($l_main_group)</i></font> |
</td> |
EOM; |
if (isset($member_groups)) { |
echo '<td colspan="2">'; |
} else { |
echo '<td>'; |
} |
if (isset($existing_groups)){ |
echo '<select size="5" name="edited_groups[]" OnChange="this.form.group_change.value=1">'; |
if ($config['sql_show_all_groups'] == 'true') { |
/web/acc/manager/htdocs/user_new.php |
---|
5,6 → 5,26 |
if (is_file("../lib/langues.php")) |
include("../lib/langues.php"); |
//update Filter-Id for protocol filtering |
if (isset($_POST['Filter-Proto']) && isset($_POST['Status-Open-Required']) && isset($_POST['Filter-Id'])) |
{ |
$filterId = (int)$_POST['Filter-Id']; |
$FilterProto = (int)$_POST['Filter-Proto']; |
$statusOpenRequired = (int)($_POST['Status-Open-Required'].'000'); |
$filterId = $filterId+$FilterProto+$statusOpenRequired; |
$_POST['Filter-Id'] = str_pad($filterId, 8, '0', STR_PAD_LEFT); |
} |
if (isset($_POST['Status-Open-Required'])) { |
if ($_POST['Status-Open-Required'] === '0') { |
$_POST['Idle-Timeout'] = '600'; // 10 minutes |
} else { |
$_POST['Idle-Timeout'] = ''; |
} |
$_POST['Idle-Timeout_op'] = '='; |
} |
require('/etc/freeradius-web/config.php'); |
if(!isset($create)) $create=0; |
if(!isset($show)) $show=0; |
if(!isset($login)) $login = ''; |
14,17 → 34,6 |
if(!isset($selected)) $selected = array(); |
if(!isset($selected['='])) $selected['='] = ''; |
//update Filter-Id for protocol filtering |
if (isset($_POST['Filter-Proto']) && isset($_POST['Filter-Id'])) |
{ |
$upId = (int)$_POST['Filter-Proto']; |
$downId = (int)$_POST['Filter-Id']; |
$upId = $upId+$downId; |
$upId = str_pad($upId, 8, '0', STR_PAD_LEFT); |
$_POST['Filter-Id'] = $upId; |
} |
require('/etc/freeradius-web/config.php'); |
require('../lib/attrshow.php'); |
require('../lib/defaults.php'); |
246,6 → 255,7 |
EOM; |
} |
foreach ($show_attrs as $key => $desc) { |
if ($key === 'Idle-Timeout') continue; |
$name = $attrmap["$key"]; |
if ($name == 'none') |
continue; |
507,8 → 517,22 |
<option value=\"01000000\" >$l_proto_2</option> |
<option value=\"00100000\" >$l_proto_3</option> |
</select></td></tr>"; |
// User need to keep status page open |
print <<<EOM |
<tr class="advanced-field"> |
<td class="etiquette" colspan="$colspan"> |
<a href="help/statusOpenRequired_help.html" target=help onclick="window.open('help/statusOpenRequired_help.html','help','width=600,height=250,toolbar=no,scrollbars=no,resizable=yes')" title="$l_click_for_help"><font color="blue">$l_statusOpenRequired</font></a> |
</td> |
EOM; |
echo "<td width=20> |
<label><input type=\"radio\" name=\"Status-Open-Required\" value=\"1\" checked>$l_yes</label> |
<label><input type=\"radio\" name=\"Status-Open-Required\" value=\"0\">$l_no</label> |
</select></td> |
</tr>"; |
print <<<EOM |
<tr> |
<td class="etiquette" colspan="$colspan"> |
$l_lang_ticket |
/web/acc/manager/lib/langues.php |
---|
13,8 → 13,8 |
$l_monday="lundi"; $l_tuesday="mardi"; $l_wednesday="mercredi"; $l_thursday="jeudi"; $l_friday="vendredi"; $l_saturday="samedi"; $l_sunday="dimanche"; |
$l_monthly="mensuelle";$l_weekly="hebdomadaire";$l_daily="journalière";$l_by_session="par session"; |
$l_day = "Jour"; |
$l_limit="limite"; |
$l_daily_limit="limite journalière"; |
$l_limit="limite"; |
$l_daily_limit="limite journalière"; |
$l_used_time = "Temps utilisé"; |
$l_last7days_status = "État sur les 7 derniers jours"; |
$l_connections_number = "Nombre de connexions"; |
130,6 → 130,9 |
$l_empty="Vide"; |
$l_ipAddress="Adresse IP"; |
$l_rule="Règle"; |
$l_statusOpenRequired="Déconnexion page status fermée"; |
$l_yes="Oui"; |
$l_no="Non"; |
break; |
default : |
//English |
253,6 → 256,9 |
$l_empty="Empty"; |
$l_ipAddress="IP address"; |
$l_rule="Rule"; |
$l_statusOpenRequired="Disconnection status page closed"; |
$l_yes="Yes"; |
$l_no="No"; |
break; |
} |
?> |
/web/status.php |
---|
311,33 → 311,6 |
$cn = (!empty($row['name'])) ? $row['name'] : $user[5]; |
} |
} |
// Store the user @IP in a file (to test if he is still active). |
$filename = '/var/tmp/havp/current_users.txt'; |
if (file_exists($filename)) { |
$current_users_file = fopen($filename, 'r'); |
$content = file($filename); |
fclose($current_users_file); |
if (empty($content)) { |
file_put_contents($filename, $_SERVER['REMOTE_ADDR'].PHP_EOL); |
} else { |
$change_me = 1; // avoid duplicate user @IP |
// if we found duplicate IP, we will not write user @IP (just set change_me = 0) |
foreach ($content as $line) { |
$line = preg_replace('/\s+/', '', $line); |
if ($line === $_SERVER['REMOTE_ADDR']) { |
$change_me = 0; |
} |
} |
// if user @IP does not exist, we write it |
if ($change_me) { |
file_put_contents($filename, $_SERVER['REMOTE_ADDR'].PHP_EOL, FILE_APPEND); |
} |
} |
} else { |
// we create filename and we write user @IP. |
file_put_contents($filename, $_SERVER['REMOTE_ADDR'].PHP_EOL); |
} |
} |
} |
/web/still_connected.php |
---|
1,39 → 1,27 |
<?php |
//store user @IP who can join this page (still have their status.php tab open) in a file. |
$filename='/var/tmp/havp/current_users.txt'; |
$change_me = 1; |
// store user @IP who can join this page (still have their status.php tab open) in a file. |
$filename = '/var/tmp/havp/current_users.txt'; |
$user_ip = $_SERVER['REMOTE_ADDR']; |
//check if file exists |
if(file_exists($filename)){ |
$current_users_file = fopen($filename, "r"); |
$content = file($filename); |
fclose($current_users_file); |
// if file is empty, we put user @IP in it. |
if(empty($content)) |
{ |
file_put_contents($filename, $_SERVER['REMOTE_ADDR'].PHP_EOL); |
} |
else |
{ |
// if we found duplicate user IP, it will not be writen again |
foreach($content as $line){ |
$line = preg_replace('/\s+/', '', $line); #remove whitespace |
if($line == $_SERVER['REMOTE_ADDR']) |
{ |
$change_me = 0; |
} |
} |
// else we write user IP in the file |
if($change_me) |
{ |
file_put_contents($filename, $_SERVER['REMOTE_ADDR'].PHP_EOL , FILE_APPEND); |
} |
} |
if ((!file_exists($filename)) || (filesize($filename) === 0)) { |
// Creating file and write user @IP. |
file_put_contents($filename, $user_ip.':TEMP'.PHP_EOL); |
} else { |
// If we found duplicate user IP, it will not be writen again |
$found = false; |
$fh = fopen($filename, 'r'); |
while (!feof($fh)) { |
$line = fgets($fh, 1024); |
if (preg_match('/^'.preg_quote($user_ip).':/', $line)) { |
$found = true; |
break; |
} |
} |
fclose($fh); |
// else we write user IP in the file |
if (!$found) { |
file_put_contents($filename, $user_ip.':TEMP'.PHP_EOL, FILE_APPEND); |
} |
} |
else |
{ |
//The file doesn't exist. We create it and write user @IP. |
file_put_contents($filename, $_SERVER['REMOTE_ADDR'].PHP_EOL); |
} |
?> |