Project

General

Profile

« Previous | Next » 

Revision 7778a458

Added by sbeaver about 10 years ago

system_usermanager_passwordmg.php COnversion complete

Ready for review

View differences:

usr/local/www/system_usermanager_passwordmg.php
27 27
	POSSIBILITY OF SUCH DAMAGE.
28 28
*/
29 29
/*
30
        pfSense_BUILDER_BINARIES:
31
        pfSense_MODULE: auth
30
		pfSense_BUILDER_BINARIES:
31
		pfSense_MODULE: auth
32 32
*/
33 33

  
34 34
##|+PRIV
......
77 77

  
78 78
/* determine if user is not local to system */
79 79
$islocal = false;
80
foreach($config['system']['user'] as $user)
80

  
81
foreach($config['system']['user'] as $user) {
81 82
	if($user['name'] == $_SESSION['Username'])
82 83
		$islocal = true;
84
}
83 85

  
84 86
session_commit();
85 87

  
86 88
include("head.inc");
87 89

  
88
?>
89

  
90
<body link="#0000CC" vlink="#0000CC" alink="#0000CC" onload="<?= $jsevents["body"]["onload"] ?>">
91
<?php
92
include("fbegin.inc");
93

  
94 90
if ($input_errors)
95 91
	print_input_errors($input_errors);
92

  
96 93
if ($savemsg)
97 94
	print_info_box($savemsg);
98 95

  
99 96
if ($islocal == false) {
100 97
	echo gettext("Sorry, you cannot change the password for a non-local user.");
101
	include("fend.inc");
98
	include("foot.inc");
102 99
	exit;
103 100
}
104 101

  
105
?>
106

  
107
<div id="mainarea">
108
        <div class="tabcont">
109
                <form action="system_usermanager_passwordmg.php" method="post" name="iform" id="iform">
110
                        <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
111
                                <tr>
112
<?php if (!session_id())
113
		session_start();
114
?>
115
                                        <td colspan="2" valign="top" class="listtopic"><?=$_SESSION['Username']?>'s <?=gettext("Password"); ?></td>
116
<?php session_commit(); ?>
117
                                </tr>
118
                                <tr>
119
                                        <td width="22%" valign="top" class="vncell" rowspan="2"><?=gettext("Password"); ?></td>
120
                                        <td width="78%" class="vtable">
121
                                                <input name="passwordfld1" type="password" class="formfld pwd" id="passwordfld1" size="20" />
122
                                        </td>
123
                                </tr>
124
                                <tr>
125
                                        <td width="78%" class="vtable">
126
                                                <input name="passwordfld2" type="password" class="formfld pwd" id="passwordfld2" size="20" />
127
                                                &nbsp;<?=gettext("(confirmation)");?>
128
                                                <br />
129
                                                <span class="vexpl">
130
                                                        <?=gettext("Select a new password");?>
131
                                                </span>
132
                                        </td>
133
                                </tr>
134
                                <tr>
135
                                        <td width="22%" valign="top">&nbsp;</td>
136
                                        <td width="78%">
137
                                                <input name="save" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
138
                                        </td>
139
                                </tr>
140
                        </table>
141
                </form>
142
        </div>
143
</div>
144
<?php include("fend.inc");?>
145
</body>
146
</html>
102
require('classes/Form.class.php');
103

  
104
$form = new Form();
105

  
106
$section = new Form_Section('Update Password');
107

  
108
$section->addInput(new Form_Input(
109
	'passwordfld1',
110
	'Password',
111
	'password'
112
));
113

  
114
$section->addInput(new Form_Input(
115
	'passwordfld2',
116
	'Confirmation',
117
	'password'
118
))->setHelp('Select a new password');
119

  
120
$form->add($section);
121
print($form);
122

  
123
include("fend.inc");

Also available in: Unified diff