Skip to content
Snippets Groups Projects
Commit eea3af2c authored by Andreas Valder's avatar Andreas Valder
Browse files

added l2p auth to ui, closes #66

parent 33594d68
Branches
No related tags found
No related merge requests found
...@@ -155,8 +155,9 @@ var moderator = { ...@@ -155,8 +155,9 @@ var moderator = {
html += '<option value="rwth">RWTH intern</option>'; html += '<option value="rwth">RWTH intern</option>';
html += '<option value="l2p">L2P Lernraum</option>'; html += '<option value="l2p">L2P Lernraum</option>';
html += '</select>'; html += '</select>';
html += '<input class="col-xs-12 passwordinput authuser" type="text" placeholder="username">'; html += '<input class="col-xs-12 passwordinput authuser" type="text" placeholder="Benutzername">';
html += '<input class="col-xs-12 passwordinput authpassword" type="text" placeholder="password">'; html += '<input class="col-xs-12 passwordinput authpassword" type="text" placeholder="Passwort">';
html += '<input class="col-xs-12 authl2p" type="text" placeholder="Lernraum" style="display: none;">';
html += '<button class="col-xs-6" onclick="moderator.acleditor.addbtnclick(this)">Add</button>'; html += '<button class="col-xs-6" onclick="moderator.acleditor.addbtnclick(this)">Add</button>';
//html += '<button class="col-xs-4" onclick="moderator.acleditor.updatebtnclick(this)">Update</button>'; //html += '<button class="col-xs-4" onclick="moderator.acleditor.updatebtnclick(this)">Update</button>';
html += '<button class="col-xs-6" onclick="moderator.acleditor.delbtnclick(this)">Delete</button>'; html += '<button class="col-xs-6" onclick="moderator.acleditor.delbtnclick(this)">Delete</button>';
...@@ -175,9 +176,14 @@ var moderator = { ...@@ -175,9 +176,14 @@ var moderator = {
addbtnclick: function (element) { addbtnclick: function (element) {
var perm = {}; var perm = {};
perm.type = $(".authtype", element.parentElement).val(); perm.type = $(".authtype", element.parentElement).val();
if (perm.type == "password") { switch(perm.type) {
case 'password':
perm.param1 = $(".authuser", element.parentElement).val(); perm.param1 = $(".authuser", element.parentElement).val();
perm.param2 = $(".authpassword", element.parentElement).val(); perm.param2 = $(".authpassword", element.parentElement).val();
break
case 'l2p':
perm.param1 = $(".authl2p", element.parentElement).val();
break
} }
dict = {} dict = {}
dict['type'] = perm.type; dict['type'] = perm.type;
...@@ -193,7 +199,20 @@ var moderator = { ...@@ -193,7 +199,20 @@ var moderator = {
$(".acllist",element.parentElement).append(option); $(".acllist",element.parentElement).append(option);
}, },
acltypechange: function (element) { acltypechange: function (element) {
$(".passwordinput",element.parentElement).toggle(); switch ($(element).val()) {
case 'password':
$(".passwordinput",element.parentElement).show();
$(".authl2p",element.parentElement).hide();
break;
case 'l2p':
$(".passwordinput",element.parentElement).hide();
$(".authl2p",element.parentElement).show();
break;
default:
$(".passwordinput",element.parentElement).hide();
$(".authl2p",element.parentElement).hide();
break;
}
} }
}, },
init: function () { init: function () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment