Fixing user create page QR-generation issues

revert-70aa11f8
dilanua 9 years ago
parent 73b4abc46b
commit 0836b2c99e

@ -113,15 +113,17 @@
<div id="user-created-msg" class="container col-centered wr-content hidden">
<div class="wr-form">
<p class="page-sub-title">User was added successfully.</p>
<br>
An invitation mail will be sent to this user to initiate device enrollment.
Below QR code can also be used to enroll a device.
<p>
An invitation mail will be sent to this user to initiate device enrollment.
Below QR code can also be used to enroll a device.
</p>
<div class="panel panel-default">
<div id="qr-code-modal" class="hidden" data-enrollment-url="{{enrollmentURL}}"></div>
<div class="panel-body">
<div class="qr-code col-lg-5 col-md-6 col-centered"></div>
</div>
</div>
<br>Please click <b>"Add Another User"</b>, if you wish to add another user or click
<b>"View User List"</b> to complete the process and go back to the user list.
<hr/>

@ -39,6 +39,7 @@ function onRequest() {
page["firstnameRegExViolationErrorMsg"] = devicemgtProps["userValidationConfig"]["firstnameRegExViolationErrorMsg"];
page["lastnameJSRegEx"] = devicemgtProps["userValidationConfig"]["lastnameJSRegEx"];
page["lastnameRegExViolationErrorMsg"] = devicemgtProps["userValidationConfig"]["lastnameRegExViolationErrorMsg"];
page["enrollmentURL"] = devicemgtProps["generalConfig"]["host"] + devicemgtProps["enrollmentDir"];
return page;
}

@ -86,7 +86,7 @@ validateInline["user-name"] = function () {
validateInline["first-name"] = function () {
var firstnameInput = $("input#firstname");
if (firstnameInput.val()) {
disableInlineError("firstNameField", "fnError");
disableInlineError("firstNameField", "fnError");
} else {
enableInlineError("firstNameField", "fnError");
}
@ -161,6 +161,18 @@ function emailIsValid(email) {
return regExp.test(email);
}
/*
* QR-code generation function.
*/
function generateQRCode(qrCodeClass) {
var enrollmentURL = $("#qr-code-modal").data("enrollment-url");
$(qrCodeClass).qrcode({
text: enrollmentURL,
width: 200,
height: 200
});
}
$("#userStore").change(
function () {
var str = "";

Loading…
Cancel
Save