diff --git a/html/index.php b/html/index.php index 87f272de0..d5de46c7a 100755 --- a/html/index.php +++ b/html/index.php @@ -138,6 +138,7 @@ if ($config['page_refresh']) { echo(' + ' . "\n"); } ?> diff --git a/html/js/custom.js b/html/js/custom.js new file mode 100644 index 000000000..c25311b72 --- /dev/null +++ b/html/js/custom.js @@ -0,0 +1,22 @@ +$.extend({ + password: function (length, special) { + var iteration = 0; + var password = ""; + var randomNumber; + if(special == undefined){ + var special = false; + } + while(iteration < length){ + randomNumber = (Math.floor((Math.random() * 100)) % 94) + 33; + if(!special){ + if ((randomNumber >=33) && (randomNumber <=47)) { continue; } + if ((randomNumber >=58) && (randomNumber <=64)) { continue; } + if ((randomNumber >=91) && (randomNumber <=96)) { continue; } + if ((randomNumber >=123) && (randomNumber <=126)) { continue; } + } + iteration++; + password += String.fromCharCode(randomNumber); + } + return password; + } +}); diff --git a/html/pages/api-access.inc.php b/html/pages/api-access.inc.php index 5f1ed58be..c5d3504c8 100644 --- a/html/pages/api-access.inc.php +++ b/html/pages/api-access.inc.php @@ -16,24 +16,105 @@ if ($_SESSION['userlevel'] == '10') { ?>
+'); + if($_SESSION['api_token'] === TRUE) + { + echo(" + "); + unset($_SESSION['api_token']); + } +echo(' +| '.$api['username'].' | '.$api['token_hash'].' | '.$api['description'].' | - | Delete | +