Commit 3cc75c2d authored by Andreas Valder's avatar Andreas Valder
Browse files

added password generator function to permission editor, closes #265

parent c48327c9
......@@ -191,8 +191,11 @@ var moderator = {
html += '<option value="none">Kein Zugriff</option>';
html += '</select>';
html += '<input class="col-xs-12 passwordinput authuser" type="text" placeholder="Benutzername">';
html += '<input class="col-xs-12 passwordinput authpassword" type="text" placeholder="Passwort">';
html += '<input class="col-xs-10 passwordinput authpassword" type="text" placeholder="Passwort">'
html += '<button class="col-xs-2 passwordinput authpgen" type="button" onclick="$(\'.authpassword\',this.parentNode).val(moderator.permissioneditor.randompw());"><span class="fa fa-plus" aria-hidden="true"></span></button>'
html += '<input class="col-xs-12 authl2p" type="text" placeholder="Lernraum" style="display: none;">';
html += '<button class="col-xs-6" onclick="moderator.permissioneditor.addbtnclick(this)">Add</button>';
//html += '<button class="col-xs-4" onclick="moderator.permissionedior.updatebtnclick(this)">Update</button>';
html += '<button class="col-xs-6" onclick="moderator.permissioneditor.delbtnclick(this)">Delete</button>';
......@@ -248,6 +251,15 @@ var moderator = {
$(".authl2p",element.parentElement).hide();
break;
}
},
randompw: function () {;
var array = new Uint8Array(10);
window.crypto.getRandomValues(array);
var result = '';
for (var i = 0; i< array.length; i++) {
result += String.fromCharCode(48+ (array[i]/255.0)*74);
}
return result;
}
},
plots: {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment