<div class="clearfix mt-5 mb-5">
    <div class="page-header border-bottom mb-4">
        <h1><?php _e('Two-Factor Authentication') ?></h1>
    </div>
    <?php if (!empty($message)) { ?>
        <div class="alert alert-danger">
            <?php echo _escape($message); ?>
        </div>
    <?php } ?>
    <div class="row">
        <div class="col-md-6 col-12">
            <?php echo $this->form($form, 'vertical'); ?>
        </div>
        <div class="col-md-6 col-12">
            <?php if (
                isset($user['two_factor_status'])
                && (int)$user['two_factor_status'] == 1
                && isset($user['two_factor_secret'])
                && !empty($user['two_factor_secret'])
            ) { ?>
                <br />
                <ul class="p-3 m-0">
                    <li><?php _e('1- Open an authenticator app on your mobile device'); ?></li>
                    <li><?php _e('2- Enter the verification code in the field opposite '); ?></li>
                </ul>
            <?php } else { ?>
                <ul class="p-3 m-0">
                    <li><?php _e('1- Install an authenticator app on your mobile device'); ?></li>
                    <li><?php _e('2- Scan the following QR code in your authenticator app'); ?></li>
                </ul>
                <div class="p-3 m-0">
                    <img src="<?php echo $image; ?>" alt="<?php _e('Scan QR code'); ?>">
                    <p><?php _e('If the QR is not working, please enter the following code in your app'); ?> : <strong><?php echo chunk_split($secret, 4, ' '); ?></strong></p>
                </div>
            <?php } ?>
        </div>
    </div>
</div>
