Project

General

Profile

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