fix edit-admin to not use the db password to pre-populate the field - as per emails with Christian Boltz

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@143 a1433add-5e2c-0410-b055-b7f2511e0802
postfixadmin-2.3
David Goodwin 17 years ago
parent 1e5b40c348
commit 31c73f9256

@ -71,24 +71,25 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
// has the password changed?
$originalPassword = $admin_details['password'];
if($fPassword != $originalPassword) {
// if it has, ensure both fields are the same...
if ($fPassword == $fPassword2)
{
if(strlen($fPassword) >= $CONF['min_password_length']) {
$fPassword = pacrypt($fPassword);
if($fPassword != '') {
if($fPassword != $originalPassword) {
// if it has, ensure both fields are the same...
if ($fPassword == $fPassword2)
{
if(strlen($fPassword) >= $CONF['min_password_length']) {
$fPassword = pacrypt($fPassword);
}
else {
$error = 1;
flash_error(sprintf($PALANG['pPasswordTooShort'], $CONF['min_password_length']));
}
}
else {
$error = 1;
flash_error(sprintf($PALANG['pPasswordTooShort'], $CONF['min_password_length']));
$pAdminEdit_admin_password_text = $PALANG['pAdminEdit_admin_password_text_error'];
}
}
else {
$error = 1;
$pAdminEdit_admin_password_text = $PALANG['pAdminEdit_admin_password_text_error'];
}
}
$fDomains = array();
if (array_key_exists('fDomains', $_POST)) $fDomains = escape_string ($_POST['fDomains']);
if ($error != 1)

@ -4,27 +4,27 @@
<tr>
<td colspan="3"><h3><?php print $PALANG['pAdminEdit_admin_welcome']; ?></h3></td></tr>
<tr>
<td><?php print $PALANG['pAdminEdit_admin_username'] . ":"; ?></td>
<td><?php print $PALANG['pAdminEdit_admin_username']; ?>:</td>
<td><?php print $username; ?></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><?php print $PALANG['pAdminEdit_admin_password'] . ":"; ?></td>
<td><input class="flat" type="password" autocomplete="off" name="fPassword" value="<?php echo $tPassword; ?>"/></td>
<td><?php print $PALANG['pAdminEdit_admin_password']; ?>:</td>
<td><input class="flat" type="password" autocomplete="off" name="fPassword" value=""/></td>
<td><?php print $pAdminEdit_admin_password_text; ?></td>
</tr>
<tr>
<td><?php print $PALANG['pAdminEdit_admin_password2'] . ":"; ?></td>
<td><input class="flat" type="password" name="fPassword2" /></td>
<td><?php print $PALANG['pAdminEdit_admin_password2']; ?>:</td>
<td><input class="flat" type="password" name="fPassword2" value="" /></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><?php print $PALANG['pAdminEdit_admin_active'] . ":"; ?></td>
<td><?php print $PALANG['pAdminEdit_admin_active']; ?>:</td>
<td><input class="flat" type="checkbox" name="fActive" <?php print (!empty ($tActive)) ? 'checked' : ''; ?> /></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><?php print $PALANG['pAdminEdit_admin_super_admin'] . ":"; ?></td>
<td><?php print $PALANG['pAdminEdit_admin_super_admin']; ?>:</td>
<td><input class="flat" type="checkbox" name="fSadmin" <?php print (!empty ($tSadmin)) ? 'checked' : ''; ?> /></td>
<td>&nbsp;</td>
</tr>

Loading…
Cancel
Save