<?php
/**
 * Maho
 *
 * @category    design
 * @package     rwd_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
 * @copyright   Copyright (c) 2022-2023 The OpenMage Contributors (https://openmage.org)
 * @copyright   Copyright (c) 2024 Maho (https://mahocommerce.com)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<div class="page-title">
    <h1><?= $this->__('Change Account Password') ?></h1>
</div>
<?= $this->getMessagesBlock()->toHtml() ?>
<form action="<?= $action ?>" method="post" id="form-validate" class="scaffold-form">
<div class="fieldset">
    <h2 class="legend"><?= $this->__('Change Account Password') ?></h2>
    <p class="required"><?= $this->__('* Required Fields') ?></p>
    <ul class="form-list">
        <li>
            <label for="current_password" class="required"><em>*</em><?= $this->__('Current Password') ?></label>
            <div class="input-box">
                <input type="password" title="<?= Mage::helper('core')->quoteEscape($this->__('Current Password')) ?>" class="input-text required-entry" name="current_password" id="current_password" autocomplete="off" />
            </div>
        </li>
        <li class="fields">
            <div class="field">
                <label for="password" class="required"><em>*</em><?= $this->__('New Password') ?></label>
                <div class="input-box">
                    <?php $minPasswordLength = max((int)$this->getCustomer()->getMinPasswordLength(), Mage_Core_Model_App::ABSOLUTE_MIN_PASSWORD_LENGTH); ?>
                    <input type="password"
                           title="<?= Mage::helper('core')->quoteEscape($this->__('New Password')) ?>"
                           class="input-text required-entry validate-password min-pass-length-<?= $minPasswordLength ?>"
                           name="password"
                           id="password"
                           autocomplete="new-password" />
                    <p class="form-instructions">
                        <?= Mage::helper('customer')->__('The minimum password length is %s', $minPasswordLength) ?>
                    </p>
                </div>
            </div>
            <div class="field">
                <label for="confirmation" class="required"><em>*</em><?= $this->__('Confirm New Password') ?></label>
                <div class="input-box">
                    <input type="password" title="<?= Mage::helper('core')->quoteEscape($this->__('Confirm New Password')) ?>" class="input-text required-entry validate-cpassword" name="confirmation" id="confirmation" autocomplete="new-password" />
                </div>
            </div>
        </li>
    </ul>
</div>
<div class="buttons-set">
    <p class="back-link"><a href="<?= $this->getUrl('customer/account') ?>"><small>&laquo; </small><?= $this->__('Back') ?></a></p>
    <button type="submit" title="<?= Mage::helper('core')->quoteEscape($this->__('Save Password')) ?>" class="button"><?= $this->__('Save Password') ?></button>
</div>
</form>
<script type="text/javascript">
    var dataForm = new VarienForm('form-validate');
</script>
