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

/** @var Mage_Install_Block_Admin $this */
?>
<div class="page-head">
    <h3><?= $this->__('Create Admin Account') ?></h3>
</div>
<?= $this->getMessagesBlock()->toHtml() ?>
<form action="<?= $this->getPostUrl() ?>" method="post" id="form-validate">
<fieldset class="group-select wide">
 <legend><?= $this->__('Personal Information') ?></legend>
    <h4 class="legend"><?= $this->__('Personal Information') ?></h4>
    <ul>
        <li>
            <div class="input-box">
                <label for="firstname"><?= $this->__('First Name') ?> <span class="required">*</span></label><br/>
                <input type="text" name="admin[firstname]" id="firstname" value="<?= $this->getFormData()->getFirstname() ?>" title="<?= Mage::helper('core')->quoteEscape($this->__('First Name')) ?>" class="required-entry input-text"/>
            </div>
            <div class="input-box">
                <label for="lastname"><?= $this->__('Last Name') ?> <span class="required">*</span></label><br/>
                <input type="text" name="admin[lastname]" id="lastname" value="<?= $this->getFormData()->getLastname() ?>" title="<?= Mage::helper('core')->quoteEscape($this->__('Last Name')) ?>" class="required-entry input-text"/>
            </div>
        </li>
        <li>
            <label for="email_address"><?= $this->__('Email') ?> <span class="required">*</span></label><br/>
            <input type="text" name="admin[email]" id="email_address" value="<?= $this->getFormData()->getEmail() ?>" title="<?= Mage::helper('core')->quoteEscape($this->__('Email Address')) ?>" class="validate-email required-entry input-text"/>
        </li>
    </ul>
</fieldset>
<fieldset class="group-select wide">
    <legend><?= $this->__('Login Information') ?></legend>
    <h4 class="legend"><?= $this->__('Login Information') ?></h4>
    <ul>
        <li>
            <label for="username"><?= $this->__('Username') ?> <span class="required">*</span></label><br/>
            <input type="text" name="admin[username]" id="username" value="<?= $this->getFormData()->getUsername() ?>" title="<?= Mage::helper('core')->quoteEscape($this->__('Username')) ?>" class="required-entry input-text"/>
        </li>
        <li>
            <div class="input-box">
                <label for="password"><?= $this->__('Password') ?> <span class="required">*</span></label><br/>
                <!-- This is a dummy hidden field to trick firefox from auto filling the password -->
                <input type="password" class="input-text" name="dummy" id="dummy" style="display: none;"/>
                <?php $minAdminPasswordLength = $this->getMinAdminPasswordLength(); ?>
                <input type="password"
                       name="admin[new_password]"
                       id="password"
                       title="<?= Mage::helper('core')->quoteEscape($this->__('Password')) ?>"
                       class="required-entry validate-admin-password input-text min-admin-pass-length-<?= $minAdminPasswordLength ?>"
                       autocomplete="new-password"/>
                <p class="note">
                    <span>
                        <?= Mage::helper('adminhtml')->__('Password must be at least of %d characters.', $minAdminPasswordLength) ?>
                    </span>
                </p>
            </div>
            <div class="input-box">
                <label for="confirmation"><?= $this->__('Confirm Password') ?> <span
                            class="required">*</span></label><br/>
                <!-- This is a dummy hidden field to trick firefox from auto filling the password -->
                <input type="password" class="input-text" name="dummy" id="dummy" style="display: none;"/>
                <input type="password" name="admin[password_confirmation]" title="<?= Mage::helper('core')->quoteEscape($this->__('Password Confirmation')) ?>" id="confirmation" class="required-entry validate-cpassword input-text" autocomplete="new-password"/>
            </div>
        </li>
    </ul>
</fieldset>
<fieldset class="group-select wide">
    <legend><?= $this->__('Encryption Key') ?></legend>
    <h4 class="legend"><?= $this->__('Encryption Key') ?></h4>
    <ul>
        <li>
            <input type="text" name="encryption_key" id="encryption_key" value="<?= $this->getFormData()->getEncryptionKey() ?>" title="<?= Mage::helper('core')->quoteEscape($this->__('Encryption Key')) ?>" class="input-text"/>
            <p style="margin-top:4px; line-height:1.3em; color:#666;">
                <small><?= $this->__('Maho uses this key to encrypt passwords, credit cards and more. If this field is left empty the system will create an encryption key for you and will display it on the next page.') ?></small>
            </p>
        </li>
    </ul>
</fieldset>
<div class="button-set">
    <p class="required">* <?= $this->__('Required Fields') ?></p>
    <button class="form-button" type="submit"><span><?= $this->__('Continue') ?></span></button>
</div>
</form>
<script type="text/javascript">
    var dataForm = new VarienForm('form-validate');
</script>
