|
|
@ -1,12 +1,7 @@
|
|
|
|
//API_TOKEN generator
|
|
|
|
//API_TOKEN generator
|
|
|
|
var chars = "0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
|
|
var random_array = new Uint32Array(2);
|
|
|
|
var tokenLength = 12;
|
|
|
|
crypto.getRandomValues(random_array);
|
|
|
|
var token = "";
|
|
|
|
var token = random_array[0].toString() + random_array[1].toString();
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i <= tokenLength; i++) {
|
|
|
|
|
|
|
|
var randomNumber = Math.floor(Math.random() * chars.length);
|
|
|
|
|
|
|
|
token += chars.substring(randomNumber, randomNumber +1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
$(document).ready(function() {
|
|
|
|
if ($("#webmail").val() == 'none') {
|
|
|
|
if ($("#webmail").val() == 'none') {
|
|
|
@ -53,7 +48,7 @@ $(document).ready(function() {
|
|
|
|
$("#api_token_label").show();
|
|
|
|
$("#api_token_label").show();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$("#api_path").hide();
|
|
|
|
$("#api_path").hide();
|
|
|
|
$("#api_path").val("/api")
|
|
|
|
$("#api_path").val("")
|
|
|
|
$("#api_token").hide();
|
|
|
|
$("#api_token").hide();
|
|
|
|
$("#api_token").prop('required',false);
|
|
|
|
$("#api_token").prop('required',false);
|
|
|
|
$("#api_token").val("");
|
|
|
|
$("#api_token").val("");
|
|
|
@ -69,7 +64,7 @@ $(document).ready(function() {
|
|
|
|
$("#api_token_label").show();
|
|
|
|
$("#api_token_label").show();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$("#api_path").hide();
|
|
|
|
$("#api_path").hide();
|
|
|
|
$("#api_path").val("/api")
|
|
|
|
$("#api_path").val("")
|
|
|
|
$("#api_token").hide();
|
|
|
|
$("#api_token").hide();
|
|
|
|
$("#api_token").prop('required',false);
|
|
|
|
$("#api_token").prop('required',false);
|
|
|
|
$("#api_token").val("");
|
|
|
|
$("#api_token").val("");
|
|
|
|