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,6 +71,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
// has the password changed? // has the password changed?
$originalPassword = $admin_details['password']; $originalPassword = $admin_details['password'];
if($fPassword != '') {
if($fPassword != $originalPassword) { if($fPassword != $originalPassword) {
// if it has, ensure both fields are the same... // if it has, ensure both fields are the same...
if ($fPassword == $fPassword2) if ($fPassword == $fPassword2)
@ -88,7 +89,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$pAdminEdit_admin_password_text = $PALANG['pAdminEdit_admin_password_text_error']; $pAdminEdit_admin_password_text = $PALANG['pAdminEdit_admin_password_text_error'];
} }
} }
}
$fDomains = array(); $fDomains = array();
if (array_key_exists('fDomains', $_POST)) $fDomains = escape_string ($_POST['fDomains']); if (array_key_exists('fDomains', $_POST)) $fDomains = escape_string ($_POST['fDomains']);
if ($error != 1) if ($error != 1)

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

Loading…
Cancel
Save