generated from jric11/baseProject
Chat's updates for security, db and workflow
Security and workflow regressions / regression (push) Has been cancelled
Security and workflow regressions / regression (push) Has been cancelled
This commit is contained in:
+13
-9
@@ -27,11 +27,11 @@ $(document).ready(function () {
|
||||
// Get the User Information
|
||||
// ------------------------
|
||||
|
||||
$("#user_name").on("change", function () {
|
||||
$("#user_name").on("change", async function () {
|
||||
|
||||
clearInputErrors();
|
||||
|
||||
let user = formPost({action: "Users.getUser_AJAX", user_name: $(this).val()});
|
||||
let user = await formPost({action: "Users.getUser_AJAX", user_name: $(this).val()});
|
||||
|
||||
if (user.exists === true) {
|
||||
createInputError($(this), "User ID already exists");
|
||||
@@ -44,7 +44,7 @@ $(document).ready(function () {
|
||||
// Save Button
|
||||
// -----------
|
||||
|
||||
$(".btnSave").on("click", function (e) {
|
||||
$(".btnSave").on("click", async function (e) {
|
||||
e.preventDefault();
|
||||
$("#addUser").submit();
|
||||
});
|
||||
@@ -53,7 +53,7 @@ $(document).ready(function () {
|
||||
// Cancel Button.
|
||||
// --------------
|
||||
|
||||
$(".btnCancel").on("click", function () {
|
||||
$(".btnCancel").on("click", async function () {
|
||||
|
||||
$sessionStorage.action = $sessionStorage.addUser || "";
|
||||
|
||||
@@ -66,7 +66,7 @@ $(document).ready(function () {
|
||||
// Toggle Show Password
|
||||
// --------------------
|
||||
|
||||
$("#togglePassword").click(function () {
|
||||
$("#togglePassword").click(async function () {
|
||||
var passwordField = $("#user_password");
|
||||
var type = passwordField.attr("type") === "password" ? "text" : "password";
|
||||
passwordField.attr("type", type);
|
||||
@@ -80,7 +80,8 @@ $(document).ready(function () {
|
||||
// Validate Inputs
|
||||
// ---------------
|
||||
|
||||
$("#addUser").submit(function (e) {
|
||||
$("#addUser").submit(async function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var user_name = $("#user_name"),
|
||||
user_first_name = $("#user_first_name"),
|
||||
@@ -96,7 +97,7 @@ $(document).ready(function () {
|
||||
return false;
|
||||
}
|
||||
|
||||
let user = formPost({action: "Users.getUser_AJAX", user_name: user_name.val()});
|
||||
let user = await formPost({action: "Users.getUser_AJAX", user_name: user_name.val()});
|
||||
|
||||
if (user.valid === false) {
|
||||
createInputError(user_name, "User Name is invalid");
|
||||
@@ -109,7 +110,7 @@ $(document).ready(function () {
|
||||
}
|
||||
|
||||
if (isBlank(user_first_name)) {
|
||||
createInputError(user_first_name, "Client Name is required");
|
||||
createInputError(user_first_name, "First name is required");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -118,6 +119,7 @@ $(document).ready(function () {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isBlank($('#user_last_name'))) { createInputError($('#user_last_name'),'Last name is required');return false; }
|
||||
if ($("option:selected", user_role).val() === "") {
|
||||
createInputError(user_role, "Role is required");
|
||||
return false;
|
||||
@@ -127,7 +129,9 @@ $(document).ready(function () {
|
||||
e.preventDefault();
|
||||
|
||||
$.post("./", $(this).serialize())
|
||||
.done(function () {
|
||||
.done(function (result) {
|
||||
$sessionStorage.toast=result.warning || 'Account created and invitation sent.';
|
||||
sessionStorage.setItem($application,JSON.stringify($sessionStorage));
|
||||
formSubmit({action: $sessionStorage.addUser});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user