Skip to content
Snippets Groups Projects

Moodle Authentication

Merged Roman Karwacik requested to merge romank/website:moodle-integration into master
8 files
+ 64
7
Compare changes
  • Side-by-side
  • Inline
Files
8
+ 18
0
@@ -197,6 +197,9 @@ var moderator = {
@@ -197,6 +197,9 @@ var moderator = {
case 'l2p':
case 'l2p':
permstring = '(' + perm.param1 + ')'
permstring = '(' + perm.param1 + ')'
break;
break;
 
case 'moodle':
 
permstring = '(' + perm.param1 + ')'
 
break;
}
}
html += '<option data-id="'+perm.id+'" data-type="'+perm.type+'" data-param1="'+perm.param1+'" data-param2="'+perm.param2+'">#'+perm.id+' '+perm.type+' '+ permstring +'</option>';
html += '<option data-id="'+perm.id+'" data-type="'+perm.type+'" data-param1="'+perm.param1+'" data-param2="'+perm.param2+'">#'+perm.id+' '+perm.type+' '+ permstring +'</option>';
}
}
@@ -220,6 +223,9 @@ var moderator = {
@@ -220,6 +223,9 @@ var moderator = {
case 'l2p':
case 'l2p':
$(".authl2p", container).val(perm.param1);
$(".authl2p", container).val(perm.param1);
break
break
 
case 'moodle':
 
$(".authmoodle", container).val(perm.param1);
 
break
}
}
$(".authtype option[value="+perm.type+"]").prop("selected", true);
$(".authtype option[value="+perm.type+"]").prop("selected", true);
},
},
@@ -266,6 +272,9 @@ var moderator = {
@@ -266,6 +272,9 @@ var moderator = {
case 'l2p':
case 'l2p':
perm.param1 = $(".authl2p", container).val();
perm.param1 = $(".authl2p", container).val();
break
break
 
case 'moodle':
 
perm.param1 = $(".authmoodle", container).val();
 
break
}
}
return perm;
return perm;
},
},
@@ -277,18 +286,27 @@ var moderator = {
@@ -277,18 +286,27 @@ var moderator = {
$(".authuser", container).val('');
$(".authuser", container).val('');
$(".authpassword", container).val('');
$(".authpassword", container).val('');
$(".authl2p", container).val('');
$(".authl2p", container).val('');
 
$(".authmoodle", container).val('');
switch (type) {
switch (type) {
case 'password':
case 'password':
$(".passwordinput",container).show();
$(".passwordinput",container).show();
$(".authl2p",container).hide();
$(".authl2p",container).hide();
 
$(".authmoodle",container).hide();
break;
break;
case 'l2p':
case 'l2p':
$(".passwordinput",container).hide();
$(".passwordinput",container).hide();
$(".authl2p",container).show();
$(".authl2p",container).show();
 
$(".authmoodle",container).hide();
 
break;
 
case 'moodle':
 
$(".passwordinput",container).hide();
 
$(".authl2p",container).hide();
 
$(".authmoodle",container).show();
break;
break;
default:
default:
$(".passwordinput",container).hide();
$(".passwordinput",container).hide();
$(".authl2p",container).hide();
$(".authl2p",container).hide();
 
$(".authmoodle",container).hide();
break;
break;
}
}
},
},
Loading