<?php
/**
 * Maho
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
 * @copyright   Copyright (c) 2021-2024 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)
 */

/**
 * Customer login form template
 *
 * @var Mage_Oauth_Block_Authorize $this
 */

$rejectJs = "document.location.href='{$this->getRejectUrl()}';";
?>
<div class="account-login">
    <?= $this->getMessagesBlock()->toHtml() ?>
    <?php if (!$this->getHasException()): ?>
        <form action="<?= $this->getPostActionUrl() ?>" method="post" id="login-form">
            <?= $this->getBlockHtml('formkey') ?>
            <div class="col1-set">
                <div class="col-1 registered-users">
                    <div class="content" style="margin: 0 auto; padding-bottom: 13px;">
                        <h2><?= $this->__('Log in as a customer') ?></h2>
                        <p class="description"><?= $this->__('Log in to use <strong>%s</strong>', $this->getConsumer()->getName()) ?></p>
                        <ul class="form-list">
                            <li>
                                <label for="email"><?= $this->__('Email Address') ?></label>
                                <div class="input-box">
                                    <input type="text" name="login[username]" value="<?= $this->escapeHtml($this->getUsername()) ?>" id="email" class="input-text required-entry validate-email" title="<?= $this->__('Email Address') ?>" />
                                </div>
                            </li>
                            <li>
                                <label for="pass"><?= $this->__('Password') ?></label>
                                <div class="input-box">
                                    <input type="password" name="login[password]" class="input-text required-entry validate-password min-pass-length-5" id="pass" title="<?= $this->__('Password') ?>" autocomplete="off" />
                                </div>
                            </li>
                        </ul>
                        <div class="buttons-set" style="margin-top: 20px; padding: 0;">
                            <button type="submit" class="button" title="<?= $this->__('Login') ?>" name="send" id="send2">
                                <?= $this->__('Login') ?></button>
                            <button type="submit" class="button" onclick="<?= $rejectJs ?>"
                                    title="<?= $this->__('Reject') ?>" name="send">
                                <?= $this->__('Reject') ?></button>
                        </div>
                    </div>
                </div>
            </div>
            <input type="hidden" name="oauth_token" value="<?= $this->escapeHtml($this->getToken()) ?>"/>
        </form>
        <script type="text/javascript">
            var dataForm = new VarienForm('login-form', true);
        </script>
    <?php endif ?>
</div>
