revert-70aa11f8
kamidu 8 years ago
commit 83cbd56b03

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

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

@ -161,6 +161,18 @@ function emailIsValid(email) {
return regExp.test(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( $("#userStore").change(
function () { function () {
var str = ""; var str = "";

@ -16,6 +16,18 @@
* under the License. * under the License.
*/ */
/**
* Checks if provided input is valid against RegEx input.
*
* @param regExp Regular expression
* @param inputString Input string to check
* @returns {boolean} Returns true if input matches RegEx
*/
function inputIsValid(regExp, inputString) {
regExp = new RegExp(regExp);
return regExp.test(inputString);
}
$(function () { $(function () {
var sortableElem = '.wr-sortable'; var sortableElem = '.wr-sortable';
$(sortableElem).sortable({ $(sortableElem).sortable({

Loading…
Cancel
Save