Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
{{!
2
    This file is part of Moodle - http://moodle.org/
3
 
4
    Moodle is free software: you can redistribute it and/or modify
5
    it under the terms of the GNU General Public License as published by
6
    the Free Software Foundation, either version 3 of the License, or
7
    (at your option) any later version.
8
 
9
    Moodle is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
    GNU General Public License for more details.
13
 
14
    You should have received a copy of the GNU General Public License
15
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16
}}
17
{{!
18
    @template tool_mfa/verification_form
19
 
20
    Template to display the MFA verification form and options.
21
 
22
    Example context (json):
23
    {
24
    "logintitle": "We've just sent a 6-digit code to your email",
25
    "logindesc": "Use the Google Authenticator app to generate a code.",
26
    "factoricon": "fa-envelope",
27
    "form": "<form id=\"mfa-verify-form\" method=\"POST\" action=\"https:\/\/webserver\/admin\/tool\/mfa\/auth.php\"></form>",
28
    "hasadditionalfactors": true,
29
    "additionalfactors": [
30
        {
31
        "name": "webauthn",
32
        "icon": "fa-hand-pointer",
33
        "loginoption": "Use authenticator token"
34
        }
35
    ],
36
    "authurl": "https:\/\/webserver\/admin\/tool\/mfa\/auth.php",
37
    "supportlink": "<a href=\"https:\/\/webserver\/user\/contactsitesupport.php\">Contact site support<\/a>",
38
    "disablefactor": false
39
    }
40
}}
41
 
42
<div>
43
    <div class="row">
44
        <div class="col-12">
45
            <h2>{{#str}} verification, tool_mfa {{/str}}</h2>
46
            <p>{{#str}} verification_desc, tool_mfa {{/str}}</p>
47
        </div>
48
    </div>
49
    <div class="mb-4 border-bottom"></div>
50
    <div class="d-flex align-items-start pb-2 {{#disablefactor}}text-muted{{/disablefactor}}">
51
        <div class="pt-1" style="flex: 0 0 auto;">
52
            <i class="fa {{factoricon}} fa-fw fa-2x" title="{{logintitle}}" role="img" aria-label="{{logintitle}}"></i>
53
        </div>
54
        <div style="flex: 1 1 auto; padding-left: 15px;" class="text-wrap">
55
            <strong>{{logintitle}}</strong><br>
56
            {{logindesc}}
57
        </div>
58
    </div>
59
</div>
60
<div class="mfa-verify-form">
61
    {{{form}}}
62
</div>
63
{{#hasadditionalfactors}}
64
    <div class="mb-6 mt-4 border-bottom"></div>
65
    <p class="font-weight-bold mb-1">{{#str}} verifyalt, tool_mfa {{/str}}</p>
66
{{/hasadditionalfactors}}
67
{{#additionalfactors}}
68
    <form id="{{uniqid}}-nextfactor" method="POST" action="{{{authurl}}}">
69
        <input type="hidden" id="{{uniqid}}-factorname" name="factorname" value="{{name}}">
70
        <button class="btn-link text-decoration-none tool-mfa-factor-choose d-flex align-items-center p-1 mb-2 {{#disable}}disabled{{/disable}}"
71
                type="submit">
72
            <span class="icon-no-margin icon-size-3 d-flex p-1 mr-2">
73
                <i class="fa {{icon}} fa-fw fa-2x"
74
                   title="{{logintitle}}"
75
                   role="img"
76
                   aria-label="{{logintitle}}"></i>
77
            </span>
78
            <span class="tool-mfa-factor-choose-text mfa-login-option">{{loginoption}}</span>
79
        </button>
80
    </form>
81
{{/additionalfactors}}
82
<div class="form-container text-center mt-3">
83
    <div class="d-flex justify-content-center">
84
        <form id="cancelmfa" method="POST" action="{{{authurl}}}">
85
            <input type="hidden" id="{{uniqid}}-logout" name="logout" value="true">
86
            <input type="hidden" name="sesskey" value="{{sesskey}}">
87
            <input type="submit" class="btn btn-secondary"
88
                   name="cancelmfa" id="cancelmfa_button"
89
                   value="{{#str}} cancellogin, tool_mfa {{/str}}">
90
        </form>
91
    </div>
92
    {{#supportlink}}
93
    <div class="tool-mfa-site-support mt-4">
94
        {{#str}} needhelp, tool_mfa {{/str}} {{{supportlink}}}
95
    </div>
96
    {{/supportlink}}
97
</div>
98