<?php
    // Set to defaults if undefined.
    if (!isset($config->expiration)) {
        $config->expiration = '';
    }
    if (!isset($config->expiration_warning)) {
        $config->expiration_warning = '';
    }
    if (!isset($config->expirationtime)) {
        $config->expirationtime = '';
    }
    $expirationoptions = array(
        new lang_string('no'),
        new lang_string('yes'),
    );
    $expirationtimeoptions = array(
        '30' => new lang_string('numdays', '', 30),
        '60' => new lang_string('numdays', '', 60),
        '90' => new lang_string('numdays', '', 90),
        '120' => new lang_string('numdays', '', 120),
        '150' => new lang_string('numdays', '', 150),
        '180' => new lang_string('numdays', '', 180),
        '365' => new lang_string('numdays', '', 365),
    );
    $expirationwarningoptions = array(
        '0' => new lang_string('never'),
        '1' => new lang_string('numdays', '', 1),
        '2' => new lang_string('numdays', '', 2),
        '3' => new lang_string('numdays', '', 3),
        '4' => new lang_string('numdays', '', 4),
        '5' => new lang_string('numdays', '', 5),
        '6' => new lang_string('numdays', '', 6),
        '7' => new lang_string('numdays', '', 7),
        '10' => new lang_string('numdays', '', 10),
        '14' => new lang_string('numdays', '', 14),
    );
?>
<table cellspacing="0" cellpadding="5" border="0">
    <tr>
        <td colspan="3">
            <h3><?php print_string('passwdexpire_settings', 'auth_manual') ?></h3>
        </td>
    </tr>
    <tr>
        <td align="right">
            <label for="menuexpiration">
                <?php print_string('expiration', 'auth_manual') ?>
            </label>
        </td>
        <td>
            <?php echo html_writer::select($expirationoptions, 'expiration', $config->expiration, false) ?>
        </td>
        <td><?php print_string('expiration_desc', 'auth_manual') ?></td>
    </tr>
    <tr>
        <td align="right">
            <label for="menuexpirationtime">
                <?php print_string('passwdexpiretime', 'auth_manual') ?>
            </label>
        </td>
        <td>
            <?php echo html_writer::select($expirationtimeoptions, 'expirationtime', $config->expirationtime, false) ?>
        </td>
        <td><?php print_string('passwdexpiretime_desc', 'auth_manual') ?></td>
    </tr>
    <tr>
        <td align="right">
            <label for="menuexpiration_warning">
                <?php print_string('expiration_warning', 'auth_manual') ?>
            </label>
        </td>
        <td>
            <?php echo html_writer::select($expirationwarningoptions, 'expiration_warning', $config->expiration_warning, false) ?>
        </td>
        <td><?php print_string('expiration_warning_desc', 'auth_manual') ?></td>
    </tr>
    <?php print_auth_lock_options($this->authtype, $user_fields, get_string('auth_fieldlocks_help', 'auth'), false, false) ?>
</table>
