diff --git a/client_contacts.php b/client_contacts.php
index 2b060187..084835e6 100644
--- a/client_contacts.php
+++ b/client_contacts.php
@@ -241,12 +241,36 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
+?>
diff --git a/client_logins.php b/client_logins.php
index dc1ddf21..a7030acc 100644
--- a/client_logins.php
+++ b/client_logins.php
@@ -50,7 +50,9 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
@@ -176,8 +181,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
function showOTP(id, secret) {
//Send a GET request to ajax.php as ajax.php?get_totp_token=true&totp_secret=SECRET
jQuery.get(
- "ajax.php",
- {get_totp_token: 'true', totp_secret: secret},
+ "ajax.php", {
+ get_totp_token: 'true',
+ totp_secret: secret
+ },
function(data) {
//If we get a response from post.php, parse it as JSON
const token = JSON.parse(data);
@@ -191,8 +198,10 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
function showOTPViaLoginID(login_id) {
// Send a GET request to ajax.php as ajax.php?get_totp_token_via_id=true&login_id=ID
jQuery.get(
- "ajax.php",
- {get_totp_token_via_id: 'true', login_id: login_id},
+ "ajax.php", {
+ get_totp_token_via_id: 'true',
+ login_id: login_id
+ },
function(data) {
//If we get a response from post.php, parse it as JSON
const token = JSON.parse(data);
@@ -204,7 +213,24 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
}
function generatePassword() {
- document.getElementById("password").value = ""
+ document.getElementById("password").value = ""
+ }
+
+ function generatePassword() {
+ var url = '/ajax.php?get_readable_pass=true';
+
+ // Make an AJAX request to the server
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET', url, true);
+
+ xhr.onreadystatechange = function() {
+ if (xhr.readyState == 4 && xhr.status == 200) {
+ var password = xhr.responseText;
+
+ document.getElementById("password").value = password;
+ }
+ };
+ xhr.send();
}
@@ -219,4 +245,3 @@ require_once "client_login_import_modal.php";
require_once "client_login_export_modal.php";
require_once "footer.php";
-