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 auth_lti/local/ltiadvantage/login
|
|
|
19 |
|
|
|
20 |
Template which displays a choice screen for instructors on first launch, allowing them to select whether to use an
|
|
|
21 |
existing account in the tool, or to auto provision a new one.
|
|
|
22 |
|
|
|
23 |
Classes required for JS:
|
|
|
24 |
* none
|
|
|
25 |
|
|
|
26 |
Data attributes required for JS:
|
|
|
27 |
* none
|
|
|
28 |
|
|
|
29 |
Context variables required for this template:
|
|
|
30 |
* formaction
|
|
|
31 |
* sesskey
|
|
|
32 |
* info - a notification describing the first launch options
|
|
|
33 |
* cancreateaccounts - whether or not the user is allowed to create auth_lti accounts
|
|
|
34 |
* accountinfo - information about the user, importantly whether they are logged in or not.
|
|
|
35 |
|
|
|
36 |
Example context (json):
|
|
|
37 |
{
|
|
|
38 |
"formaction": "auth/lti/login.php",
|
|
|
39 |
"sesskey": "1a2b3c4dfg",
|
|
|
40 |
"info": {
|
|
|
41 |
"message": "Looks like this is your first time here...",
|
|
|
42 |
"extraclasses": "",
|
|
|
43 |
"announce": false,
|
|
|
44 |
"closebutton": false,
|
|
|
45 |
"issuccess": true
|
|
|
46 |
},
|
|
|
47 |
"cancreateaccounts": true,
|
|
|
48 |
"isloggedin": true,
|
|
|
49 |
"accountinfo": {
|
|
|
50 |
"firstname": "John",
|
|
|
51 |
"lastname": "Smith",
|
|
|
52 |
"email": "john@example.com",
|
|
|
53 |
"picturehtml": "<img src=\"http://site.example.com/pluginfile.php/5/user/icon/boost/f2?rev=99\" class=\"round\" alt=\"\" width=\"35\" height=\"35\">"
|
|
|
54 |
}
|
|
|
55 |
}
|
|
|
56 |
}}
|
|
|
57 |
<div id="lti_adv_account_binding_options">
|
|
|
58 |
<form action="{{formaction}}" method="POST">
|
|
|
59 |
<input type="hidden" name="sesskey" value="{{sesskey}}">
|
|
|
60 |
<div class="container-fluid">
|
|
|
61 |
<h2>{{#str}} welcome, auth_lti {{/str}}</h2>
|
|
|
62 |
{{#info}}
|
|
|
63 |
{{> core/notification}}
|
|
|
64 |
{{/info}}
|
|
|
65 |
<div class="row">
|
|
|
66 |
<div class="{{#cancreateaccounts}}col-sm-6{{/cancreateaccounts}}{{^cancreateaccounts}}col-sm-12{{/cancreateaccounts}} d-flex">
|
|
|
67 |
<div class="card w-100">
|
|
|
68 |
<div class="card-header">
|
|
|
69 |
{{#str}} haveexistingaccount, auth_lti {{/str}}
|
|
|
70 |
</div>
|
|
|
71 |
<div class="card-body text-center d-flex flex-column">
|
|
|
72 |
<i class="fa fa-user-circle-o fa-2x link"></i>
|
|
|
73 |
<h4 class="card-title">{{#str}} useexistingaccount, auth_lti {{/str}}</h4>
|
|
|
74 |
{{#isloggedin}}
|
|
|
75 |
{{#accountinfo}}
|
|
|
76 |
<p class="card-text mt-2">
|
|
|
77 |
<span class="text-muted">
|
|
|
78 |
{{#str}} currentlyloggedinas, auth_lti {{/str}}
|
|
|
79 |
</span>
|
|
|
80 |
<br>
|
|
|
81 |
{{{picturehtml}}}
|
|
|
82 |
{{firstname}} {{lastname}} ({{email}})
|
|
|
83 |
</p>
|
|
|
84 |
<input type="submit" class="btn btn-primary mt-auto" name="existing_account" value="{{#str}} linkthisaccount, auth_lti {{/str}}">
|
|
|
85 |
{{/accountinfo}}
|
|
|
86 |
{{/isloggedin}}
|
|
|
87 |
{{^isloggedin}}
|
|
|
88 |
<p class="card-text text-muted">{{#str}} mustbeloggedin, auth_lti {{/str}}</p>
|
|
|
89 |
<input type="submit" class="btn btn-primary mt-auto" name="existing_account" value="{{#str}} login, moodle {{/str}}">
|
|
|
90 |
{{/isloggedin}}
|
|
|
91 |
</div>
|
|
|
92 |
</div>
|
|
|
93 |
</div>
|
|
|
94 |
{{#cancreateaccounts}}
|
|
|
95 |
<div class="col-sm-6 d-flex">
|
|
|
96 |
<div class="card w-100">
|
|
|
97 |
<div class="card-header">
|
|
|
98 |
{{#str}} createnewaccount, auth_lti {{/str}}
|
|
|
99 |
</div>
|
|
|
100 |
<div class="card-body text-center d-flex flex-column">
|
|
|
101 |
<i class="fa fa-user-plus fa-2x"></i>
|
|
|
102 |
<h4 class="card-title">{{#str}} createaccount, auth_lti {{/str}}</h4>
|
|
|
103 |
<p class="card-text text-muted">{{#str}} getstartedwithnewaccount, auth_lti {{/str}}</p>
|
|
|
104 |
<input type="submit" class="btn btn-secondary mt-auto" name="new_account" value="{{#str}} createaccountforme, auth_lti {{/str}}">
|
|
|
105 |
</div>
|
|
|
106 |
</div>
|
|
|
107 |
</div>
|
|
|
108 |
{{/cancreateaccounts}}
|
|
|
109 |
</div>
|
|
|
110 |
</div>
|
|
|
111 |
</form>
|
|
|
112 |
</div>
|