Subversion Repositories ALCASAR

Rev

Rev 1881 | Rev 1883 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1881 Rev 1882
Line 137... Line 137...
137
else if ($badusers == 1){
137
else if ($badusers == 1){
138
	if (is_file("../lib/add_badusers.php"))
138
	if (is_file("../lib/add_badusers.php"))
139
		include("../lib/add_badusers.php");
139
		include("../lib/add_badusers.php");
140
}
140
}
141
 
141
 
-
 
142
 
-
 
143
 
-
 
144
 
-
 
145
//si l'utilisateur fait parti d'un groupe, on charge les attributs du groupe, pour les afficher ensuite.
-
 
146
	if(isset($member_groups[0]))
-
 
147
	{
-
 
148
		echo "<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor=\"#ffffe0\" valign=top>";
-
 
149
		
-
 
150
		$group = $member_groups[0];
-
 
151
		$login_saved = $login;
-
 
152
		$login = $member_groups[0];
-
 
153
		include("../lib/sql/group_info.php");
-
 
154
		$login = $login_saved;
-
 
155
		
-
 
156
		
-
 
157
		echo "<tr>
-
 
158
		<td align=right colspan=$colspan bgcolor=\"#d0ddb0\">
-
 
159
		$l_new_password<br>
-
 
160
		</td>
-
 
161
		<td>
-
 
162
		<input type=password name=passwd value="" size=20>
-
 
163
		<br /><input type=\"button\" value=\"$l_passwd_gen\" onclick=\"password(8)\">
-
 
164
		<input type=\"text\" value=\"\" name=\"pwdgene\" size=10 readonly>
-
 
165
		</td>
-
 
166
		</tr>";
-
 
167
		
-
 
168
		
-
 
169
		foreach($show_attrs as $key => $desc){
-
 
170
		$name = $attrmap["$key"];
-
 
171
		$generic = (isset($attrmap['generic']["$key"])) ? $attrmap['generic']["$key"] : '';
-
 
172
		if ($name == 'none')
-
 
173
			continue;
-
 
174
		unset($vals);
-
 
175
		unset($selected);
-
 
176
		unset($ops);
-
 
177
		$def_added = 0;
-
 
178
		if (isset($item_vals["$key"]['count']) && $item_vals["$key"]['count']){
-
 
179
			for($i=0;$i<$item_vals["$key"]['count'];$i++){
-
 
180
				$vals[] = $item_vals["$key"][$i];
-
 
181
				$ops[] = $item_vals["$key"]['operator'][$i];
-
 
182
			}
-
 
183
		}
-
 
184
		else{
-
 
185
			if (isset($default_vals["$key"]['count']) && $default_vals["$key"]['count']){
-
 
186
				for($i=0;$i<$default_vals["$key"]['count'];$i++){
-
 
187
					$vals[] = $default_vals["$key"][$i];
-
 
188
					$ops[] = $default_vals["$key"]['operator'][$i];
-
 
189
				}
-
 
190
			}
-
 
191
			else{
-
 
192
				$vals[] = '';
-
 
193
				$ops[] = '=';
-
 
194
			}
-
 
195
			$def_added = 1;
-
 
196
		}
-
 
197
		if ($generic == 'generic' && $def_added == 0){
-
 
198
			for($i=0;$i<$default_vals["$key"]['count'];$i++){
-
 
199
				$vals[] = $default_vals["$key"][$i];
-
 
200
				$ops[] = $default_vals["$key"]['operator'][$i];
-
 
201
			}
-
 
202
		}
-
 
203
		if (isset($add) && $add && $name == $add_attr){
-
 
204
			$vals[] = $default_vals["$key"][0];
-
 
205
			$ops[] = ($default_vals["$key"]['operator'][0] != '') ? $default_vals["$key"]['operator'][0] : '=';
-
 
206
		}
-
 
207
 
-
 
208
		$i = 0;
-
 
209
		foreach($vals as $val){
-
 
210
			$name1 = $name . $i;
-
 
211
			$val = preg_replace('/\"/','&quot;',$val);
-
 
212
			$oper_name = $name1 . '_op';
-
 
213
			$oper = $ops[$i];
-
 
214
			$selected[$oper] = 'selected';
-
 
215
			$i++;
-
 
216
		switch ($key)
-
 
217
		{
-
 
218
				// $advanced = 1 : champs de saisie amélioré (calendrier, convertisseur, etc.)
-
 
219
			case 'Simultaneous-Use' :
-
 
220
				$advanced=1;
-
 
221
				$help_link="help/simultaneous_use_help.html";
-
 
222
				$desc=$l_simultaneous_use;
-
 
223
				break;
-
 
224
			case 'Max-All-Session' :
-
 
225
				$advanced=1;
-
 
226
				$help_link="help/max_all_session_help.html";
-
 
227
				$desc=$l_max_all_session;
-
 
228
				break;
-
 
229
			case 'Session-Timeout' :
-
 
230
				$advanced=1;
-
 
231
				$help_link="help/session_timeout_help.html";
-
 
232
				$desc=$l_session_timeout;
-
 
233
				break;
-
 
234
			case 'Max-Daily-Session' :
-
 
235
				$advanced=1;
-
 
236
				$help_link="help/session_timeout_help.html";
-
 
237
				$desc=$l_daily_timeout;
-
 
238
				break;
-
 
239
			case 'Max-Monthly-Session' :
-
 
240
				$advanced=1;
-
 
241
				$help_link="help/session_timeout_help.html";
-
 
242
				$desc=$l_monthly_timeout;
-
 
243
				break;
-
 
244
			case 'Login-Time' :
-
 
245
				$advanced=1;
-
 
246
				$help_link="help/login_time_help.html";
-
 
247
				$desc=$l_login_time;
-
 
248
				break;
-
 
249
			case 'Expiration' :
-
 
250
				$advanced=1;
-
 
251
				$help_link="help/expiration_help.html";
-
 
252
				$desc=$l_expiration;
-
 
253
				break;
-
 
254
			case 'ChilliSpot-Max-Input-Octets' :
-
 
255
				$advanced=1;
-
 
256
				$help_link="help/chillispot_max_input_octets_help.html";
-
 
257
				$desc=$l_max_input_octets;
-
 
258
				break;
-
 
259
			case 'ChilliSpot-Max-Output-Octets' :
-
 
260
				$advanced=1;
-
 
261
				$help_link="help/chillispot_max_output_octets_help.html";
-
 
262
				$desc=$l_max_output_octets;
-
 
263
				break;
-
 
264
			case 'ChilliSpot-Max-Total-Octets' :
-
 
265
				$advanced=1;
-
 
266
				$help_link="help/chillispot_max_total_octets_help.html";
-
 
267
				$desc=$l_max_total_octets;
-
 
268
				break;
-
 
269
			case 'ChilliSpot-Bandwidth-Max-Up' :
-
 
270
				$advanced=1;
-
 
271
				$help_link="help/chillispot_bandwidth_max_up_help.html";
-
 
272
				$desc=$l_max_bandwidth_up;
-
 
273
				break;
-
 
274
			case 'ChilliSpot-Bandwidth-Max-Down' :
-
 
275
				$advanced=1;
-
 
276
				$help_link="help/chillispot_bandwidth_max_down_help.html";
-
 
277
				$desc=$l_max_bandwidth_down;
-
 
278
				break;
-
 
279
			case 'WISPr-Redirection-URL' :
-
 
280
				$advanced=1;
-
 
281
				$help_link="help/wispr_redirection_url_help.html";
-
 
282
				$desc=$l_wispr_redirection;
-
 
283
				break;
-
 
284
			case 'Filter-Id' :
-
 
285
				$advanced=1;
-
 
286
				$help_link="help/filtering_help.html";
-
 
287
				$desc=$l_filtering;
-
 
288
				break;
-
 
289
			default:
-
 
290
				$advanced=1;
-
 
291
				break;
-
 
292
		}
-
 
293
			print <<<EOM
-
 
294
			<tr>
-
 
295
			<td class="etiquette">
-
 
296
			<a href="$help_link" target=help onclick=window.open("$help_link","help","width=600,height=250,toolbar=no,scrollbars=no,resizable=yes") title="$l_click_for_help"><font color="blue">$desc</font></a>
-
 
297
EOM;
-
 
298
			if ($show_ops){
-
 
299
				if(!isset($selected[$op_eq])) $selected[$op_eq] = '';
-
 
300
				switch ($key)
-
 
301
					{
-
 
302
					case 'Simultaneous-Use' :
-
 
303
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
-
 
304
						break;
-
 
305
					case 'Login-Time' :
-
 
306
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
-
 
307
						break;
-
 
308
					case 'Expiration' :
-
 
309
						if($login == "sms" && $user_type == 'group'){
-
 
310
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20 disabled></td>";
-
 
311
						} else {
-
 
312
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input id=\"popup_container\" type=text name=\"$name1\" value=\"$val\" size=20></td>";
-
 
313
						}
-
 
314
						break;
-
 
315
					case 'Max-All-Session' :
-
 
316
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
-
 
317
						break;
-
 
318
					case 'Session-Timeout' :
-
 
319
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
-
 
320
						break;
-
 
321
					case 'Max-Daily-Session' :
-
 
322
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
-
 
323
						break;
-
 
324
					case 'Max-Weekly-Session' :
-
 
325
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
-
 
326
						break;
-
 
327
					case 'Max-Monthly-Session' :
-
 
328
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\":=\">:=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
-
 
329
						break;
-
 
330
					case 'ChilliSpot-Max-Input-Octets' :
-
 
331
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
-
 
332
						break;
-
 
333
					case 'ChilliSpot-Max-Output-Octets' :
-
 
334
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
-
 
335
						break;
-
 
336
					case 'ChilliSpot-Max-Total-Octets' :
-
 
337
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
-
 
338
						break;
-
 
339
					case 'ChilliSpot-Bandwidth-Max-Up' :
-
 
340
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
-
 
341
						break;
-
 
342
					case 'ChilliSpot-Bandwidth-Max-Down' :
-
 
343
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
-
 
344
						break;
-
 
345
					case 'WISPr-Redirection-URL' :
-
 
346
						echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><input type=text name=\"$name1\" value=\"$val\" size=20></td>";
-
 
347
						break;
-
 
348
					case 'Filter-Id' :
-
 
349
						switch($val)
-
 
350
						{
-
 
351
							case "00000001":
-
 
352
								echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option value=\"00000000\">$l_filtering_none</option><option value=\"00000001\" selected=\"selected\">$l_filtering_havp</option><option value=\"00000011\">$l_filtering_havp_bl</option><option value=\"00000101\">$l_filtering_havp_wl</option></select></td>";
-
 
353
								break;
-
 
354
							case "00000011":
-
 
355
								echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option value=\"00000000\">$l_filtering_none</option><option value=\"00000001\">$l_filtering_havp</option><option value=\"00000011\" selected=\"selected\">$l_filtering_havp_bl</option><option value=\"00000101\">$l_filtering_havp_wl</option></select></td>";
-
 
356
								break;
-
 
357
							case "00000101":
-
 
358
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option value=\"00000000\">$l_filtering_none</option><option value=\"00000001\">$l_filtering_havp</option><option value=\"00000011\">$l_filtering_havp_bl</option><option value=\"00000101\" selected=\"selected\">$l_filtering_havp_wl</option></select></td>";
-
 
359
								break;
-
 
360
							default :
-
 
361
							echo "<td><select name=$oper_name><option $selected[$op_eq] value=\"=\">=</td><td><select name=\"$name1\"><option value=\"00000000\" selected=\"selected\">$l_filtering_none</option><option value=\"00000001\">$l_filtering_havp</option><option value=\"00000011\">$l_filtering_havp_bl</option><option value=\"00000101\">$l_filtering_havp_wl</option></select></td>";
-
 
362
								break;
-
 
363
						}
-
 
364
						break;
-
 
365
					default :
-
 
366
						print <<<EOM
-
 
367
<td>
-
 
368
<select name=$oper_name>
-
 
369
<option $selected[$op_eq] value="=">=
-
 
370
<option $selected[$op_set] value=":=">:=
-
 
371
<option $selected[$op_add] value="+=">+=
-
 
372
<option $selected[$op_eq2] value="==">==
-
 
373
<option $selected[$op_ne] value="!=">!=
-
 
374
<option $selected[$op_gt] value=">">&gt;
-
 
375
<option $selected[$op_ge] value=">=">&gt;=
-
 
376
<option $selected[$op_lt] value="<">&lt;
-
 
377
<option $selected[$op_le] value="<=">&lt;=
-
 
378
<option $selected[$op_regeq] value="=~">=~
-
 
379
<option $selected[$op_regne] value="!~">!~
-
 
380
<option $selected[$op_exst] value="=*">=*
-
 
381
<option $selected[$op_nexst] value="!*">!*
-
 
382
</select>
-
 
383
</td>
-
 
384
<td><input type=text name="$name1" value="$val" size=20></td>
-
 
385
EOM;
-
 
386
						break;
-
 
387
					}
-
 
388
				}
-
 
389
			print <<<EOM
-
 
390
</tr>
-
 
391
EOM;
-
 
392
		}
-
 
393
	}
-
 
394
		
-
 
395
 
-
 
396
	}
-
 
397
 
-
 
398
 
142
?>
399
?>
143
   <form name="edituser" method=post>
400
   <form name="edituser" method=post>
144
      <input type=hidden name=login value=<?php print $login ?>>
401
      <input type=hidden name=login value=<?php print $login ?>>
145
      <input type=hidden name=user_type value=<?php print $user_type ?>>
402
      <input type=hidden name=user_type value=<?php print $user_type ?>>
146
      <input type=hidden name=change value="0">
403
      <input type=hidden name=change value="0">
Line 163... Line 420...
163
<input type="text" value="" name="pwdgene" size=10 readonly>
420
<input type="text" value="" name="pwdgene" size=10 readonly>
164
</td>
421
</td>
165
</tr>
422
</tr>
166
EOM;
423
EOM;
167
}
424
}
168
	//si l'utilisateur fait parti d'un groupe, on charge les attributs du groupe, pour les afficher ensuite.
-
 
169
	if(isset($member_groups[0]))
-
 
170
	{
-
 
171
		$group = $member_groups[0];
-
 
172
		$login_saved = $login;
-
 
173
		$login = $member_groups[0];
-
 
174
		include("../lib/sql/group_info.php");
-
 
175
		$login = $login_saved;
-
 
176
 
-
 
177
	}
-
 
178
	
425
	
-
 
426
	/*on charge les attributs utilisateurs afin de montrer les groupes disponibles*/
-
 
427
	if ($user_type != 'group'){
-
 
428
		if (is_file("../lib/$config[general_lib_type]/user_info.php"))
-
 
429
			include("../lib/$config[general_lib_type]/user_info.php");
-
 
430
		if ($config['general_lib_type'] == 'sql' && $config['sql_show_all_groups'] == 'true'){
-
 
431
			$saved_login = $login;
-
 
432
			$login = '';
-
 
433
			if (is_file("../lib/sql/group_info.php"))
-
 
434
				include("../lib/sql/group_info.php");
-
 
435
			$login = $saved_login;
-
 
436
		}
-
 
437
	}
179
 
438
 
180
	foreach($show_attrs as $key => $desc){
439
	foreach($show_attrs as $key => $desc){
181
		$name = $attrmap["$key"];
440
		$name = $attrmap["$key"];
182
		$generic = (isset($attrmap['generic']["$key"])) ? $attrmap['generic']["$key"] : '';
441
		$generic = (isset($attrmap['generic']["$key"])) ? $attrmap['generic']["$key"] : '';
183
		if ($name == 'none')
442
		if ($name == 'none')
Line 410... Line 669...
410
</td>
669
</td>
411
<td>
670
<td>
412
EOM;
671
EOM;
413
 
672
 
414
 
673
 
415
 
-
 
416
	/*on charge les attributs utilisateurs afin de montrer les groupes disponibles*/
-
 
417
	if ($user_type != 'group'){
-
 
418
		if (is_file("../lib/$config[general_lib_type]/user_info.php"))
-
 
419
			include("../lib/$config[general_lib_type]/user_info.php");
-
 
420
		if ($config['general_lib_type'] == 'sql' && $config['sql_show_all_groups'] == 'true'){
-
 
421
			$saved_login = $login;
-
 
422
			$login = '';
-
 
423
			if (is_file("../lib/sql/group_info.php"))
-
 
424
				include("../lib/sql/group_info.php");
-
 
425
			$login = $saved_login;
-
 
426
		}
-
 
427
	}
-
 
428
 
-
 
429
	if (isset($existing_groups)){
674
	if (isset($existing_groups)){
430
	echo "<select size=5 name=\"edited_groups[]\"  OnChange=\"this.form.group_change.value=1\">";
675
	echo "<select size=5 name=\"edited_groups[]\"  OnChange=\"this.form.group_change.value=1\">";
431
	if ($config['sql_show_all_groups'] == 'true'){
676
	if ($config['sql_show_all_groups'] == 'true'){
432
		foreach ($existing_groups as $group => $count){
677
		foreach ($existing_groups as $group => $count){
433
			if (isset($member_groups[$group]) && ($member_groups[$group] == $group))
678
			if (isset($member_groups[$group]) && ($member_groups[$group] == $group))