Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_showRecoveryCodes.twig « templates « TwoFactorAuth « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0d819fe804b211bc16300ff7d7ac59b9e1e7eef7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

<script type="text/javascript">
    function copyRecoveryCodesToClipboard()
    {
        var textarea = document.createElement('textarea');
        textarea.value = {{ codes|join("\n")|json_encode|raw }};
        textarea.setAttribute('readonly', '');
        textarea.style.position = 'absolute';
        textarea.style.left = '-9999px';
        document.body.appendChild(textarea);
        textarea.select();
        document.execCommand('copy');
        document.body.removeChild(textarea);
    }
    function downloadRecoveryCodes()
    {
        piwikHelper.sendContentAsDownload('analytics_recovery_codes.txt', {{ codes|join("\n")|json_encode|raw }});
    }
</script>

    <p>{{ 'TwoFactorAuth_RecoveryCodesExplanation'|translate }}<br /><br /></p>
    <div class="alert alert-warning">{{ 'TwoFactorAuth_RecoveryCodesSecurity'|translate }}</div>

    {% if codes|length > 0 %}
        <ul piwik-select-on-focus class="twoFactorRecoveryCodes">{% for code in codes %}
            <li>{{ code|upper|split('', 4)|join('-') }}</li>
        {% endfor %}
        </ul>
    {% else %}
        <div class="alert alert-danger">{{ 'TwoFactorAuth_RecoveryCodesAllUsed'|translate }}</div>
    {% endif %}

    <p>
        <br />
        <input type="button" class="btn backupRecoveryCode" onclick="downloadRecoveryCodes()" value="{{ 'General_Download'|translate }}">
        <input type="button" class="btn backupRecoveryCode" onclick="window.print()" value="{{ 'General_Print'|translate }}">
        <input type="button" class="btn backupRecoveryCode" onclick="copyRecoveryCodesToClipboard()" value="{{ 'General_Copy'|translate }}">
    </p>