Subversion Repositories ALCASAR

Rev

Rev 324 | Rev 912 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

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