From df97497fa4e92313c62e5b70c374bca59101f3e9 Mon Sep 17 00:00:00 2001 From: Pinga <121483313+getpinga@users.noreply.github.com> Date: Fri, 1 Sep 2023 17:13:06 +0300 Subject: [PATCH] A bit more work on contact create --- cp/resources/views/admin/contacts/create.twig | 251 +++++++++++++++--- cp/resources/views/admin/domains/create.twig | 2 +- 2 files changed, 210 insertions(+), 43 deletions(-) diff --git a/cp/resources/views/admin/contacts/create.twig b/cp/resources/views/admin/contacts/create.twig index a2f26f2..a263fcd 100644 --- a/cp/resources/views/admin/contacts/create.twig +++ b/cp/resources/views/admin/contacts/create.twig @@ -47,38 +47,139 @@
- -
-
General & Internationalized Info
- - -
- - -
+ +
+
General & Internationalized Info
+ + +
+ + +
+ + +
+
- + +
+ + +
+ + +
+
- -
- - -
+ +
+ + +
+
+ + +
+
+ + +
- -
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
- -
-
Contact Details
+ +
+
Contact Details
-
- - -
+ +
+ + +
+ + +
+
- -
+ +
+ + +
+ + +
+
+ + +
+ + +
+ + +
+
+ + +
+ + + Auto-generated authentication information for the contact. +
+ + +
+ + +
+ + +
+
+ + +
+ +
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ +
@@ -87,25 +188,76 @@
- -
@@ -145,6 +297,21 @@ document.addEventListener("DOMContentLoaded", function() { localizedSection.style.display = "none"; } }); + + // Generate authInfo for Contact + const authInfoInput = document.getElementById('authInfo'); + authInfoInput.value = generateAuthInfo(); + + function generateAuthInfo() { + const length = 16; + const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + let retVal = ""; + for (let i = 0; i < length; i++) { + const randomIndex = Math.floor(Math.random() * charset.length); + retVal += charset.charAt(randomIndex); + } + return retVal; + } }); {% endblock %} \ No newline at end of file diff --git a/cp/resources/views/admin/domains/create.twig b/cp/resources/views/admin/domains/create.twig index d9b3772..d275fe5 100644 --- a/cp/resources/views/admin/domains/create.twig +++ b/cp/resources/views/admin/domains/create.twig @@ -125,7 +125,7 @@ document.addEventListener("DOMContentLoaded", function() { function generateAuthInfo() { const charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; let result = ""; - for (let i = 0; i < 10; i++) { + for (let i = 0; i < 16; i++) { result += charset.charAt(Math.floor(Math.random() * charset.length)); } return result;