324 |
richard |
1 |
<?php
|
|
|
2 |
# Choice of language
|
|
|
3 |
$Language = 'en';
|
|
|
4 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
|
|
|
5 |
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
|
|
6 |
$Language = strtolower(substr(chop($Langue[0]),0,2)); }
|
|
|
7 |
if($Language == 'fr'){
|
|
|
8 |
$l_title = "Liste des groupes d'usagers";
|
|
|
9 |
$l_frame_top = "Gestion des groupes";
|
|
|
10 |
$l_frame = "Liste des groupes";
|
|
|
11 |
$l_group = "groupe";
|
|
|
12 |
$l_nb_users = "Nombre d'usagers";
|
|
|
13 |
$l_empty_list = "La liste des groupes est vide";
|
|
|
14 |
}
|
|
|
15 |
else {
|
|
|
16 |
$l_title = "Create a group";
|
|
|
17 |
$l_frame_top = "Groups admin";
|
|
|
18 |
$l_frame = "Groups list";
|
|
|
19 |
$l_group = "group";
|
|
|
20 |
$l_nb_users = "Number of users";
|
|
|
21 |
$l_empty_list = "The groups list is empty";
|
|
|
22 |
}
|
|
|
23 |
require('/etc/freeradius-web/config.php');
|
|
|
24 |
?>
|
|
|
25 |
<html>
|
|
|
26 |
<?php
|
|
|
27 |
|
|
|
28 |
if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php"))
|
|
|
29 |
include_once("../lib/sql/drivers/$config[sql_type]/functions.php");
|
|
|
30 |
else{
|
|
|
31 |
echo <<<EOM
|
|
|
32 |
<title>$l_title</title>
|
|
|
33 |
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
|
|
|
34 |
<link rel="stylesheet" href="/css/style.css">
|
|
|
35 |
</head>
|
|
|
36 |
<body>
|
|
|
37 |
<center>
|
|
|
38 |
<b>Could not include SQL library functions. Aborting</b>
|
|
|
39 |
</body>
|
|
|
40 |
</html>
|
|
|
41 |
EOM;
|
|
|
42 |
exit();
|
|
|
43 |
}
|
|
|
44 |
if ($config[general_lib_type] != 'sql'){
|
|
|
45 |
echo <<<EOM
|
|
|
46 |
<title>$l_title</title>
|
|
|
47 |
<meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
|
|
|
48 |
<link rel="stylesheet" href="style.css">
|
|
|
49 |
</head>
|
|
|
50 |
<body>
|
|
|
51 |
<center>
|
|
|
52 |
<b>This page is only available if you are using sql as general library type</b>
|
|
|
53 |
</body>
|
|
|
54 |
</html>
|
|
|
55 |
EOM;
|
|
|
56 |
exit();
|
|
|
57 |
}
|
|
|
58 |
?>
|
|
|
59 |
<head>
|
|
|
60 |
<title><?php echo "$l_title"; ?></title>
|
|
|
61 |
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
|
|
|
62 |
<link rel="stylesheet" href="/css/style.css">
|
|
|
63 |
</head>
|
|
|
64 |
<body>
|
|
|
65 |
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
66 |
<tr><th><?php echo "$l_frame_top"; ?></th></tr>
|
|
|
67 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1"
|
|
|
68 |
height="2"></td></tr>
|
|
|
69 |
</TABLE>
|
|
|
70 |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
|
|
|
71 |
<tr bgcolor="#666666"><td>
|
|
|
72 |
<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
|
|
|
73 |
<tr><td valign="middle" align="left">
|
|
|
74 |
<center>
|
|
|
75 |
<table border=0 width=550 cellpadding=0 cellspacing=0>
|
|
|
76 |
<tr valign=top>
|
|
|
77 |
</tr>
|
|
|
78 |
</table>
|
|
|
79 |
<table border=0 width=540 cellpadding=1 cellspacing=1>
|
|
|
80 |
<tr valign=top>
|
|
|
81 |
<td width=55%></td>
|
|
|
82 |
<td bgcolor="black" width=45%>
|
|
|
83 |
<table border=0 width=100% cellpadding=2 cellspacing=0>
|
|
|
84 |
<tr bgcolor="#907030" align=right valign=top><th>
|
|
|
85 |
<font color="white"><?php echo "$l_frame"; ?></font>
|
|
|
86 |
</th></tr>
|
|
|
87 |
</table>
|
|
|
88 |
</td></tr>
|
|
|
89 |
<tr bgcolor="black" valign=top><td colspan=2>
|
|
|
90 |
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
|
|
|
91 |
<tr><td>
|
|
|
92 |
<?php
|
|
|
93 |
unset($login);
|
|
|
94 |
$num = 0;
|
|
|
95 |
include_once("../lib/$config[general_lib_type]/group_info.php");
|
|
|
96 |
if (isset($existing_groups)){
|
|
|
97 |
echo "<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor=\"#ffffe0\" valign=top>";
|
|
|
98 |
echo "<tr bgcolor=\"#d0ddb0\">";
|
|
|
99 |
echo "<th>#</th><th>$l_group </th><th>$l_nb_users</th></tr>";
|
|
|
100 |
foreach ($existing_groups as $group => $num_members){
|
|
|
101 |
$num++;
|
|
|
102 |
$Group = urlencode($group);
|
|
|
103 |
echo <<<EOM
|
|
|
104 |
<tr align=center>
|
|
|
105 |
<td>$num</td>
|
|
|
106 |
<td><a href="group_admin.php?login=$Group" title="Editer le groupe $group">$group</a></td>
|
|
|
107 |
<td>$num_members</td>
|
|
|
108 |
</tr>
|
|
|
109 |
EOM;
|
|
|
110 |
}
|
|
|
111 |
}
|
|
|
112 |
else
|
|
|
113 |
echo "<b>$l_empty_list</b>\n";
|
|
|
114 |
?>
|
|
|
115 |
</table>
|
|
|
116 |
</table>
|
|
|
117 |
</tr>
|
|
|
118 |
</table>
|
|
|
119 |
</TD></TR>
|
|
|
120 |
</TABLE>
|
|
|
121 |
</td></tr>
|
|
|
122 |
</TABLE>
|
|
|
123 |
</body>
|
|
|
124 |
</html>
|