2 This file is part of Moodle - http://moodle.org/
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.
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.
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/>.
18 @template auth_shibboleth/login_form
20 Template for the Shibboleth authentication plugin's login form.
22 Classes required for JS:
25 Data attributes required for JS:
28 Context variables required for this template:
29 * adminemail String The Administrator's email address.
30 * cansignup Boolean Whether a new user can sign up for an account.
31 * guestlogin Boolean Whether to show the guest login section.
32 * guestloginurl String The URL for guest login.
33 * idps Array The list of identity providers for the Shibboleth authentication plugin in value-name pairs per IDP.
34 * instructions String Signup instructions.
35 * isvalid Boolean Whether form validation passes.
36 * loginname String The custom login name.
37 * logintoken String The login token.
38 * loginurl String The login URL.
39 * showinstructions Boolean Whether to show additional login instructions.
40 * signupurl String The signup URL.
42 Example context (json):
48 { "value": 1, "name": "IDP 1" },
49 { "value": 2, "name": "IDP 2", "selected": true },
50 { "value": 3, "name": "IDP 3" }
52 "showinstructions": true,
53 "logintoken": "abcde",
54 "adminemail": "admin@example.com",
55 "loginname": "Shib auth",
58 "instructions": "Sign up here",
63 <div class="my-1 my-sm-5"></div>
64 <div class="container">
66 <h2 class="card-header">
67 {{#loginname}}{{.}}{{/loginname}}
68 {{^loginname}}{{#str}}auth_shibboleth_login_long, auth_shibboleth{{/str}}{{/loginname}}
70 <div class="card-body">
71 <div class="row justify-content-center ml-1 mr-1 mb-1">
72 <div class="col-md-5">
73 <form action="{{loginurl}}" method="post" id="login">
74 <div class="form-group">
75 <label for="idp">{{#str}}auth_shibboleth_select_organization, auth_shibboleth{{/str}}</label>
76 <select id="idp" name="idp" class="form-control input-block-level {{^isvalid}}is-invalid{{/isvalid}}">
77 <option value="-">{{#str}}auth_shibboleth_select_member, auth_shibboleth{{/str}}</option>
79 <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
82 <div class="invalid-feedback text-danger mb-1" {{#isvalid}}hidden{{/isvalid}}>
83 {{#str}}auth_shibboleth_errormsg, auth_shibboleth{{/str}}
86 <button type="submit" class="btn btn-primary btn-block mb-1" accesskey="s">
87 {{#str}}select, moodle{{/str}}
89 <p class="form-text text-muted mt-1 mb-1">
90 {{#str}}auth_shib_contact_administrator, auth_shibboleth, {{adminemail}}{{/str}}
95 <div class="col-md-5">
97 {{#str}}someallowguest, moodle{{/str}}
99 <form action="{{guestloginurl}}" method="post" id="guestlogin">
100 <div class="guestform">
101 <input type="hidden" name="logintoken" value="{{logintoken}}">
102 <input type="hidden" name="username" value="guest">
103 <input type="hidden" name="password" value="guest">
104 <button type="submit" class="btn btn-secondary btn-block">
105 {{#str}}loginguest, moodle{{/str}}
114 {{#showinstructions}}
115 <div class="card mt-1">
116 <div class="card-body ml-1 mr-1 mb-1">
117 <h2 class="card-title">{{#str}}firsttime, moodle{{/str}}</h2>
122 <form action="{{signupurl}}" method="get" id="signup">
123 <button type="submit" class="btn btn-secondary">{{#str}}startsignup, moodle{{/str}}</button>
128 {{/showinstructions}}