Project

General

Profile

Download (35.9 KB) Statistics
| Branch: | Tag: | Revision:
1 1df17ba9 Scott Ullrich
<?php
2
/* $Id$ */
3 fab7ff44 Bill Marquette
/*
4 1df17ba9 Scott Ullrich
    system_usermanager.php
5
    part of m0n0wall (http://m0n0.ch/wall)
6
7 6b07c15a Matthew Grooms
    Copyright (C) 2008 Shrew Soft Inc.
8
    All rights reserved.
9
10 1df17ba9 Scott Ullrich
    Copyright (C) 2005 Paul Taylor <paultaylor@winn-dixie.com>.
11
    All rights reserved.
12
13
    Copyright (C) 2003-2005 Manuel Kasper <mk@neon1.net>.
14
    All rights reserved.
15
16
    Redistribution and use in source and binary forms, with or without
17
    modification, are permitted provided that the following conditions are met:
18
19
    1. Redistributions of source code must retain the above copyright notice,
20
       this list of conditions and the following disclaimer.
21
22
    2. Redistributions in binary form must reproduce the above copyright
23
       notice, this list of conditions and the following disclaimer in the
24
       documentation and/or other materials provided with the distribution.
25
26
    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
27
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
28
    AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29
    AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
30
    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35
    POSSIBILITY OF SUCH DAMAGE.
36 fab7ff44 Bill Marquette
*/
37 1d333258 Scott Ullrich
/*
38
	pfSense_BUILDER_BINARIES:	
39
	pfSense_MODULE:	auth
40
*/
41 fab7ff44 Bill Marquette
42 6b07c15a Matthew Grooms
##|+PRIV
43
##|*IDENT=page-system-usermanager
44
##|*NAME=System: User Manager page
45
##|*DESCR=Allow access to the 'System: User Manager' page.
46
##|*MATCH=system_usermanager.php*
47
##|-PRIV
48
49 ead24d63 sullrich
require("certs.inc");
50 fab7ff44 Bill Marquette
require("guiconfig.inc");
51
52 45ee90ed Matthew Grooms
if (isAllowedPage("system_usermanager")) {
53 31b53653 Scott Ullrich
54 45ee90ed Matthew Grooms
	// start admin user code
55 b79454a7 Carlos Eduardo Ramos
	$pgtitle = array(gettext("System"),gettext("User Manager"));
56 fab7ff44 Bill Marquette
57 45ee90ed Matthew Grooms
	$id = $_GET['id'];
58
	if (isset($_POST['id']))
59
		$id = $_POST['id'];
60 1df17ba9 Scott Ullrich
61 7e4a4513 Scott Ullrich
	if (!is_array($config['system']['user'])) 
62
		$config['system']['user'] = array();
63 1df17ba9 Scott Ullrich
64 6b07c15a Matthew Grooms
	$a_user = &$config['system']['user'];
65 45ee90ed Matthew Grooms
66 6b07c15a Matthew Grooms
	if ($_GET['act'] == "deluser") {
67 45ee90ed Matthew Grooms
68 58fdb8ad Matthew Grooms
		if (!$a_user[$id]) {
69 6b07c15a Matthew Grooms
			pfSenseHeader("system_usermanager.php");
70
			exit;
71 45ee90ed Matthew Grooms
		}
72
73 58fdb8ad Matthew Grooms
		local_user_del($a_user[$id]);
74
		$userdeleted = $a_user[$id]['name'];
75
		unset($a_user[$id]);
76 6b07c15a Matthew Grooms
		write_config();
77
		$savemsg = gettext("User")." {$userdeleted} ".
78
					gettext("successfully deleted")."<br/>";
79
	}
80
81
	if ($_GET['act'] == "delpriv") {
82
83 58fdb8ad Matthew Grooms
		if (!$a_user[$id]) {
84 6b07c15a Matthew Grooms
			pfSenseHeader("system_usermanager.php");
85
			exit;
86 45ee90ed Matthew Grooms
		}
87 6b07c15a Matthew Grooms
88
		$privdeleted = $priv_list[$a_user[$id]['priv'][$_GET['privid']]]['name'];
89
		unset($a_user[$id]['priv'][$_GET['privid']]);
90 908cbaf9 jim-p
		local_user_set($a_user[$id]);
91 6b07c15a Matthew Grooms
		write_config();
92
		$_GET['act'] = "edit";
93
		$savemsg = gettext("Privilege")." {$privdeleted} ".
94
					gettext("successfully deleted")."<br/>";
95 45ee90ed Matthew Grooms
	}
96
97 93823b10 Matthew Grooms
	if ($_GET['act'] == "expcert") {
98
99
		if (!$a_user[$id]) {
100
			pfSenseHeader("system_usermanager.php");
101
			exit;
102
		}
103
104 c25f73ae jim-p
		$cert =& lookup_cert($a_user[$id]['cert'][$_GET['certid']]);
105 93823b10 Matthew Grooms
106 f2a86ca9 jim-p
		$exp_name = urlencode("{$a_user[$id]['name']}-{$cert['descr']}.crt");
107 93823b10 Matthew Grooms
		$exp_data = base64_decode($cert['crt']);
108
		$exp_size = strlen($exp_data);
109
110
		header("Content-Type: application/octet-stream");
111
		header("Content-Disposition: attachment; filename={$exp_name}");
112
		header("Content-Length: $exp_size");
113
		echo $exp_data;
114
		exit;
115
	}
116
117
	if ($_GET['act'] == "expckey") {
118
119
		if (!$a_user[$id]) {
120
			pfSenseHeader("system_usermanager.php");
121
			exit;
122
		}
123
124 c25f73ae jim-p
		$cert =& lookup_cert($a_user[$id]['cert'][$_GET['certid']]);
125 93823b10 Matthew Grooms
126 f2a86ca9 jim-p
		$exp_name = urlencode("{$a_user[$id]['name']}-{$cert['descr']}.key");
127 93823b10 Matthew Grooms
		$exp_data = base64_decode($cert['prv']);
128
		$exp_size = strlen($exp_data);
129
130
		header("Content-Type: application/octet-stream");
131
		header("Content-Disposition: attachment; filename={$exp_name}");
132
		header("Content-Length: $exp_size");
133
		echo $exp_data;
134
		exit;
135
	}
136
137 58fdb8ad Matthew Grooms
	if ($_GET['act'] == "delcert") {
138
139
		if (!$a_user[$id]) {
140
			pfSenseHeader("system_usermanager.php");
141
			exit;
142
		}
143
144 c25f73ae jim-p
		$certdeleted = lookup_cert($a_user[$id]['cert'][$_GET['certid']]);
145 f2a86ca9 jim-p
		$certdeleted = $certdeleted['descr'];
146 58fdb8ad Matthew Grooms
		unset($a_user[$id]['cert'][$_GET['certid']]);
147
		write_config();
148
		$_GET['act'] = "edit";
149
		$savemsg = gettext("Certificate")." {$certdeleted} ".
150 c25f73ae jim-p
					gettext("association removed.")."<br/>";
151 58fdb8ad Matthew Grooms
	}
152
153 45ee90ed Matthew Grooms
	if ($_GET['act'] == "edit") {
154
		if (isset($id) && $a_user[$id]) {
155
			$pconfig['usernamefld'] = $a_user[$id]['name'];
156 9ff73b79 jim-p
			$pconfig['descr'] = $a_user[$id]['descr'];
157 0092b3bd mgrooms
			$pconfig['expires'] = $a_user[$id]['expires'];
158 659fa7f2 Matthew Grooms
			$pconfig['groups'] = local_user_get_groups($a_user[$id]);
159 45ee90ed Matthew Grooms
			$pconfig['utype'] = $a_user[$id]['scope'];
160
			$pconfig['uid'] = $a_user[$id]['uid'];
161
			$pconfig['authorizedkeys'] = base64_decode($a_user[$id]['authorizedkeys']);
162 6b07c15a Matthew Grooms
			$pconfig['priv'] = $a_user[$id]['priv'];
163 ddd1fb7f jim-p
			$pconfig['ipsecpsk'] = $a_user[$id]['ipsecpsk'];
164 b4bfd25d sullrich
			$pconfig['disabled'] = isset($a_user[$id]['disabled']);
165 45ee90ed Matthew Grooms
		}
166
	}
167
168
	if ($_GET['act'] == "new") {
169
		/*
170
		 * set this value cause the text field is read only
171
		 * and the user should not be able to mess with this
172
		 * setting.
173
		 */
174
		$pconfig['utype'] = "user";
175 13646069 Ermal
		$pconfig['lifetime'] = 3650;
176 45ee90ed Matthew Grooms
	}
177
178
	if ($_POST) {
179
		unset($input_errors);
180
		$pconfig = $_POST;
181
182
		/* input validation */
183
		if (isset($id) && ($a_user[$id])) {
184
			$reqdfields = explode(" ", "usernamefld");
185 76d49f20 Renato Botelho
			$reqdfieldsn = array(gettext("Username"));
186 45ee90ed Matthew Grooms
		} else {
187 c9794c06 Ermal
			if (empty($_POST['name'])) {
188
				$reqdfields = explode(" ", "usernamefld passwordfld1");
189 76d49f20 Renato Botelho
				$reqdfieldsn = array(
190
					gettext("Username"),
191
					gettext("Password"));
192 c9794c06 Ermal
			} else {
193
				$reqdfields = explode(" ", "usernamefld passwordfld1 name caref keylen lifetime");
194 76d49f20 Renato Botelho
				$reqdfieldsn = array(
195
					gettext("Username"),
196
					gettext("Password"),
197
					gettext("Descriptive name"),
198
					gettext("Certificate authority"),
199
					gettext("Key length"),
200
					gettext("Lifetime"));
201 c9794c06 Ermal
			}
202 45ee90ed Matthew Grooms
		}
203
204
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
205
206
		if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['usernamefld']))
207
			$input_errors[] = gettext("The username contains invalid characters.");
208
209 94d455da jim-p
		if (strlen($_POST['usernamefld']) > 16)
210
			$input_errors[] = gettext("The username is longer than 16 characters.");
211
212 45ee90ed Matthew Grooms
		if (($_POST['passwordfld1']) && ($_POST['passwordfld1'] != $_POST['passwordfld2']))
213
			$input_errors[] = gettext("The passwords do not match.");
214
215 3dec33d4 Erik Fonnesbeck
		if (isset($id) && $a_user[$id])
216
			$oldusername = $a_user[$id]['name'];
217
		else
218
			$oldusername = "";
219 45ee90ed Matthew Grooms
		/* make sure this user name is unique */
220 3dec33d4 Erik Fonnesbeck
		if (!$input_errors) {
221 45ee90ed Matthew Grooms
			foreach ($a_user as $userent) {
222 3dec33d4 Erik Fonnesbeck
				if ($userent['name'] == $_POST['usernamefld'] && $oldusername != $_POST['usernamefld']) {
223 45ee90ed Matthew Grooms
					$input_errors[] = gettext("Another entry with the same username already exists.");
224
					break;
225
				}
226 58664cc9 Scott Ullrich
			}
227 3dec33d4 Erik Fonnesbeck
		}
228
		/* also make sure it is not reserved */
229
		if (!$input_errors) {
230 8339ab6d jim-p
			$system_users = explode("\n", file_get_contents("/etc/passwd"));
231
			foreach ($system_users as $s_user) {
232
				$ent = explode(":", $s_user);
233 3dec33d4 Erik Fonnesbeck
				if ($ent[0] == $_POST['usernamefld'] && $oldusername != $_POST['usernamefld']) {
234
					$input_errors[] = gettext("That username is reserved by the system.");
235 8339ab6d jim-p
					break;
236
				}
237
			}
238 7e4a4513 Scott Ullrich
		}
239 1df17ba9 Scott Ullrich
240 0092b3bd mgrooms
		/*
241
		 * Check for a valid expirationdate if one is set at all (valid means,
242
		 * strtotime() puts out a time stamp so any strtotime compatible time
243
		 * format may be used. to keep it simple for the enduser, we only
244
		 * claim to accept MM/DD/YYYY as inputs. Advanced users may use inputs
245
		 * like "+1 day", which will be converted to MM/DD/YYYY based on "now".
246
		 * Otherwhise such an entry would lead to an invalid expiration data.
247
		 */
248
		if ($_POST['expires']){
249
			if(strtotime($_POST['expires']) > 0){
250
				if (strtotime("-1 day") > strtotime(date("m/d/Y",strtotime($_POST['expires'])))) {
251 0a82fa9b sullrich
					// Allow items to lie in the past which ends up disabling.
252 0092b3bd mgrooms
				} else {
253
					//convert from any strtotime compatible date to MM/DD/YYYY
254
					$expdate = strtotime($_POST['expires']);
255
					$_POST['expires'] = date("m/d/Y",$expdate);
256
				}
257
			} else {
258 b79454a7 Carlos Eduardo Ramos
				$input_errors[] = gettext("Invalid expiration date format; use MM/DD/YYYY instead.");
259 0092b3bd mgrooms
			}
260
		}
261
262 c9794c06 Ermal
		if (!empty($_POST['name'])) {
263
			$ca = lookup_ca($_POST['caref']);
264
        		if (!$ca)
265 39c0be7b Vinicius Coque
                		$input_errors[] = gettext("Invalid internal Certificate Authority") . "\n";
266 c9794c06 Ermal
		}
267
268 45ee90ed Matthew Grooms
		/* if this is an AJAX caller then handle via JSON */
269
		if (isAjax() && is_array($input_errors)) {
270
			input_errors2Ajax($input_errors);
271
			exit;
272
		}
273 1df17ba9 Scott Ullrich
274 45ee90ed Matthew Grooms
		if (!$input_errors) {
275 e879fc81 Ermal
			conf_mount_rw();
276 45ee90ed Matthew Grooms
			$userent = array();
277
			if (isset($id) && $a_user[$id])
278
				$userent = $a_user[$id];
279 1df17ba9 Scott Ullrich
280 fb1266d3 Matthew Grooms
			isset($_POST['utype']) ? $userent['scope'] = $_POST['utype'] : $userent['scope'] = "system";
281
282 659fa7f2 Matthew Grooms
			/* the user name was modified */
283 45ee90ed Matthew Grooms
			if ($_POST['usernamefld'] <> $_POST['oldusername'])
284
				$_SERVER['REMOTE_USER'] = $_POST['usernamefld'];
285 7e4a4513 Scott Ullrich
286 659fa7f2 Matthew Grooms
			/* the user password was mofified */
287
			if ($_POST['passwordfld1'])
288
				local_user_set_password($userent, $_POST['passwordfld1']);
289
290 45ee90ed Matthew Grooms
			$userent['name'] = $_POST['usernamefld'];
291 9ff73b79 jim-p
			$userent['descr'] = $_POST['descr'];
292 0092b3bd mgrooms
			$userent['expires'] = $_POST['expires'];
293 fb1266d3 Matthew Grooms
			$userent['authorizedkeys'] = base64_encode($_POST['authorizedkeys']);
294 ddd1fb7f jim-p
			$userent['ipsecpsk'] = $_POST['ipsecpsk'];
295 b4bfd25d sullrich
			
296
			if($_POST['disabled'])
297
				$userent['disabled'] = true;
298
			else 
299
				unset($userent['disabled']);
300 1df17ba9 Scott Ullrich
301 45ee90ed Matthew Grooms
			if (isset($id) && $a_user[$id])
302
				$a_user[$id] = $userent;
303
			else {
304 c9794c06 Ermal
				if (!empty($_POST['name'])) {
305
					$cert = array();
306 3d6bbe4c jim-p
					$cert['refid'] = uniqid();
307 c9794c06 Ermal
                        		$userent['cert'] = array();
308
309 f2a86ca9 jim-p
					$cert['descr'] = $_POST['name'];
310 c9794c06 Ermal
311
                			$subject = cert_get_subject_array($ca['crt']);
312
313
                			$dn = array(
314
                        			'countryName' => $subject[0]['v'],
315
                        			'stateOrProvinceName' => $subject[1]['v'],
316
                        			'localityName' => $subject[2]['v'],
317
                        			'organizationName' => $subject[3]['v'],
318
                        			'emailAddress' => $subject[4]['v'],
319
                        			'commonName' => $userent['name']);
320
321
					cert_create($cert, $_POST['caref'], $_POST['keylen'],
322
						(int)$_POST['lifetime'], $dn);
323
324 c25f73ae jim-p
					if (!is_array($config['cert']))
325
						$config['cert'] = array();
326
					$config['cert'][] = $cert;
327
					$userent['cert'][] = $cert['refid'];
328 c9794c06 Ermal
				}
329 45ee90ed Matthew Grooms
				$userent['uid'] = $config['system']['nextuid']++;
330 e879fc81 Ermal
				/* Add the user to All Users group. */
331
				foreach ($config['system']['group'] as $gidx => $group) {
332
					if ($group['name'] == "all") {
333 a803793f jim-p
						if (!is_array($config['system']['group'][$gidx]['member']))
334
							$config['system']['group'][$gidx]['member'] = array();
335 e879fc81 Ermal
						$config['system']['group'][$gidx]['member'][] = $userent['uid'];
336
						break;
337
					}
338
				}
339
340 45ee90ed Matthew Grooms
				$a_user[] = $userent;
341
			}
342 1df17ba9 Scott Ullrich
343 659fa7f2 Matthew Grooms
			local_user_set_groups($userent,$_POST['groups']);
344 2934322e jim-p
			local_user_set($userent);
345 45ee90ed Matthew Grooms
			write_config();
346 1df17ba9 Scott Ullrich
347 970db70b Scott Ullrich
			if(is_dir("/etc/inc/privhooks"))
348
				run_plugins("/etc/inc/privhooks");
349
350 dff1a09d Scott Ullrich
			conf_mount_ro();
351
			
352 45ee90ed Matthew Grooms
			pfSenseHeader("system_usermanager.php");
353
		}
354
	}
355 fab7ff44 Bill Marquette
356 45ee90ed Matthew Grooms
	include("head.inc");
357 1df17ba9 Scott Ullrich
?>
358 fab7ff44 Bill Marquette
359 1df17ba9 Scott Ullrich
<body link="#000000" vlink="#000000" alink="#000000" onload="<?= $jsevents["body"]["onload"] ?>">
360 6b07c15a Matthew Grooms
<?php include("fbegin.inc"); ?>
361 0092b3bd mgrooms
<!--
362
//Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
363
//Script featured on JavaScript Kit (http://www.javascriptkit.com)
364
//For this script, visit http://www.javascriptkit.com
365
// -->
366 9344dd7b mgrooms
<script language="javascript" type="text/javascript" src="javascript/datetimepicker.js"></script>
367 6b07c15a Matthew Grooms
<script language="JavaScript">
368
<!--
369
370
function setall_selected(id) {
371
	selbox = document.getElementById(id);
372
	count = selbox.options.length;
373
	for (index = 0; index<count; index++)
374
		selbox.options[index].selected = true;
375
}
376
377
function clear_selected(id) {
378
	selbox = document.getElementById(id);
379
	count = selbox.options.length;
380
	for (index = 0; index<count; index++)
381
		selbox.options[index].selected = false;
382
}
383
384
function remove_selected(id) {
385
	selbox = document.getElementById(id);
386
	index = selbox.options.length - 1;
387
	for (; index >= 0; index--)
388
		if (selbox.options[index].selected)
389
			selbox.remove(index);
390
}
391
392
function copy_selected(srcid, dstid) {
393
	src_selbox = document.getElementById(srcid);
394
	dst_selbox = document.getElementById(dstid);
395
	count = src_selbox.options.length;
396
	for (index = 0; index < count; index++) {
397
		if (src_selbox.options[index].selected) {
398
			option = document.createElement('option');
399
			option.text = src_selbox.options[index].text;
400
			option.value = src_selbox.options[index].value;
401
			dst_selbox.add(option, null);
402
		}
403
	}
404
}
405
406
function move_selected(srcid, dstid) {
407
	copy_selected(srcid, dstid);
408
	remove_selected(srcid);
409
}
410
411
function presubmit() {
412
	clear_selected('notgroups');
413
	setall_selected('groups');
414
}
415
416 c9794c06 Ermal
function usercertClicked(obj) {
417
	if (obj.checked) {
418
		document.getElementById("usercertchck").style.display="none";
419
		document.getElementById("usercert").style.display="";
420
	} else {
421
		document.getElementById("usercert").style.display="none";
422
		document.getElementById("usercertchck").style.display="";
423
	}
424
}
425
426
function sshkeyClicked(obj) {
427
        if (obj.checked) {
428
                document.getElementById("sshkeychck").style.display="none";
429
                document.getElementById("sshkey").style.display="";
430
        } else {
431
                document.getElementById("sshkey").style.display="none";
432
                document.getElementById("sshkeychck").style.display="";
433
        }
434
}
435 6b07c15a Matthew Grooms
//-->
436
</script>
437 1df17ba9 Scott Ullrich
<?php
438 45ee90ed Matthew Grooms
	if ($input_errors)
439
		print_input_errors($input_errors);
440
	if ($savemsg)
441
		print_info_box($savemsg);
442 1df17ba9 Scott Ullrich
?>
443 45ee90ed Matthew Grooms
<table width="100%" border="0" cellpadding="0" cellspacing="0">
444
	<tr>
445 e30001cf Matthew Grooms
		<td>
446 45ee90ed Matthew Grooms
		<?php
447
			$tab_array = array();
448
			$tab_array[] = array(gettext("Users"), true, "system_usermanager.php");
449 6b07c15a Matthew Grooms
			$tab_array[] = array(gettext("Groups"), false, "system_groupmanager.php");
450 45ee90ed Matthew Grooms
			$tab_array[] = array(gettext("Settings"), false, "system_usermanager_settings.php");
451 d799787e Matthew Grooms
			$tab_array[] = array(gettext("Servers"), false, "system_authservers.php");
452 45ee90ed Matthew Grooms
			display_top_tabs($tab_array);
453
		?>
454
		</td>
455
	</tr>
456
	<tr>
457 e30001cf Matthew Grooms
		<td id="mainarea">
458
			<div class="tabcont">
459
460
				<?php if ($_GET['act'] == "new" || $_GET['act'] == "edit" || $input_errors): ?>
461
462
				<form action="system_usermanager.php" method="post" name="iform" id="iform" onsubmit="presubmit()">
463
					<table width="100%" border="0" cellpadding="6" cellspacing="0">
464
						<?php
465
							$ro = "";
466
							if ($pconfig['utype'] == "system")
467
								$ro = "readonly = \"readonly\"";
468
						?>
469
	                    <tr>
470
	                        <td width="22%" valign="top" class="vncell"><?=gettext("Defined by");?></td>
471
	                        <td width="78%" class="vtable">
472 93458966 Carlos Eduardo Ramos
	                            <strong><?=strtoupper($pconfig['utype']);?></strong>
473 dd5bf424 Scott Ullrich
								<input name="utype" type="hidden" value="<?=htmlspecialchars($pconfig['utype'])?>"/>
474 e30001cf Matthew Grooms
	                        </td>
475
	                    </tr>
476 b4bfd25d sullrich
						<tr>
477 2afddcb1 sullrich
							<td width="22%" valign="top" class="vncell"><?=gettext("Disabled");?></td>
478 b4bfd25d sullrich
							<td width="78%" class="vtable">
479
								<input name="disabled" type="checkbox" id="disabled" <?php if($pconfig['disabled']) echo "CHECKED"; ?>>
480
							</td>
481
						</tr>
482 e30001cf Matthew Grooms
						<tr>
483
							<td width="22%" valign="top" class="vncellreq"><?=gettext("Username");?></td>
484
							<td width="78%" class="vtable">
485 94d455da jim-p
								<input name="usernamefld" type="text" class="formfld user" id="usernamefld" size="20" maxlength="16" value="<?=htmlspecialchars($pconfig['usernamefld']);?>" <?=$ro;?>/>
486 e30001cf Matthew Grooms
								<input name="oldusername" type="hidden" id="oldusername" value="<?=htmlspecialchars($pconfig['usernamefld']);?>" />
487
							</td>
488
						</tr>
489
						<tr>
490
							<td width="22%" valign="top" class="vncellreq" rowspan="2"><?=gettext("Password");?></td>
491
							<td width="78%" class="vtable">
492
								<input name="passwordfld1" type="password" class="formfld pwd" id="passwordfld1" size="20" value="" />
493
							</td>
494
						</tr>
495
						<tr>
496
							<td width="78%" class="vtable">
497
								<input name="passwordfld2" type="password" class="formfld pwd" id="passwordfld2" size="20" value="" />&nbsp;<?= gettext("(confirmation)"); ?>
498
							</td>
499
						</tr>
500
						<tr>
501
							<td width="22%" valign="top" class="vncell"><?=gettext("Full name");?></td>
502
							<td width="78%" class="vtable">
503 9ff73b79 jim-p
								<input name="descr" type="text" class="formfld unknown" id="descr" size="20" value="<?=htmlspecialchars($pconfig['descr']);?>" <?=$ro;?>/>
504 e30001cf Matthew Grooms
								<br/>
505
								<?=gettext("User's full name, for your own information only");?>
506
							</td>
507
						</tr>
508 0092b3bd mgrooms
						<tr>
509 b79454a7 Carlos Eduardo Ramos
							<td width="22%" valign="top" class="vncell"><?=gettext("Expiration date"); ?></td>
510 0092b3bd mgrooms
							<td width="78%" class="vtable">
511 dd5bf424 Scott Ullrich
								<input name="expires" type="text" class="formfld unknown" id="expires" size="10" value="<?=htmlspecialchars($pconfig['expires']);?>">
512 0092b3bd mgrooms
								<a href="javascript:NewCal('expires','mmddyyyy')">
513 2b33f342 Renato Botelho
									<img src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_cal.gif" width="16" height="16" border="0" alt="<?=gettext("Pick a date");?>">
514 0092b3bd mgrooms
								</a>
515
								<br>
516 b79454a7 Carlos Eduardo Ramos
								<span class="vexpl"><?=gettext("Leave blank if the account shouldn't expire, otherwise enter the expiration date in the following format: mm/dd/yyyy"); ?></span></td>
517 0092b3bd mgrooms
						</tr>
518 e30001cf Matthew Grooms
						<tr>
519
							<td width="22%" valign="top" class="vncell"><?=gettext("Group Memberships");?></td>
520
							<td width="78%" class="vtable" align="center">
521
								<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
522
									<tr>
523
										<td align="center" width="50%">
524 b79454a7 Carlos Eduardo Ramos
											<strong><?=gettext("Not Member Of"); ?></strong><br/>
525 e30001cf Matthew Grooms
											<br/>
526
											<select size="10" style="width: 75%" name="notgroups[]" class="formselect" id="notgroups" onChange="clear_selected('groups')" multiple>
527
												<?php
528
													foreach ($config['system']['group'] as $group):
529
														if ($group['gid'] == 1998) /* all users group */
530
															continue;
531 08724afa jim-p
														if (is_array($pconfig['groups']) && in_array($group['name'],$pconfig['groups']))
532 e30001cf Matthew Grooms
															continue;
533
												?>
534
												<option value="<?=$group['name'];?>" <?=$selected;?>>
535
													<?=htmlspecialchars($group['name']);?>
536
												</option>
537
												<?php endforeach; ?>
538
											</select>
539
											<br/>
540
										</td>
541
										<td>
542
											<br/>
543
											<a href="javascript:move_selected('notgroups','groups')">
544 b79454a7 Carlos Eduardo Ramos
												<img src="/themes/<?= $g['theme'];?>/images/icons/icon_right.gif" title="<?=gettext("Add Groups"); ?>" alt="<?=gettext("Add Groups"); ?>" width="17" height="17" border="0" />
545 e30001cf Matthew Grooms
											</a>
546
											<br/><br/>
547
											<a href="javascript:move_selected('groups','notgroups')">
548 b79454a7 Carlos Eduardo Ramos
												<img src="/themes/<?= $g['theme'];?>/images/icons/icon_left.gif" title="<?=gettext("Remove Groups"); ?>" alt="<?=gettext("Remove Groups"); ?>" width="17" height="17" border="0" />
549 e30001cf Matthew Grooms
											</a>
550
										</td>
551
										<td align="center" width="50%">
552 b79454a7 Carlos Eduardo Ramos
											<strong><?=gettext("Member Of"); ?></strong><br/>
553 e30001cf Matthew Grooms
											<br/>
554
											<select size="10" style="width: 75%" name="groups[]" class="formselect" id="groups" onChange="clear_selected('nogroups')" multiple>
555
												<?php
556 08724afa jim-p
												if (is_array($pconfig['groups'])) {
557 e30001cf Matthew Grooms
													foreach ($config['system']['group'] as $group):
558
														if ($group['gid'] == 1998) /* all users group */
559
															continue;
560
														if (!in_array($group['name'],$pconfig['groups']))
561
															continue;
562
												?>
563
												<option value="<?=$group['name'];?>">
564
													<?=htmlspecialchars($group['name']);?>
565
												</option>
566 08724afa jim-p
												<?php endforeach;
567
												} ?>
568 e30001cf Matthew Grooms
											</select>
569
											<br/>
570
										</td>
571
									</tr>
572
								</table>
573
								<?=gettext("Hold down CTRL (pc)/COMMAND (mac) key to select multiple items");?>
574
							</td>
575
						</tr>
576
577
						<?php if ($pconfig['uid']): ?>
578
579
						<tr>
580
							<td width="22%" valign="top" class="vncell"><?=gettext("Effective Privileges");?></td>
581
							<td width="78%" class="vtable">
582
								<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
583
									<tr>
584
										<td width="20%" class="listhdrr"><?=gettext("Inherited From");?></td>
585
										<td width="30%" class="listhdrr"><?=gettext("Name");?></td>
586
										<td width="40%" class="listhdrr"><?=gettext("Description");?></td>
587
										<td class="list"></td>
588
									</tr>
589
									<?php
590
											
591
										$privdesc = get_user_privdesc($a_user[$id]);
592
										if(is_array($privdesc)):
593
											$i = 0;
594
											foreach ($privdesc as $priv):
595
											$group = false;
596
											if ($priv['group'])
597
												$group = $priv['group'];
598
									?>
599
									<tr>
600
										<td class="listlr"><?=$group;?></td>
601
										<td class="listr">
602
											<?=htmlspecialchars($priv['name']);?>
603
										</td>
604
										<td class="listbg">
605
												<?=htmlspecialchars($priv['descr']);?>
606
										</td>
607
										<td valign="middle" nowrap class="list">
608
											<?php if (!$group): ?>
609
											<a href="system_usermanager.php?act=delpriv&id=<?=$id?>&privid=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this privilege?");?>')">
610
												<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="" />
611
											</a>
612
											<?php endif; ?>
613
										</td>
614
									</tr>
615
									<?php
616
											/* can only delete user priv indexes */
617
											if (!$group)
618
												$i++;
619
											endforeach;
620
										endif;
621
									?>
622
									<tr>
623
										<td class="list" colspan="3"></td>
624
										<td class="list">
625
											<a href="system_usermanager_addprivs.php?userid=<?=$id?>">
626
												<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="" />
627
											</a>
628
										</td>
629
									</tr>
630
								</table>
631
							</td>
632
						</tr>
633
						<tr>
634
							<td width="22%" valign="top" class="vncell"><?=gettext("User Certificates");?></td>
635
							<td width="78%" class="vtable">
636
								<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
637
									<tr>
638
										<td width="45%" class="listhdrr"><?=gettext("Name");?></td>
639
										<td width="45%" class="listhdrr"><?=gettext("CA");?></td>
640
										<td class="list"></td>
641
									</tr>
642
									<?php
643
										
644
										$a_cert = $a_user[$id]['cert'];
645
										if(is_array($a_cert)):
646
											$i = 0;
647 c25f73ae jim-p
											foreach ($a_cert as $certref):
648
												$cert = lookup_cert($certref);
649
												$ca = lookup_ca($cert['caref']);
650 e30001cf Matthew Grooms
									?>
651
									<tr>
652
										<td class="listlr">
653 f2a86ca9 jim-p
											<?=htmlspecialchars($cert['descr']);?>
654 150bbe09 jim-p
											<?php if (is_cert_revoked($cert)): ?>
655
											(<b>Revoked</b>)
656
											<?php endif; ?>
657 e30001cf Matthew Grooms
										</td>
658
										<td class="listr">
659 f2a86ca9 jim-p
											<?=htmlspecialchars($ca['descr']);?>
660 e30001cf Matthew Grooms
										</td>
661
										<td valign="middle" nowrap class="list">
662
											<a href="system_usermanager.php?act=expckey&id=<?=$id;?>&certid=<?=$i;?>">
663 b79454a7 Carlos Eduardo Ramos
												<img src="/themes/<?= $g['theme'];?>/images/icons/icon_down.gif" title="<?=gettext("export private key"); ?>" alt="<?=gettext("export private key"); ?>" width="17" height="17" border="0" />
664 e30001cf Matthew Grooms
											</a>
665
											<a href="system_usermanager.php?act=expcert&id=<?=$id;?>&certid=<?=$i;?>">
666 b79454a7 Carlos Eduardo Ramos
												<img src="/themes/<?= $g['theme'];?>/images/icons/icon_down.gif" title="<?=gettext("export cert"); ?>" alt="<?=gettext("export cert"); ?>" width="17" height="17" border="0" />
667 e30001cf Matthew Grooms
											</a>
668 ad9b5c67 jim-p
											<a href="system_usermanager.php?act=delcert&id=<?=$id?>&certid=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to remove this certificate association?") .'\n'. gettext("(Certificate will not be deleted)");?>')">
669 2b33f342 Renato Botelho
												<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="<?=gettext("delete cert");?>" />
670 e30001cf Matthew Grooms
											</a>
671
										</td>
672
									</tr>
673
									<?php
674
												$i++;
675
											endforeach;
676
										endif;
677
									?>
678
									<tr>
679
										<td class="list" colspan="2"></td>
680
										<td class="list">
681 ad9b5c67 jim-p
											<a href="system_certmanager.php?act=new&userid=<?=$id?>">
682 e30001cf Matthew Grooms
												<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="" />
683
											</a>
684
										</td>
685
									</tr>
686
								</table>
687
							</td>
688
						</tr>
689 45ee90ed Matthew Grooms
690 c9794c06 Ermal
						<?php else : ?>
691 b4e6524c jim-p
						<?php 	if (is_array($config['ca']) && count($config['ca']) > 0): ?>
692
						<?php		$i = 0; foreach( $config['ca'] as $ca) {
693 c9794c06 Ermal
                                                                        	if (!$ca['prv'])
694
                                                                                	continue;
695
										$i++;
696
									}
697
						?>
698
699
						<tr id="usercertchck" name="usercertchck" >
700
							<td width="22%" valign="top" class="vncell"><?=gettext("Certificate");?></td>
701
                                                	<td width="78%" class="vtable">
702 b79454a7 Carlos Eduardo Ramos
							<input type="checkbox" onClick="javascript:usercertClicked(this)"> <?=gettext("Click to create a user certificate."); ?>
703 c9794c06 Ermal
							</td>
704
						</tr>
705
706
						<?php		if ($i > 0): ?>
707
708
						<tr id="usercert" name="usercert" style="display:none">
709
							<td width="22%" valign="top" class="vncell"><?=gettext("Certificate");?></td>
710
                                                	<td width="78%" class="vtable">
711 d0412d85 Ermal
							<table width="100%" border="0" cellpadding="6" cellspacing="0">
712 c9794c06 Ermal
							<tr>
713
                                                        	<td width="22%" valign="top" class="vncellreq"><?=gettext("Descriptive name");?></td>
714
                                                        	<td width="78%" class="vtable">
715 fa6c42d0 Erik Fonnesbeck
									<input name="name" type="text" class="formfld unknown" id="name" size="20" value="<?=htmlspecialchars($pconfig['name']);?>"/>
716 c9794c06 Ermal
                                                        	</td>
717
                                                	</tr>
718
                                                	<tr>
719
                                                        	<td width="22%" valign="top" class="vncellreq"><?=gettext("Certificate authority");?></td>
720
                                                        	<td width="78%" class="vtable">
721
                                                                	<select name='caref' id='caref' class="formselect" onChange='internalca_change()'>
722
                                                                <?php
723 b4e6524c jim-p
                                                                        foreach( $config['ca'] as $ca):
724 c9794c06 Ermal
                                                                        if (!$ca['prv'])
725
                                                                                continue;
726
                                                                ?>
727 f2a86ca9 jim-p
                                                                        <option value="<?=$ca['refid'];?>"><?=$ca['descr'];?></option>
728 c9794c06 Ermal
                                                                <?php endforeach; ?>
729
                                                                	</select>
730
                                                        	</td>
731
                                                	</tr>
732
                                                	<tr>
733
                                                        	<td width="22%" valign="top" class="vncellreq"><?=gettext("Key length");?></td>
734
                                                        	<td width="78%" class="vtable">
735
                                                                	<select name='keylen' class="formselect">
736
                                                                <?php
737 3b4b9ff3 Ermal
									$cert_keylens = array( "2048", "512", "1024", "4096");
738 c9794c06 Ermal
                                                                        foreach( $cert_keylens as $len):
739
                                                                ?>
740
                                                                        <option value="<?=$len;?>"><?=$len;?></option>
741
                                                                <?php endforeach; ?>
742
                                                                	</select>
743
                                                                	bits
744
                                                        	</td>
745
                                                	</tr>
746
							<tr>
747
                                                        	<td width="22%" valign="top" class="vncellreq"><?=gettext("Lifetime");?></td>
748
                                                        	<td width="78%" class="vtable">
749
                                                                	<input name="lifetime" type="text" class="formfld unknown" id="lifetime" size="5" value="<?=htmlspecialchars($pconfig['lifetime']);?>"/>days
750
                                                        	</td>
751
                                                	</tr>
752
						</table>
753
							</td>
754
						</tr>
755
756
						<?php 	endif; endif; ?>
757 e30001cf Matthew Grooms
						<?php endif; ?>
758 45ee90ed Matthew Grooms
759 c9794c06 Ermal
						<tr id="sshkeychck" name="sshkeychck" >
760
                                                        <td width="22%" valign="top" class="vncell"><?=gettext("Authorized keys");?></td>
761
                                                        <td width="78%" class="vtable">
762 b79454a7 Carlos Eduardo Ramos
                                                        <input type="checkbox" onClick="javascript:sshkeyClicked(this)"> <?=gettext("Click to paste an authorized key."); ?>
763 c9794c06 Ermal
                                                        </td>
764
                                                </tr>
765
						<tr id="sshkey" name="sshkey" style="display:none">
766 e30001cf Matthew Grooms
							<td width="22%" valign="top" class="vncell"><?=gettext("Authorized keys");?></td>
767
							<td width="78%" class="vtable">
768
								<textarea name="authorizedkeys" cols="65" rows="7" id="authorizedkeys" class="formfld_cert" wrap="off"><?=htmlspecialchars($pconfig['authorizedkeys']);?></textarea>
769
								<br/>
770
								<?=gettext("Paste an authorized keys file here.");?>
771
							</td>
772
						</tr>
773 ddd1fb7f jim-p
						<tr id="ipsecpskrow" name="ipsecpskrow">
774
							<td width="22%" valign="top" class="vncell"><?=gettext("IPsec Pre-Shared Key");?></td>
775
							<td width="78%" class="vtable">
776
								<input name="ipsecpsk" type="text" class="formfld unknown" id="ipsecpsk" size="65" value="<?=htmlspecialchars($pconfig['ipsecpsk']);?>">
777
							</td>
778
						</tr>
779 e30001cf Matthew Grooms
						<tr>
780
							<td width="22%" valign="top">&nbsp;</td>
781
							<td width="78%">
782 6e707e77 Vinicius Coque
								<input id="submit" name="save" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
783 e30001cf Matthew Grooms
								<?php if (isset($id) && $a_user[$id]): ?>
784
								<input name="id" type="hidden" value="<?=$id;?>" />
785
								<?php endif;?>
786
							</td>
787
						</tr>
788
					</table>
789
				</form>
790
791
				<?php else: ?>
792
793
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
794 45ee90ed Matthew Grooms
					<tr>
795 b79454a7 Carlos Eduardo Ramos
						<td width="25%" class="listhdrr"><?=gettext("Username"); ?></td>
796
						<td width="25%" class="listhdrr"><?=gettext("Full name"); ?></td>
797
						<td width="5%" class="listhdrr"><?=gettext("Disabled"); ?></td>
798
						<td width="25%" class="listhdrr"><?=gettext("Groups"); ?></td>
799 e30001cf Matthew Grooms
						<td width="10%" class="list"></td>
800 45ee90ed Matthew Grooms
					</tr>
801 e30001cf Matthew Grooms
					<?php
802
						$i = 0;
803
						foreach($a_user as $userent):
804
					?>
805
					<tr ondblclick="document.location='system_usermanager.php?act=edit&id=<?=$i;?>'">
806
						<td class="listlr">
807
							<table border="0" cellpadding="0" cellspacing="0">
808 6b07c15a Matthew Grooms
								<tr>
809 e30001cf Matthew Grooms
									<td align="left" valign="center">
810
										<?php
811
											if($userent['scope'] != "user")
812
												$usrimg = "/themes/{$g['theme']}/images/icons/icon_system-user-grey.png";
813
											else
814
												$usrimg = "/themes/{$g['theme']}/images/icons/icon_system-user.png";
815
										?>
816 b79454a7 Carlos Eduardo Ramos
										<img src="<?=$usrimg;?>" alt="<?=gettext("User"); ?>" title="<?=gettext("User"); ?>" border="0" height="16" width="16" />
817 6b07c15a Matthew Grooms
									</td>
818 e30001cf Matthew Grooms
									<td align="left" valign="middle">
819
										<?=htmlspecialchars($userent['name']);?>
820 6b07c15a Matthew Grooms
									</td>
821
								</tr>
822
							</table>
823 45ee90ed Matthew Grooms
						</td>
824 9ff73b79 jim-p
						<td class="listr"><?=htmlspecialchars($userent['descr']);?>&nbsp;</td>
825 b4bfd25d sullrich
						<td class="listr"><?php if(isset($userent['disabled'])) echo "*"; ?></td>
826 e30001cf Matthew Grooms
						<td class="listbg">
827
								<?=implode(",",local_user_get_groups($userent));?>
828
							&nbsp;
829 45ee90ed Matthew Grooms
						</td>
830 e30001cf Matthew Grooms
						<td valign="middle" nowrap class="list">
831
							<a href="system_usermanager.php?act=edit&id=<?=$i;?>">
832 b79454a7 Carlos Eduardo Ramos
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_e.gif" title="<?=gettext("edit user"); ?>" alt="<?=gettext("edit user"); ?>" width="17" height="17" border="0" />
833 e30001cf Matthew Grooms
							</a>
834
							<?php if($userent['scope'] != "system"): ?>
835
							&nbsp;
836
							<a href="system_usermanager.php?act=deluser&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this User?");?>')">
837 b79454a7 Carlos Eduardo Ramos
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_x.gif" title="<?=gettext("delete user"); ?>" alt="<?=gettext("delete user"); ?>" width="17" height="17" border="0" />
838 e30001cf Matthew Grooms
							</a>
839
							<?php endif; ?>
840 58fdb8ad Matthew Grooms
						</td>
841
					</tr>
842 e30001cf Matthew Grooms
					<?php
843
							$i++;
844
						endforeach;
845
					?>
846 fb1266d3 Matthew Grooms
					<tr>
847 b4bfd25d sullrich
						<td class="list" colspan="4"></td>
848 e30001cf Matthew Grooms
						<td class="list">
849
							<a href="system_usermanager.php?act=new">
850 b79454a7 Carlos Eduardo Ramos
								<img src="/themes/<?= $g['theme'];?>/images/icons/icon_plus.gif" title="<?=gettext("add user"); ?>" alt="<?=gettext("add user"); ?>" width="17" height="17" border="0" />
851 e30001cf Matthew Grooms
							</a>
852 fb1266d3 Matthew Grooms
						</td>
853
					</tr>
854 45ee90ed Matthew Grooms
					<tr>
855 b4bfd25d sullrich
						<td colspan="4">
856 e30001cf Matthew Grooms
							<p>
857 5b1dcebf Vinicius Coque
								<?=gettext("Additional webConfigurator users can be added here.
858
								User permissions can be assigned directly or inherited from group memberships.
859
								An icon that appears grey indicates that it is a system defined object. 
860
								Some system object properties can be modified but they cannot be deleted."); ?>
861 e30001cf Matthew Grooms
							</p>
862 45ee90ed Matthew Grooms
						</td>
863
					</tr>
864
				</table>
865
866 e30001cf Matthew Grooms
				<?php endif; ?>
867 45ee90ed Matthew Grooms
868 e30001cf Matthew Grooms
			</div>
869 45ee90ed Matthew Grooms
		</td>
870
	</tr>
871 1df17ba9 Scott Ullrich
</table>
872 45ee90ed Matthew Grooms
<?php include("fend.inc");?>
873
</body>
874
875 1df17ba9 Scott Ullrich
<?php
876
877 45ee90ed Matthew Grooms
	// end admin user code
878
879
} else {
880
881
	// start normal user code
882 6b07c15a Matthew Grooms
883 b79454a7 Carlos Eduardo Ramos
	$pgtitle = array(gettext("System"),gettext("User Password"));
884 45ee90ed Matthew Grooms
885
	if (isset($_POST['save'])) {
886
		unset($input_errors);
887
888
		/* input validation */
889
		$reqdfields = explode(" ", "passwordfld1");
890 76d49f20 Renato Botelho
		$reqdfieldsn = array(gettext("Password"));
891 1df17ba9 Scott Ullrich
892 45ee90ed Matthew Grooms
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
893 1df17ba9 Scott Ullrich
894 45ee90ed Matthew Grooms
		if ($_POST['passwordfld1'] != $_POST['passwordfld2'])
895 b79454a7 Carlos Eduardo Ramos
			$input_errors[] = gettext("The passwords do not match.");
896 1df17ba9 Scott Ullrich
897 45ee90ed Matthew Grooms
		if (!$input_errors) {
898
			// all values are okay --> saving changes
899
			$config['system']['user'][$userindex[$HTTP_SERVER_VARS['AUTH_USER']]]['password'] = crypt(trim($_POST['passwordfld1']));
900 c639315e jim-p
			local_user_set($config['system']['user'][$userindex[$HTTP_SERVER_VARS['AUTH_USER']]]);
901 45ee90ed Matthew Grooms
			write_config();
902 683c26cf Vinicius Coque
			$savemsg = gettext("Password successfully changed") . "<br />";
903 45ee90ed Matthew Grooms
		}
904
	}
905
906 4494cf6a Chris Buechler
	/* determine if user is not local to system */
907 45ee90ed Matthew Grooms
	$islocal = false;
908
	foreach($config['system']['user'] as $user) 
909
		if($user['name'] == $_SESSION['Username'])
910
			$islocal = true;
911 fab7ff44 Bill Marquette
?>
912 1df17ba9 Scott Ullrich
913 45ee90ed Matthew Grooms
<body link="#000000" vlink="#000000" alink="#000000" onload="<?= $jsevents["body"]["onload"] ?>">
914 1df17ba9 Scott Ullrich
<?php
915
    include("head.inc");
916 45ee90ed Matthew Grooms
	include("fbegin.inc");
917
	if ($input_errors)
918
		print_input_errors($input_errors);
919
	if ($savemsg)
920
		print_info_box($savemsg);
921
922
	if($islocal == false) {
923 b79454a7 Carlos Eduardo Ramos
		echo gettext("Sorry, you cannot change the password for a LDAP user.");
924 45ee90ed Matthew Grooms
		include("fend.inc");
925
		exit;
926
	}
927 1df17ba9 Scott Ullrich
?>
928 e30001cf Matthew Grooms
<div id="mainarea">
929
	<div class="tabcont">
930
		<form action="system_usermanager.php" method="post" name="iform" id="iform">
931
			<table width="100%" border="0" cellpadding="6" cellspacing="0">
932
				<tr>
933 b79454a7 Carlos Eduardo Ramos
					<td colspan="2" valign="top" class="listtopic"><?=$HTTP_SERVER_VARS['AUTH_USER']?>'s <?=gettext("Password"); ?></td>
934 e30001cf Matthew Grooms
				</tr>
935
				<tr>
936 b79454a7 Carlos Eduardo Ramos
					<td width="22%" valign="top" class="vncell" rowspan="2"><?=gettext("Password"); ?></td>
937 e30001cf Matthew Grooms
					<td width="78%" class="vtable">
938
						<input name="passwordfld1" type="password" class="formfld pwd" id="passwordfld1" size="20" />
939
					</td>
940
				</tr>
941
				<tr>
942
					<td width="78%" class="vtable">
943
						<input name="passwordfld2" type="password" class="formfld pwd" id="passwordfld2" size="20" />
944
						&nbsp;<?=gettext("(confirmation)");?>
945
						<br/>
946
						<span class="vexpl">
947
							<?=gettext("Select a new password");?>
948
						</span>
949
					</td>
950
				</tr>
951
				<tr>
952
					<td width="22%" valign="top">&nbsp;</td>
953
					<td width="78%">
954
						<input name="save" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
955
					</td>
956
				</tr>
957
			</table>
958
		</form>
959
	</div>
960
</div>
961 45ee90ed Matthew Grooms
<?php include("fend.inc");?>
962
</body>
963 82e913df Scott Ullrich
964 1df17ba9 Scott Ullrich
<?php
965
966 6b07c15a Matthew Grooms
} // end of normal user code
967 45ee90ed Matthew Grooms
968
?>