<form method="post" action="<?php echo Horde::applicationUrl('main.php') ?>" name="passwd">
<?php echo Horde::formInput() ?>
<?php if ($conf['backend']['backend_list'] == 'hidden'): ?>
<input type="hidden" name="backend" value="<?php echo $backend_key ?>" />
<?php endif; ?>
<?php if ($conf['user']['change'] !== true): ?>
<input type="hidden" name="userid" value="<?php echo htmlspecialchars($userid) ?>">
<?php endif; ?>

<table border="0" cellpadding="2" cellspacing="0">
<tr class="header">
    <td align="left" colspan="3" class="header">
        <?php echo _("Change your password") ?>
    </td>
</tr>

<?php if ($conf['backend']['backend_list'] == 'hidden'): ?>
<tr class="control">
    <td align="center" colspan="3" class="control">
        <?php printf(_("Changing password on %s"), htmlspecialchars($backends[$backend_key]['name'])) ?>
    </td>
</tr>
<?php endif; ?>

<?php if ($conf['user']['change'] === true): ?>
<tr class="item0">
    <td align="right" class="item0">
        <b><?php echo _("Username:") ?></b>
    </td>
    <td align="left" class="item0">
        <input type="text" name="userid" value="<?php echo htmlspecialchars($userid) ?>">
    </td>
    <td width="15" align="center" class="item0">
        <?php echo Help::link('passwd', 'passwd-username') ?>
    </td>
</tr>
<?php endif; ?>

<tr class="item0">
    <td align="right" class="item0">
        <b><?php echo _("Old password:") ?></b>
    </td>
    <td align="left" class="item0">
        <input type="password" tabindex="1" name="oldpassword" size="32" />
    </td>
    <td width="15" align="center" class="item0">
        <?php echo Help::link('passwd', 'passwd-old-password') ?>
    </td>
</tr>

<tr class="item1">
    <td align="right" class="item1">
        <b><?php echo _("New password:") ?></b>
    </td>
    <td align="left" class="item1">
        <input type="password" tabindex="2" name="newpassword0" size="32" />
    </td>
    <td width="15" align="center" class="item1">
        <?php echo Help::link('passwd', 'passwd-new-password') ?>
    </td>
</tr>

<tr class="item1">
    <td align="right" class="item1">
        <b><?php echo _("Confirm new password:") ?></b>
    </td>
    <td align="left" class="item1">
        <input type="password" tabindex="3" name="newpassword1" size="32" />
    </td>
    <td width="15" align="center" class="item1">
        <?php echo Help::link('passwd', 'passwd-confirm-password') ?>
    </td>
</tr>

<?php if ($conf['backend']['backend_list'] == 'shown'): ?>
<tr class="item0">
    <td align="right" class="item0">
        <b><?php echo _("Change password on:") ?></b>
    </td>
    <td align="left" class="item0">
        <select name="backend" tabindex="4">
            <?php echo $backends_list ?>
        </select>
    </td>
    <td width="15" align="center" class="item0">
        <?php echo Help::link('passwd', 'passwd-server') ?>
    </td>
</tr>
<?php endif; ?>

<tr class="control">
    <td align="left" colspan="3" class="control">
        <input class="button" type="submit" name="submit" value="<?php echo _("Change Password") ?>" onclick="return submit_form();">
        <input class="button" type="reset" name="reset" value="<?php echo _("Reset") ?>">
    </td>
</tr>
</table>
</form>
