From 48d6c8a5890e79dfac98c461c687d93732176029 Mon Sep 17 00:00:00 2001 From: Wutze <6650981+Wutze@users.noreply.github.com> Date: Thu, 15 Oct 2020 11:11:54 +0200 Subject: [PATCH] Button enables/disables if user already exists or not --- wwwroot/include/html/modules/admin/admin-add.user.php | 4 ++-- wwwroot/js/user.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wwwroot/include/html/modules/admin/admin-add.user.php b/wwwroot/include/html/modules/admin/admin-add.user.php index baf7e9b..f686b09 100644 --- a/wwwroot/include/html/modules/admin/admin-add.user.php +++ b/wwwroot/include/html/modules/admin/admin-add.user.php @@ -15,7 +15,7 @@ * @copyright 2020 OpenVPN-WebAdmin * @link https://github.com/Wutze/OpenVPN-WebAdmin * @see Internal Documentation ~/doc/ - * @version 1.4.0 + * @version 1.4.1 * @todo new issues report here please https://github.com/Wutze/OpenVPN-WebAdmin/issues */ @@ -54,7 +54,7 @@
diff --git a/wwwroot/js/user.js b/wwwroot/js/user.js index c41c838..b28d6dd 100644 --- a/wwwroot/js/user.js +++ b/wwwroot/js/user.js @@ -14,7 +14,7 @@ * @copyright 2020 OpenVPN-WebAdmin * @link https://github.com/Wutze/OpenVPN-WebAdmin * @see Internal Documentation ~/doc/ - * @version 1.0.0 + * @version 1.4.1 * @todo new issues report here please https://github.com/Wutze/OpenVPN-WebAdmin/issues */ @@ -39,8 +39,10 @@ function showuser(str) { var isok = JSON.parse(this.responseText); if (isok['isuser']){ document.getElementById("InputUsername").style.backgroundColor = "#ea7782"; // username not found + document.getElementById("Plonk").disabled = true; }else{ document.getElementById("InputUsername").style.backgroundColor = "#90f7a7"; // username found + document.getElementById("Plonk").disabled = false; } } };