Subversion Repositories ALCASAR

Rev

Rev 324 | Rev 910 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
324 richard 1
<?php
2
require('/etc/freeradius-web/config.php');
3
if (isset($search_IN)) $selected[$search_IN] = 'selected';
4
if (isset ($radius_attr)) $selected[$radius_attr] = 'selected';
5
if (isset ($max_results)){ $max = ($max_results) ? $max_results : 40;}
6
?>
7
<html>
8
<head>
9
<title>Gestion des usager</title>
10
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config['general_charset']?>">
11
<link rel="stylesheet" href="/css/style.css">
12
</head>
13
<body>
14
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
15
	<tr><th>Gestion des usagers</th></tr>
16
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" 
17
height="2"></td></tr>
18
</TABLE>
19
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
20
	<tr bgcolor="#666666"><td>
21
	<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
22
		<tr><td valign="middle" align="left">
23
<center>
24
<table border=0 width=540 cellpadding=1 cellspacing=1>
25
<tr valign=top>
26
<td width=340></td>
27
<td bgcolor="black" width=200>
28
	<table border=0 width=100% cellpadding=2 cellspacing=0>
29
	<tr bgcolor="#907030" align=right valign=top><th>
30
	<font color="white">Filtre de recherche</font>&nbsp;
31
	</th></tr>
32
	</table>
33
</td></tr>
34
<tr bgcolor="black" valign=top><td colspan=2>
35
	<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
36
	<tr><td>
37
 
38
<?php
39
if (isset($find_user)){
40
if ($find_user == 1){
41
	unset($found_users);
42
	if (is_file("../lib/$config[general_lib_type]/find.php"))
43
		include("../lib/$config[general_lib_type]/find.php");
44
	if (isset($found_users)){
45
		$num = 0;
46
		$msg .= <<<EOM
47
 
48
        <table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
49
        <tr bgcolor="#d0ddb0">
685 richard 50
        <th>#</th><th>Usager</th><th>Actions</th><th>membre du groupe</th>
324 richard 51
        </tr>
52
EOM;
53
		foreach ($found_users as $user){
54
			if ($user == '')
55
				$user = '-';
56
			$User = urlencode($user);
57
			$num++;
685 richard 58
			$msg .= "<tr align=center><td>$num</td><td>$user";
324 richard 59
			$msg .= <<<EOM
685 richard 60
				</td><td><a href="user_admin.php?login=$User" title="&Eacute;tat"><img src=/images/info.gif></a>
324 richard 61
				<a href="user_edit.php?login=$User" title="Attributs"><img src=/images/create.gif></a>
62
				<a href="user_info.php?login=$User" title="Informations personnelles"><img src=/images/tpf.gif></a>
63
				<a href="user_accounting.php?login=$User" title="Connexions effectu&eacute;es"><img src=/images/graph.gif></a>
64
				<a href="clear_opensessions.php?login=$User" title="Sessions ouvertes"><img src=/images/state_ok.gif></a>
685 richard 65
				<a href="user_delete.php?login=$User" title="Supprimer"><img src=/images/state_error.gif></a></td><td>
324 richard 66
EOM;
685 richard 67
			$login = $user;
68
			if (is_file("../lib/sql/defaults.php")) //retrieve member_groups
69
				include("../lib/sql/defaults.php");
70
			if (isset($member_groups)) foreach ($member_groups as $group) { $msg .= "$group";}
71
			else $msg .= "&nbsp"; 
72
		$msg .= "</td>";
324 richard 73
		}
685 richard 74
		$msg .= "</tr></table>\n";
324 richard 75
	}
76
	else
77
		$msg = "<b>Pas d'usagers trouv&eacute;s</b><br>\n";
78
}
79
}
80
?>
81
   <form method=post>
82
      <input type=hidden name=find_user value="0">
83
	<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
84
<tr>
85
<td align=right bgcolor="#d0ddb0">
86
Crit&egrave;re de recherche
87
</td>
88
<td>
89
<?php
90
echo <<<EOM
91
<select name="search_IN" editable onChange="this.form.submit();">
92
<option $selected[username] value="username">Identifiant (login)
93
<option $selected[name]  value="name">Nom complet (NOM Prenom)
94
<option $selected[department] value="department">Service
95
<option $selected[radius] value="radius">Attribut particulier
96
EOM;
97
?>
98
 
99
</select>
100
</td>
101
</tr>
102
<?php
103
if (isset($search_IN)){
104
	if ($search_IN == 'radius'){
105
		require('../lib/attrshow.php');
106
		echo <<<EOM
107
<tr>
108
<td align=right bgcolor="#d0ddb0">
109
Attributs RADIUS
110
</td>
111
<td>
112
<select name="radius_attr" editable>
113
EOM;
114
		foreach($show_attrs as $key => $desc)
115
			echo "<option $selected[$key] value=\"$key\">$desc\n";		
116
		echo <<<EOM
117
</select>
118
</td>
119
</tr>
120
EOM;
121
	}
122
}
123
?>
124
<tr>
125
<td align=right bgcolor="#d0ddb0">
126
qui contient<BR>
127
(champ vide = tous)
128
</td>
129
<td>
130
<input type=text name="search" value="<?php if (isset($search)) echo $search ;?>" size=25>
131
</td>
132
</tr>
133
<!--<tr>
134
<td align=right bgcolor="#d0ddb0">
135
Nombre de r&eacute;sultats Max.
136
</td>
137
<td>
138
<input type=text name="max_results" value="<?php echo $max ?>" size=25>
139
</td>
140
</tr> --> 
141
</table>
142
<br>
143
<input type=submit class=button value="Lancer la recherche" OnClick="this.form.find_user.value=1">
144
</form>
145
<?php
146
if (isset($find_user)){
147
	if ($find_user == 1){ echo $msg ;}}
148
?>
149
</td></tr>
150
</table>
151
</td></tr>
152
</table>
153
</td></tr>
154
</TABLE>
155
</td></tr>
156
</TABLE>
157
</body>
158
</html>