-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule.js
32 lines (22 loc) · 915 Bytes
/
module.js
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
// This file is part of Moodle - http://moodle.org/
M.block_shibbuncif = {
Y: null, transaction: [],
submit: function() {
YUI().use('cookie', function(Y) {
var frm = document.forms['shibbuncif']; var ddlist = frm.elements['idp'];
if (ddlist.selectedIndex < 1)
return;
var cookievalue = btoa(ddlist.value);
Y.Cookie.set('_saml_idp', cookievalue, {
path: frm.elements['cookiepath'].value,
expires: new Date(Date.now() + (100 * 24 * 3600000)),
raw: true });
window.location.href = frm.elements['sessinit'].value + ddlist.value;
});
},
init: function(Y) {
this.Y = Y;
Y.one('form[name="shibbuncif"]').set('onsubmit', function() { return false; });
Y.one('form[name="shibbuncif"] input[type="submit"]').set('onclick', M.block_shibbuncif.submit);
},
};