-
-
-
-{{/zone}}
-{{#zone "bottomJs"}}
-
-
-
-
-
-
- {{js "js/create.js"}}
-{{/zone}}
-
+{{/zone}}
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js
index 1dc93a5984..28142c13eb 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/create.js
@@ -17,46 +17,32 @@
*/
function onRequest(context) {
-// var DTYPE_CONF_DEVICE_TYPE_KEY = "deviceType";
-// var DTYPE_CONF_DEVICE_TYPE_LABEL_KEY = "label";
-//
-// var utility = require("/app/modules/utility.js").utility;
-// var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
-//
-// var types = {};
-// types["types"] = [];
-// var typesListResponse = userModule.getPlatforms();
-// if (typesListResponse["status"] == "success") {
-// for (var type in typesListResponse["content"]) {
-// var content = {};
-// var deviceType = typesListResponse["content"]["deviceTypes"][type];
-// content["name"] = deviceType;
-// var configs = utility.getDeviceTypeConfig(deviceType);
-// var deviceTypeLabel = deviceType;
-// if (configs && configs[DTYPE_CONF_DEVICE_TYPE_KEY][DTYPE_CONF_DEVICE_TYPE_LABEL_KEY]) {
-// deviceTypeLabel = configs[DTYPE_CONF_DEVICE_TYPE_KEY][DTYPE_CONF_DEVICE_TYPE_LABEL_KEY];
-// }
-// var policyWizard = new File("/app/units/" + utility.getTenantedDeviceUnitName(deviceType, "policy-wizard"));
-// if(policyWizard.isExists()){
-// content["icon"] = utility.getDeviceThumb(deviceType);
-// content["label"] = deviceTypeLabel;
-// types["types"].push(content);
-// }
-// }
-// }
-// return types;
+ var DTYPE_CONF_DEVICE_TYPE_KEY = "deviceType";
+ var DTYPE_CONF_DEVICE_TYPE_LABEL_KEY = "label";
- //var log = new Log("units/policy-create/policy-create.js");
+ var utility = require("/app/modules/utility.js").utility;
var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
- var result = userModule.getRolesByUserStore();
- if (result["status"] == "success") {
- context["roles"] = result["content"];
+ var types = {};
+ types["types"] = [];
+ var typesListResponse = userModule.getPlatforms();
+ if (typesListResponse["status"] == "success") {
+ for (var type in typesListResponse["content"]) {
+ var content = {};
+ var deviceType = typesListResponse["content"]["deviceTypes"][type];
+ content["name"] = deviceType;
+ var configs = utility.getDeviceTypeConfig(deviceType);
+ var deviceTypeLabel = deviceType;
+ if (configs && configs[DTYPE_CONF_DEVICE_TYPE_KEY][DTYPE_CONF_DEVICE_TYPE_LABEL_KEY]) {
+ deviceTypeLabel = configs[DTYPE_CONF_DEVICE_TYPE_KEY][DTYPE_CONF_DEVICE_TYPE_LABEL_KEY];
+ }
+ var policyWizard = new File("/app/units/" + utility.getTenantedDeviceUnitName(deviceType, "policy-wizard"));
+ if(policyWizard.isExists()){
+ content["icon"] = utility.getDeviceThumb(deviceType);
+ content["label"] = deviceTypeLabel;
+ types["types"].push(content);
+ }
+ }
}
-
- result = userModule.getPlatforms();
- if (result["status"] == "success") {
- context["deviceTypes"] = result["content"]["deviceTypes"];
- }
- return context;
+ return types;
}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/js/create.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/js/create.js
deleted file mode 100644
index f1cd05a101..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/js/create.js
+++ /dev/null
@@ -1,2833 +0,0 @@
-/*
- * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
- *
- * WSO2 Inc. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
- * either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-var validateStep = {};
-var stepForwardFrom = {};
-var stepBackFrom = {};
-var policy = {};
-var configuredOperations = [];
-
-// Constants to define platform types available
-var platformTypeConstants = {
- "ANDROID": "android",
- "IOS": "ios",
- "WINDOWS": "windows"
-};
-
-// Constants to define platform types ids.
-var platformIds = {
- "ANDROID": 1,
- "IOS": 3,
- "WINDOWS": 2
-};
-
-// Constants to define Android Operation Constants
-var androidOperationConstants = {
- "PASSCODE_POLICY_OPERATION": "passcode-policy",
- "PASSCODE_POLICY_OPERATION_CODE": "PASSCODE_POLICY",
- "CAMERA_OPERATION": "camera",
- "CAMERA_OPERATION_CODE": "CAMERA",
- "ENCRYPT_STORAGE_OPERATION": "encrypt-storage",
- "ENCRYPT_STORAGE_OPERATION_CODE": "ENCRYPT_STORAGE",
- "WIFI_OPERATION": "wifi",
- "WIFI_OPERATION_CODE": "WIFI",
- "VPN_OPERATION": "vpn",
- "VPN_OPERATION_CODE": "VPN",
- "APPLICATION_OPERATION":"app-restriction",
- "APPLICATION_OPERATION_CODE":"APP-RESTRICTION"
-};
-
-// Constants to define iOS Operation Constants
-var iosOperationConstants = {
- "PASSCODE_POLICY_OPERATION": "passcode-policy",
- "PASSCODE_POLICY_OPERATION_CODE": "PASSCODE_POLICY",
- "RESTRICTIONS_OPERATION": "restrictions",
- "RESTRICTIONS_OPERATION_CODE": "RESTRICTION",
- "WIFI_OPERATION": "wifi",
- "WIFI_OPERATION_CODE": "WIFI",
- "EMAIL_OPERATION": "email",
- "EMAIL_OPERATION_CODE": "EMAIL",
- "AIRPLAY_OPERATION": "airplay",
- "AIRPLAY_OPERATION_CODE": "AIR_PLAY",
- "LDAP_OPERATION": "ldap",
- "LDAP_OPERATION_CODE": "LDAP",
- "CALENDAR_OPERATION": "calendar",
- "CALENDAR_OPERATION_CODE": "CALDAV",
- "CALENDAR_SUBSCRIPTION_OPERATION": "calendar-subscription",
- "CALENDAR_SUBSCRIPTION_OPERATION_CODE": "CALENDAR_SUBSCRIPTION",
- "APN_OPERATION": "apn",
- "APN_OPERATION_CODE": "APN",
- "CELLULAR_OPERATION": "cellular",
- "CELLULAR_OPERATION_CODE": "CELLULAR",
- "DOMAIN": "DOMAIN",
- "VPN_OPERATION_CODE": "VPN",
- "VPN_OPERATION": "vpn",
- "PER_APP_VPN_OPERATION_CODE": "PER_APP_VPN",
- "PER_APP_VPN_OPERATION": "per-app-vpn",
- "APP_TO_PER_APP_VPN_MAPPING_OPERATION_CODE": "APP_TO_PER_APP_VPN_MAPPING",
- "APP_TO_PER_APP_VPN_MAPPING_OPERATION": "app-to-per-app-vpn-mapping"
-};
-
-// Constants to define Android Operation Constants
-var windowsOperationConstants = {
- "PASSCODE_POLICY_OPERATION": "passcode-policy",
- "PASSCODE_POLICY_OPERATION_CODE": "PASSCODE_POLICY",
- "CAMERA_OPERATION": "camera",
- "CAMERA_OPERATION_CODE": "CAMERA",
- "ENCRYPT_STORAGE_OPERATION": "encrypt-storage",
- "ENCRYPT_STORAGE_OPERATION_CODE": "ENCRYPT_STORAGE"
-};
-
-/**
- * @namespace $
- * The $ is just a function.
- * It is actually an alias for the function called jQuery.
- * For ex: $(this) means jQuery(this) and S.fn.x means jQuery.fn.x
- */
-
-/**
- * Method to update the visibility of grouped input.
- * @param domElement HTML grouped-input element with class name "grouped-input"
- */
-var updateGroupedInputVisibility = function (domElement) {
- if ($(".parent-input:first", domElement).is(":checked")) {
- if ($(".grouped-child-input:first", domElement).hasClass("disabled")) {
- $(".grouped-child-input:first", domElement).removeClass("disabled");
- }
- $(".child-input", domElement).each(function () {
- $(this).prop('disabled', false);
- });
- } else {
- if (!$(".grouped-child-input:first", domElement).hasClass("disabled")) {
- $(".grouped-child-input:first", domElement).addClass("disabled");
- }
- $(".child-input", domElement).each(function () {
- $(this).prop('disabled', true);
- });
- }
-};
-
-var validateInline = {};
-var clearInline = {};
-
-var enableInlineError = function (inputField, errorMsg, errorSign) {
- var fieldIdentifier = "#" + inputField;
- var errorMsgIdentifier = "#" + inputField + " ." + errorMsg;
- var errorSignIdentifier = "#" + inputField + " ." + errorSign;
-
- if (inputField) {
- $(fieldIdentifier).addClass(" has-error has-feedback");
- }
-
- if (errorMsg) {
- $(errorMsgIdentifier).removeClass(" hidden");
- }
-
- if (errorSign) {
- $(errorSignIdentifier).removeClass(" hidden");
- }
-};
-
-var disableInlineError = function (inputField, errorMsg, errorSign) {
- var fieldIdentifier = "#" + inputField;
- var errorMsgIdentifier = "#" + inputField + " ." + errorMsg;
- var errorSignIdentifier = "#" + inputField + " ." + errorSign;
-
- if (inputField) {
- $(fieldIdentifier).removeClass(" has-error has-feedback");
- }
-
- if (errorMsg) {
- $(errorMsgIdentifier).addClass(" hidden");
- }
-
- if (errorSign) {
- $(errorSignIdentifier).addClass(" hidden");
- }
-};
-
-/**
- *clear inline validation messages.
- */
-clearInline["policy-name"] = function () {
- disableInlineError("policyNameField", "nameEmpty", "nameError");
-};
-
-
-/**
- * Validate if provided policy name is valid against RegEx configures.
- */
-validateInline["policy-name"] = function () {
- var policyName = $("input#policy-name-input").val();
- if (policyName && inputIsValidAgainstLength(policyName, 1, 30)) {
- disableInlineError("policyNameField", "nameEmpty", "nameError");
- } else {
- enableInlineError("policyNameField", "nameEmpty", "nameError");
- }
-};
-
-$("#policy-name-input").focus(function(){
- clearInline["policy-name"]();
-}).blur(function(){
- validateInline["policy-name"]();
-});
-
-stepForwardFrom["policy-platform"] = function (actionButton) {
- policy["platform"] = $(actionButton).data("platform");
- policy["platformId"] = $(actionButton).data("platform-type");
- // updating next-page wizard title with selected platform
- $("#policy-profile-page-wizard-title").text("ADD " + policy["platform"] + " POLICY");
-
- var deviceType = policy["platform"];
- var hiddenOperationsByDeviceType = $("#hidden-operations-" + deviceType);
- var hiddenOperationsByDeviceTypeCacheKey = deviceType + "HiddenOperations";
- var hiddenOperationsByDeviceTypeSrc = hiddenOperationsByDeviceType.attr("src");
-
- setTimeout(
- function () {
- $.template(hiddenOperationsByDeviceTypeCacheKey, hiddenOperationsByDeviceTypeSrc, function (template) {
- var content = template();
- $(".wr-advance-operations").html(content);
- $(".wr-advance-operations li.grouped-input").each(function () {
- updateGroupedInputVisibility(this);
- });
- });
- },
- 250 // time delayed for the execution of above function, 250 milliseconds
- );
-};
-
-/**
- * Checks if provided number is valid against a range.
- *
- * @param numberInput Number Input
- * @param min Minimum Limit
- * @param max Maximum Limit
- * @returns {boolean} Returns true if input is within the specified range
- */
-var inputIsValidAgainstRange = function (numberInput, min, max) {
- return (numberInput == min || (numberInput > min && numberInput < max) || numberInput == max);
-};
-
-/**
- * Checks if provided input is valid against RegEx input.
- *
- * @param regExp Regular expression
- * @param input Input string to check
- * @returns {boolean} Returns true if input matches RegEx
- */
-var inputIsValidAgainstRegExp = function (regExp, input) {
- return regExp.test(input);
-};
-
-validateStep["policy-profile"] = function () {
- var validationStatusArray = [];
- var validationStatus;
- var operation;
-
- // starting validation process and updating validationStatus
- if (policy["platform"] == platformTypeConstants["ANDROID"]) {
- if (configuredOperations.length == 0) {
- // updating validationStatus
- validationStatus = {
- "error": true,
- "mainErrorMsg": "You cannot continue. Zero configured features."
- };
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- } else {
- // validating each and every configured Operation
- // Validating PASSCODE_POLICY
- if ($.inArray(androidOperationConstants["PASSCODE_POLICY_OPERATION_CODE"], configuredOperations) != -1) {
- // if PASSCODE_POLICY is configured
- operation = androidOperationConstants["PASSCODE_POLICY_OPERATION"];
- // initializing continueToCheckNextInputs to true
- var continueToCheckNextInputs = true;
-
- // validating first input: passcodePolicyMaxPasscodeAgeInDays
- var passcodePolicyMaxPasscodeAgeInDays = $("input#passcode-policy-max-passcode-age-in-days").val();
- if (passcodePolicyMaxPasscodeAgeInDays) {
- if (!$.isNumeric(passcodePolicyMaxPasscodeAgeInDays)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Provided passcode age is not a number.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (!inputIsValidAgainstRange(passcodePolicyMaxPasscodeAgeInDays, 1, 730)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Provided passcode age is not with in the range of 1-to-730.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
-
- // validating second and last input: passcodePolicyPasscodeHistory
- if (continueToCheckNextInputs) {
- var passcodePolicyPasscodeHistory = $("input#passcode-policy-passcode-history").val();
- if (passcodePolicyPasscodeHistory) {
- if (!$.isNumeric(passcodePolicyPasscodeHistory)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Provided passcode history is not a number.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (!inputIsValidAgainstRange(passcodePolicyPasscodeHistory, 1, 50)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Provided passcode history is not with in the range of 1-to-50.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
- }
-
- // at-last, if the value of continueToCheckNextInputs is still true
- // this means that no error is found
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
-
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
- // Validating CAMERA
- if ($.inArray(androidOperationConstants["CAMERA_OPERATION_CODE"], configuredOperations) != -1) {
- // if CAMERA is configured
- operation = androidOperationConstants["CAMERA_OPERATION"];
- // updating validationStatus
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
- // Validating ENCRYPT_STORAGE
- if ($.inArray(androidOperationConstants["ENCRYPT_STORAGE_OPERATION_CODE"], configuredOperations) != -1) {
- // if ENCRYPT_STORAGE is configured
- operation = androidOperationConstants["ENCRYPT_STORAGE_OPERATION"];
- // updating validationStatus
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
- // Validating WIFI
- if ($.inArray(androidOperationConstants["WIFI_OPERATION_CODE"], configuredOperations) != -1) {
- // if WIFI is configured
- operation = androidOperationConstants["WIFI_OPERATION"];
- // initializing continueToCheckNextInputs to true
- continueToCheckNextInputs = true;
-
- var wifiSSID = $("input#wifi-ssid").val();
- if (!wifiSSID) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "WIFI SSID is not given. You cannot proceed.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
-
- // at-last, if the value of continueToCheckNextInputs is still true
- // this means that no error is found
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
-
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
-
- if ($.inArray(androidOperationConstants["VPN_OPERATION_CODE"], configuredOperations) != -1) {
- // if WIFI is configured
- operation = androidOperationConstants["VPN_OPERATION"];
- // initializing continueToCheckNextInputs to true
- continueToCheckNextInputs = true;
-
- var serverAddress = $("input#vpn-server-address").val();
- if (!serverAddress) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Server address is required. You cannot proceed.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
-
- if (continueToCheckNextInputs) {
- var serverPort = $("input#vpn-server-port").val();
- if (!serverPort) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "VPN server port is required. You cannot proceed.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (!$.isNumeric(serverPort)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "VPN server port requires a number input.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (!inputIsValidAgainstRange(serverPort, 0, 65535)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "VPN server port is not within the range " +
- "of valid port numbers.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
-
- // at-last, if the value of continueToCheckNextInputs is still true
- // this means that no error is found
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
-
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
- if ($.inArray(androidOperationConstants["APPLICATION_OPERATION_CODE"], configuredOperations) != -1) {
- //If application restriction configured
- operation = androidOperationConstants["APPLICATION_OPERATION"];
- // Initializing continueToCheckNextInputs to true
- continueToCheckNextInputs = true;
-
- var appRestrictionType = $("#app-restriction-type").val();
-
- var restrictedApplicationsGridChildInputs = "div#restricted-applications .child-input";
-
- if (!appRestrictionType) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Applications restriction type is not provided.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
-
- if (continueToCheckNextInputs) {
- if ($(restrictedApplicationsGridChildInputs).length == 0) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Applications are not provided in application restriction list.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- else {
- childInputCount = 0;
- childInputArray = [];
- emptyChildInputCount = 0;
- duplicatesExist = false;
- // Looping through each child input
- $(restrictedApplicationsGridChildInputs).each(function () {
- childInputCount++;
- if (childInputCount % 2 == 0) {
- // If child input is of second column
- childInput = $(this).val();
- childInputArray.push(childInput);
- // Updating emptyChildInputCount
- if (!childInput) {
- // If child input field is empty
- emptyChildInputCount++;
- }
- }
- });
- // Checking for duplicates
- initialChildInputArrayLength = childInputArray.length;
- if (emptyChildInputCount == 0 && initialChildInputArrayLength > 1) {
- for (m = 0; m < (initialChildInputArrayLength - 1); m++) {
- poppedChildInput = childInputArray.pop();
- for (n = 0; n < childInputArray.length; n++) {
- if (poppedChildInput == childInputArray[n]) {
- duplicatesExist = true;
- break;
- }
- }
- if (duplicatesExist) {
- break;
- }
- }
- }
- // Updating validationStatus
- if (emptyChildInputCount > 0) {
- // If empty child inputs are present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more package names of " +
- "applications are empty.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (duplicatesExist) {
- // If duplicate input is present
- validationStatus = {
- "error": true,
- "subErrorMsg": "Duplicate values exist with " +
- "for package names.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
-
- }
- }
-
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
-
- // Updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
-
- }
- }
- }if (policy["platform"] == platformTypeConstants["WINDOWS"]) {
- if (configuredOperations.length == 0) {
- // updating validationStatus
- validationStatus = {
- "error": true,
- "mainErrorMsg": "You cannot continue. Zero configured features."
- };
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- } else {
- // validating each and every configured Operation
- // Validating PASSCODE_POLICY
- if ($.inArray(windowsOperationConstants["PASSCODE_POLICY_OPERATION_CODE"], configuredOperations) != -1) {
- // if PASSCODE_POLICY is configured
- operation = windowsOperationConstants["PASSCODE_POLICY_OPERATION"];
- // initializing continueToCheckNextInputs to true
- var continueToCheckNextInputs = true;
-
- // validating first input: passcodePolicyMaxPasscodeAgeInDays
- var passcodePolicyMaxPasscodeAgeInDays = $("input#passcode-policy-max-passcode-age-in-days").val();
- if (passcodePolicyMaxPasscodeAgeInDays) {
- if (!$.isNumeric(passcodePolicyMaxPasscodeAgeInDays)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Provided passcode age is not a number.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (!inputIsValidAgainstRange(passcodePolicyMaxPasscodeAgeInDays, 1, 730)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Provided passcode age is not with in the range of 1-to-730.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
-
- // validating second and last input: passcodePolicyPasscodeHistory
- if (continueToCheckNextInputs) {
- var passcodePolicyPasscodeHistory = $("input#passcode-policy-passcode-history").val();
- if (passcodePolicyPasscodeHistory) {
- if (!$.isNumeric(passcodePolicyPasscodeHistory)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Provided passcode history is not a number.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (!inputIsValidAgainstRange(passcodePolicyPasscodeHistory, 1, 50)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Provided passcode history is not with in the range of 1-to-50.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
- }
-
- // at-last, if the value of continueToCheckNextInputs is still true
- // this means that no error is found
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
-
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
- // Validating CAMERA
- if ($.inArray(windowsOperationConstants["CAMERA_OPERATION_CODE"], configuredOperations) != -1) {
- // if CAMERA is configured
- operation = windowsOperationConstants["CAMERA_OPERATION"];
- // updating validationStatus
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
- // Validating ENCRYPT_STORAGE
- if ($.inArray(windowsOperationConstants["ENCRYPT_STORAGE_OPERATION_CODE"], configuredOperations) != -1) {
- // if ENCRYPT_STORAGE is configured
- operation = windowsOperationConstants["ENCRYPT_STORAGE_OPERATION"];
- // updating validationStatus
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
-
- }
- } else if (policy["platform"] == platformTypeConstants["IOS"]) {
- if (configuredOperations.length == 0) {
- // updating validationStatus
- validationStatus = {
- "error": true,
- "mainErrorMsg": "You cannot continue. Zero configured features."
- };
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- } else {
- // validating each and every configured Operation
- // Validating PASSCODE_POLICY
- if ($.inArray(iosOperationConstants["PASSCODE_POLICY_OPERATION_CODE"], configuredOperations) != -1) {
- // if PASSCODE_POLICY is configured
- operation = iosOperationConstants["PASSCODE_POLICY_OPERATION"];
- // initializing continueToCheckNextInputs to true
- continueToCheckNextInputs = true;
-
- // validating first input: passcodePolicyMaxPasscodeAgeInDays
- passcodePolicyMaxPasscodeAgeInDays = $("input#passcode-policy-max-passcode-age-in-days").val();
- if (passcodePolicyMaxPasscodeAgeInDays) {
- if (!$.isNumeric(passcodePolicyMaxPasscodeAgeInDays)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Provided passcode age is not a number.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (!inputIsValidAgainstRange(passcodePolicyMaxPasscodeAgeInDays, 1, 730)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Provided passcode age is not with in the range of 1-to-730.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
-
- // validating second and last input: passcodePolicyPasscodeHistory
- if (continueToCheckNextInputs) {
- passcodePolicyPasscodeHistory = $("input#passcode-policy-passcode-history").val();
- if (passcodePolicyPasscodeHistory) {
- if (!$.isNumeric(passcodePolicyPasscodeHistory)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Provided passcode history is not a number.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (!inputIsValidAgainstRange(passcodePolicyPasscodeHistory, 1, 50)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Provided passcode history is not with in the range of 1-to-50.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
- }
-
- // at-last, if the value of continueToCheckNextInputs is still true
- // this means that no error is found
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
-
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
- // Validating RESTRICTIONS
- if ($.inArray(iosOperationConstants["RESTRICTIONS_OPERATION_CODE"], configuredOperations) != -1) {
- // if RESTRICTION is configured
- operation = iosOperationConstants["RESTRICTIONS_OPERATION"];
- // initializing continueToCheckNextInputs to true
- continueToCheckNextInputs = true;
-
- // getting input values to be validated
- var restrictionsAutonomousSingleAppModePermittedAppIDsGridChildInputs =
- "div#restrictions-autonomous-single-app-mode-permitted-app-ids .child-input";
- if ($(restrictionsAutonomousSingleAppModePermittedAppIDsGridChildInputs).length > 0) {
- var childInput;
- var childInputArray = [];
- var emptyChildInputCount = 0;
- var duplicatesExist = false;
- // looping through each child input
- $(restrictionsAutonomousSingleAppModePermittedAppIDsGridChildInputs).each(function () {
- childInput = $(this).val();
- childInputArray.push(childInput);
- if (!childInput) {
- // if child input field is empty
- emptyChildInputCount++;
- }
- });
- // checking for duplicates
- var initialChildInputArrayLength = childInputArray.length;
- if (emptyChildInputCount == 0 && initialChildInputArrayLength > 1) {
- var m, poppedChildInput;
- for (m = 0; m < (initialChildInputArrayLength - 1); m++) {
- poppedChildInput = childInputArray.pop();
- var n;
- for (n = 0; n < childInputArray.length; n++) {
- if (poppedChildInput == childInputArray[n]) {
- duplicatesExist = true;
- break;
- }
- }
- if (duplicatesExist) {
- break;
- }
- }
- }
- // updating validationStatus
- if (emptyChildInputCount > 0) {
- // if empty child inputs are present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more permitted App ID entries in " +
- "Autonomous Single App Mode are empty.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (duplicatesExist) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Duplicate values exist with permitted App ID entries in " +
- "Autonomous Single App Mode.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
-
- // at-last, if the value of continueToCheckNextInputs is still true
- // this means that no error is found
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
-
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
- // Validating WIFI
- if ($.inArray(iosOperationConstants["WIFI_OPERATION_CODE"], configuredOperations) != -1) {
- // if WIFI is configured
- operation = iosOperationConstants["WIFI_OPERATION"];
- // initializing continueToCheckNextInputs to true
- continueToCheckNextInputs = true;
-
- // getting input values to be validated
- wifiSSID = $("input#wifi-ssid").val();
- var wifiDomainName = $("input#wifi-domain-name").val();
- if (!wifiSSID && !wifiDomainName) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Both Wi-Fi SSID and Wi-Fi Domain Name are not given. You cannot proceed.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
-
- if (continueToCheckNextInputs) {
- // getting proxy-setup value
- var wifiProxyType = $("select#wifi-proxy-type").find("option:selected").attr("value");
- if (wifiProxyType == "Manual") {
- // adds up additional fields to be validated
- var wifiProxyServer = $("input#wifi-proxy-server").val();
- if (!wifiProxyServer) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Wi-Fi Proxy Server is required. You cannot proceed.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
-
- if (continueToCheckNextInputs) {
- var wifiProxyPort = $("input#wifi-proxy-port").val();
- if (!wifiProxyPort) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Wi-Fi Proxy Port is required. You cannot proceed.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (!$.isNumeric(wifiProxyPort)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Wi-Fi Proxy Port requires a number input.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (!inputIsValidAgainstRange(wifiProxyPort, 0, 65535)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Wi-Fi Proxy Port is not within the range " +
- "of valid port numbers.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
- }
- }
-
- if (continueToCheckNextInputs) {
- // getting encryption-type value
- var wifiEncryptionType = $("select#wifi-encryption-type").find("option:selected").attr("value");
- if (wifiEncryptionType != "None") {
- var wifiPayloadCertificateAnchorUUIDsGridChildInputs =
- "div#wifi-payload-certificate-anchor-uuids .child-input";
- if ($(wifiPayloadCertificateAnchorUUIDsGridChildInputs).length > 0) {
- emptyChildInputCount = 0;
- childInputArray = [];
- duplicatesExist = false;
- // looping through each child input
- $(wifiPayloadCertificateAnchorUUIDsGridChildInputs).each(function () {
- childInput = $(this).val();
- childInputArray.push(childInput);
- if (!childInput) {
- // if child input field is empty
- emptyChildInputCount++;
- }
- });
- // checking for duplicates
- initialChildInputArrayLength = childInputArray.length;
- if (emptyChildInputCount == 0 && initialChildInputArrayLength > 1) {
- for (m = 0; m < (initialChildInputArrayLength - 1); m++) {
- poppedChildInput = childInputArray.pop();
- for (n = 0; n < childInputArray.length; n++) {
- if (poppedChildInput == childInputArray[n]) {
- duplicatesExist = true;
- break;
- }
- }
- if (duplicatesExist) {
- break;
- }
- }
- }
- // updating validationStatus
- if (emptyChildInputCount > 0) {
- // if empty child inputs are present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more Payload Certificate " +
- "Anchor UUIDs are empty.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (duplicatesExist) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Duplicate values exist " +
- "with Payload Certificate Anchor UUIDs.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
-
- if (continueToCheckNextInputs) {
- var wifiTLSTrustedServerNamesGridChildInputs =
- "div#wifi-tls-trusted-server-names .child-input";
- if ($(wifiTLSTrustedServerNamesGridChildInputs).length > 0) {
- emptyChildInputCount = 0;
- childInputArray = [];
- duplicatesExist = false;
- // looping through each child input
- $(wifiTLSTrustedServerNamesGridChildInputs).each(function () {
- childInput = $(this).val();
- childInputArray.push(childInput);
- if (!childInput) {
- // if child input field is empty
- emptyChildInputCount++;
- }
- });
- // checking for duplicates
- initialChildInputArrayLength = childInputArray.length;
- if (emptyChildInputCount == 0 && initialChildInputArrayLength > 1) {
- for (m = 0; m < (initialChildInputArrayLength - 1); m++) {
- poppedChildInput = childInputArray.pop();
- for (n = 0; n < childInputArray.length; n++) {
- if (poppedChildInput == childInputArray[n]) {
- duplicatesExist = true;
- break;
- }
- }
- if (duplicatesExist) {
- break;
- }
- }
- }
- // updating validationStatus
- if (emptyChildInputCount > 0) {
- // if empty child inputs are present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more TLS Trusted Server Names are empty.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (duplicatesExist) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Duplicate values exist " +
- "with TLS Trusted Server Names.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
- }
- }
- }
-
- if (continueToCheckNextInputs) {
- var wifiRoamingConsortiumOIsGridChildInputs = "div#wifi-roaming-consortium-ois .child-input";
- if ($(wifiRoamingConsortiumOIsGridChildInputs).length > 0) {
- emptyChildInputCount = 0;
- var outOfAllowedLengthCount = 0;
- var invalidAgainstRegExCount = 0;
- childInputArray = [];
- duplicatesExist = false;
- // looping through each child input
- $(wifiRoamingConsortiumOIsGridChildInputs).each(function () {
- childInput = $(this).val();
- childInputArray.push(childInput);
- if (!childInput) {
- // if child input field is empty
- emptyChildInputCount++;
- } else if (!inputIsValidAgainstLength(childInput, 6, 6) && !inputIsValidAgainstLength(childInput, 10, 10)) {
- outOfAllowedLengthCount++;
- } else if (!inputIsValidAgainstRegExp(/^[a-fA-F0-9]+$/, childInput)) {
- invalidAgainstRegExCount++;
- }
- });
- // checking for duplicates
- initialChildInputArrayLength = childInputArray.length;
- if (emptyChildInputCount == 0 && initialChildInputArrayLength > 1) {
- for (m = 0; m < (initialChildInputArrayLength - 1); m++) {
- poppedChildInput = childInputArray.pop();
- for (n = 0; n < childInputArray.length; n++) {
- if (poppedChildInput == childInputArray[n]) {
- duplicatesExist = true;
- break;
- }
- }
- if (duplicatesExist) {
- break;
- }
- }
- }
- // updating validationStatus
- if (emptyChildInputCount > 0) {
- // if empty child inputs are present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more Roaming Consortium OIs are empty.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (outOfAllowedLengthCount > 0) {
- // if outOfMaxAllowedLength input is present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more Roaming Consortium OIs " +
- "are out of allowed length.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (invalidAgainstRegExCount > 0) {
- // if invalid inputs in terms of hexadecimal format are present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more Roaming Consortium OIs " +
- "contain non-hexadecimal characters.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (duplicatesExist) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Duplicate values exist with Roaming Consortium OIs.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
- }
-
- if (continueToCheckNextInputs) {
- var wifiNAIRealmNamesGridChildInputs = "div#wifi-nai-realm-names .child-input";
- if ($(wifiNAIRealmNamesGridChildInputs).length > 0) {
- emptyChildInputCount = 0;
- childInputArray = [];
- duplicatesExist = false;
- // looping through each child input
- $(wifiNAIRealmNamesGridChildInputs).each(function () {
- childInput = $(this).val();
- childInputArray.push(childInput);
- if (!childInput) {
- // if child input field is empty
- emptyChildInputCount++;
- }
- });
- // checking for duplicates
- initialChildInputArrayLength = childInputArray.length;
- if (emptyChildInputCount == 0 && initialChildInputArrayLength > 1) {
- for (m = 0; m < (initialChildInputArrayLength - 1); m++) {
- poppedChildInput = childInputArray.pop();
- for (n = 0; n < childInputArray.length; n++) {
- if (poppedChildInput == childInputArray[n]) {
- duplicatesExist = true;
- break;
- }
- }
- if (duplicatesExist) {
- break;
- }
- }
- }
- // updating validationStatus
- if (emptyChildInputCount > 0) {
- // if empty child inputs are present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more NAI Realm Names are empty.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (duplicatesExist) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Duplicate values exist with NAI Realm Names.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
- }
-
- if (continueToCheckNextInputs) {
- var wifiMCCAndMNCsGridChildInputs = "div#wifi-mcc-and-mncs .child-input";
- if ($(wifiMCCAndMNCsGridChildInputs).length > 0) {
- var childInputCount = 0;
- var stringPair;
- emptyChildInputCount = 0;
- outOfAllowedLengthCount = 0;
- var notNumericInputCount = 0;
- childInputArray = [];
- duplicatesExist = false;
- // looping through each child input
- $(wifiMCCAndMNCsGridChildInputs).each(function () {
- childInput = $(this).val();
- // pushing each string pair to childInputArray
- childInputCount++;
- if (childInputCount % 2 == 1) {
- // initialize stringPair value
- stringPair = "";
- // append first part of the string
- stringPair += childInput;
- } else {
- // append second part of the string
- stringPair += childInput;
- childInputArray.push(stringPair);
- }
- // updating emptyChildInputCount & outOfAllowedLengthCount
- if (!childInput) {
- // if child input field is empty
- emptyChildInputCount++;
- } else if (!$.isNumeric(childInput)) {
- notNumericInputCount++;
- } else if (!inputIsValidAgainstLength(childInput, 3, 3)) {
- outOfAllowedLengthCount++;
- }
- });
- // checking for duplicates
- initialChildInputArrayLength = childInputArray.length;
- if (emptyChildInputCount == 0 && initialChildInputArrayLength > 1) {
- for (m = 0; m < (initialChildInputArrayLength - 1); m++) {
- poppedChildInput = childInputArray.pop();
- for (n = 0; n < childInputArray.length; n++) {
- if (poppedChildInput == childInputArray[n]) {
- duplicatesExist = true;
- break;
- }
- }
- if (duplicatesExist) {
- break;
- }
- }
- }
- // updating validationStatus
- if (emptyChildInputCount > 0) {
- // if empty child inputs are present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more MCC/MNC pairs are empty.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (notNumericInputCount > 0) {
- // if notNumeric input is present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more MCC/MNC pairs are not numeric.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (outOfAllowedLengthCount > 0) {
- // if outOfAllowedLength input is present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more MCC/MNC pairs " +
- "do not fulfill the accepted length of 6 digits.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (duplicatesExist) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Duplicate values exist with MCC/MNC pairs.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
- }
-
- // at-last, if the value of continueToCheckNextInputs is still true
- // this means that no error is found
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
-
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
-
- if ($.inArray(iosOperationConstants["VPN_OPERATION_CODE"], configuredOperations) != -1) {
- // if WIFI is configured
- operation = iosOperationConstants["VPN_OPERATION"];
- // initializing continueToCheckNextInputs to true
- continueToCheckNextInputs = true;
-
- var connectionName = $("input#vpn-connection-name").val();
- if (!connectionName) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Connection Name is required. You cannot proceed.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- // at-last, if the value of continueToCheckNextInputs is still true
- // this means that no error is found
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
-
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
-
- if ($.inArray(iosOperationConstants["PER_APP_VPN_OPERATION_CODE"], configuredOperations) != -1) {
- operation = iosOperationConstants["PER_APP_VPN_OPERATION"];
- continueToCheckNextInputs = true;
-
- var uuid = $("input#per-app-vpn-uuid").val();
- if (!uuid) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "VPN UUID is required. You cannot proceed.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- // at-last, if the value of continueToCheckNextInputs is still true
- // this means that no error is found
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
- validationStatusArray.push(validationStatus);
- }
-
- if ($.inArray(iosOperationConstants["APP_TO_PER_APP_VPN_MAPPING_OPERATION_CODE"], configuredOperations) != -1) {
- operation = iosOperationConstants["APP_TO_PER_APP_VPN_MAPPING_OPERATION"];
- continueToCheckNextInputs = true;
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
- validationStatusArray.push(validationStatus);
- }
- // Validating EMAIL
- if ($.inArray(iosOperationConstants["EMAIL_OPERATION_CODE"], configuredOperations) != -1) {
- // if EMAIL is configured
- operation = iosOperationConstants["EMAIL_OPERATION"];
- // initializing continueToCheckNextInputs to true
- continueToCheckNextInputs = true;
-
- var emailAddress = $("input#email-address").val();
- if (emailAddress && !inputIsValidAgainstRegExp(/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/, emailAddress)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Email Address is not valid.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
-
- if (continueToCheckNextInputs) {
- var emailIncomingMailServerHostname = $("input#email-incoming-mail-server-hostname").val();
- if (!emailIncomingMailServerHostname) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Incoming Mail Server Hostname is empty. You cannot proceed.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
-
- if (continueToCheckNextInputs) {
- var emailIncomingMailServerPort = $("input#email-incoming-mail-server-port").val();
- if (emailIncomingMailServerPort && emailIncomingMailServerPort != '') {
- if (!$.isNumeric(emailIncomingMailServerPort)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Incoming Mail Server Port requires a number input.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (!inputIsValidAgainstRange(emailIncomingMailServerPort, 0, 65535)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Incoming Mail Server Port is not within the range " +
- "of valid port numbers.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
- }
-
- if (continueToCheckNextInputs) {
- var emailOutgoingMailServerHostname = $("input#email-outgoing-mail-server-hostname").val();
- if (!emailOutgoingMailServerHostname) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Outgoing Mail Server Hostname is empty. You cannot proceed.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
-
- if (continueToCheckNextInputs) {
- var emailOutgoingMailServerPort = $("input#email-outgoing-mail-server-port").val();
- if (emailOutgoingMailServerPort) {
- if (!$.isNumeric(emailOutgoingMailServerPort)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Outgoing Mail Server Port requires a number input.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (!inputIsValidAgainstRange(emailOutgoingMailServerPort, 0, 65535)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Outgoing Mail Server Port is not within the range " +
- "of valid port numbers.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
- }
-
- // at-last, if the value of continueToCheckNextInputs is still true
- // this means that no error is found
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
-
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
- // Validating AIRPLAY
- if ($.inArray(iosOperationConstants["AIRPLAY_OPERATION_CODE"], configuredOperations) != -1) {
- // if AIRPLAY is configured
- operation = iosOperationConstants["AIRPLAY_OPERATION"];
- // initializing continueToCheckNextInputs to true
- continueToCheckNextInputs = true;
-
- var airplayCredentialsGridChildInputs = "div#airplay-credentials .child-input";
- var airplayDestinationsGridChildInputs = "div#airplay-destinations .child-input";
- if ($(airplayCredentialsGridChildInputs).length == 0 &&
- $(airplayDestinationsGridChildInputs).length == 0) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "AirPlay settings have zero configurations attached.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
-
- if (continueToCheckNextInputs) {
- if ($(airplayCredentialsGridChildInputs).length > 0) {
- childInputCount = 0;
- childInputArray = [];
- emptyChildInputCount = 0;
- duplicatesExist = false;
- // looping through each child input
- $(airplayCredentialsGridChildInputs).each(function () {
- childInputCount++;
- if (childInputCount % 2 == 1) {
- // if child input is of first column
- childInput = $(this).val();
- childInputArray.push(childInput);
- // updating emptyChildInputCount
- if (!childInput) {
- // if child input field is empty
- emptyChildInputCount++;
- }
- }
- });
- // checking for duplicates
- initialChildInputArrayLength = childInputArray.length;
- if (emptyChildInputCount == 0 && initialChildInputArrayLength > 1) {
- for (m = 0; m < (initialChildInputArrayLength - 1); m++) {
- poppedChildInput = childInputArray.pop();
- for (n = 0; n < childInputArray.length; n++) {
- if (poppedChildInput == childInputArray[n]) {
- duplicatesExist = true;
- break;
- }
- }
- if (duplicatesExist) {
- break;
- }
- }
- }
- // updating validationStatus
- if (emptyChildInputCount > 0) {
- // if empty child inputs are present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more Device Names of " +
- "AirPlay Credentials are empty.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (duplicatesExist) {
- // if duplicate input is present
- validationStatus = {
- "error": true,
- "subErrorMsg": "Duplicate values exist with " +
- "Device Names of AirPlay Credentials.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
- }
-
- if (continueToCheckNextInputs) {
- if ($(airplayDestinationsGridChildInputs).length > 0) {
- childInputArray = [];
- emptyChildInputCount = 0;
- invalidAgainstRegExCount = 0;
- duplicatesExist = false;
- // looping through each child input
- $(airplayDestinationsGridChildInputs).each(function () {
- childInput = $(this).val();
- childInputArray.push(childInput);
- // updating emptyChildInputCount
- if (!childInput) {
- // if child input field is empty
- emptyChildInputCount++;
- } else if (!inputIsValidAgainstRegExp(
- /([a-z|A-Z|0-9][a-z|A-Z|0-9][:]){5}([a-z|A-Z|0-9][a-z|A-Z|0-9])$/, childInput)) {
- // if child input field is invalid against RegEx
- invalidAgainstRegExCount++
- }
- });
- // checking for duplicates
- initialChildInputArrayLength = childInputArray.length;
- if (emptyChildInputCount == 0 && initialChildInputArrayLength > 1) {
- for (m = 0; m < (initialChildInputArrayLength - 1); m++) {
- poppedChildInput = childInputArray.pop();
- for (n = 0; n < childInputArray.length; n++) {
- if (poppedChildInput == childInputArray[n]) {
- duplicatesExist = true;
- break;
- }
- }
- if (duplicatesExist) {
- break;
- }
- }
- }
- // updating validationStatus
- if (emptyChildInputCount > 0) {
- // if empty child inputs are present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more AirPlay Destination fields are empty.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (invalidAgainstRegExCount > 0) {
- // if invalidAgainstRegEx inputs are present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more AirPlay Destination fields " +
- "do not fulfill expected format.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (duplicatesExist) {
- // if duplicate input is present
- validationStatus = {
- "error": true,
- "subErrorMsg": "Duplicate values exist with AirPlay Destinations.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
- }
-
- // at-last, if the value of continueToCheckNextInputs is still true
- // this means that no error is found
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
-
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
-
- // Validating Domains
- if ($.inArray(iosOperationConstants["DOMAIN"], configuredOperations) != -1) {
- // if DOMAIN is configured
- operation = iosOperationConstants["DOMAIN"];
-
- continueToCheckNextInputs = true;
-
- var airplayCredentialsGridChildInputs = "div#unmarked-email-domains .child-input";
- var airplayDestinationsGridChildInputs = "div#safari-web-domains .child-input";
- if ($(airplayCredentialsGridChildInputs).length == 0 &&
- $(airplayDestinationsGridChildInputs).length == 0) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Manage Domains have zero configurations attached.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
-
- if (continueToCheckNextInputs) {
- if ($(airplayCredentialsGridChildInputs).length > 0) {
- childInputCount = 0;
- childInputArray = [];
- emptyChildInputCount = 0;
- duplicatesExist = false;
- // looping through each child input
- $(airplayCredentialsGridChildInputs).each(function () {
- childInputCount++;
- if (childInputCount % 2 == 1) {
- // if child input is of first column
- childInput = $(this).val();
- childInputArray.push(childInput);
- // updating emptyChildInputCount
- if (!childInput) {
- // if child input field is empty
- emptyChildInputCount++;
- }
- }
- });
- // checking for duplicates
- initialChildInputArrayLength = childInputArray.length;
- if (emptyChildInputCount == 0 && initialChildInputArrayLength > 1) {
- for (m = 0; m < (initialChildInputArrayLength - 1); m++) {
- poppedChildInput = childInputArray.pop();
- for (n = 0; n < childInputArray.length; n++) {
- if (poppedChildInput == childInputArray[n]) {
- duplicatesExist = true;
- break;
- }
- }
- if (duplicatesExist) {
- break;
- }
- }
- }
- // updating validationStatus
- if (emptyChildInputCount > 0) {
- // if empty child inputs are present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more email domains of " +
- "unmarked email domains are empty.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (duplicatesExist) {
- // if duplicate input is present
- validationStatus = {
- "error": true,
- "subErrorMsg": "Duplicate values exist with " +
- "email domains of unmarked email domains.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
- }
-
- if (continueToCheckNextInputs) {
- if ($(airplayDestinationsGridChildInputs).length > 0) {
- childInputCount = 0;
- childInputArray = [];
- emptyChildInputCount = 0;
- duplicatesExist = false;
- // looping through each child input
- $(airplayDestinationsGridChildInputs).each(function () {
- childInputCount++;
- if (childInputCount % 2 == 1) {
- // if child input is of first column
- childInput = $(this).val();
- childInputArray.push(childInput);
- // updating emptyChildInputCount
- if (!childInput) {
- // if child input field is empty
- emptyChildInputCount++;
- }
- }
- });
- // checking for duplicates
- initialChildInputArrayLength = childInputArray.length;
- if (emptyChildInputCount == 0 && initialChildInputArrayLength > 1) {
- for (m = 0; m < (initialChildInputArrayLength - 1); m++) {
- poppedChildInput = childInputArray.pop();
- for (n = 0; n < childInputArray.length; n++) {
- if (poppedChildInput == childInputArray[n]) {
- duplicatesExist = true;
- break;
- }
- }
- if (duplicatesExist) {
- break;
- }
- }
- }
- // updating validationStatus
- if (emptyChildInputCount > 0) {
- // if empty child inputs are present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more managed safari web domains of " +
- "unmarked email domains are empty.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (duplicatesExist) {
- // if duplicate input is present
- validationStatus = {
- "error": true,
- "subErrorMsg": "Duplicate values exist with " +
- "managed safari web domains of unmarked email domains.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
- }
-
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
-
- validationStatusArray.push(validationStatus);
- }
-
- // Validating LDAP
- if ($.inArray(iosOperationConstants["LDAP_OPERATION_CODE"], configuredOperations) != -1) {
- // if LDAP is configured
- operation = iosOperationConstants["LDAP_OPERATION"];
- // initializing continueToCheckNextInputs to true
- continueToCheckNextInputs = true;
-
- var ldapAccountHostname = $("input#ldap-account-hostname").val();
- if (!ldapAccountHostname) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "LDAP Account Hostname URL is empty. You cannot proceed.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
-
- if (continueToCheckNextInputs) {
- var ldapSearchSettingsGridChildInputs = "div#ldap-search-settings .child-input";
- if ($(ldapSearchSettingsGridChildInputs).length > 0) {
- childInputCount = 0;
- childInputArray = [];
- emptyChildInputCount = 0;
- duplicatesExist = false;
- // looping through each child input
- $(ldapSearchSettingsGridChildInputs).each(function () {
- childInputCount++;
- if (childInputCount % 3 == 2) {
- // if child input is of second column
- childInput = $(this).find("option:selected").attr("value");
- stringPair = "";
- stringPair += (childInput + " ");
- } else if (childInputCount % 3 == 0) {
- // if child input is of third column
- childInput = $(this).val();
- stringPair += childInput;
- childInputArray.push(stringPair);
- // updating emptyChildInputCount
- if (!childInput) {
- // if child input field is empty
- emptyChildInputCount++;
- }
- }
- });
- // checking for duplicates
- initialChildInputArrayLength = childInputArray.length;
- if (emptyChildInputCount == 0 && initialChildInputArrayLength > 1) {
- for (m = 0; m < (initialChildInputArrayLength - 1); m++) {
- poppedChildInput = childInputArray.pop();
- for (n = 0; n < childInputArray.length; n++) {
- if (poppedChildInput == childInputArray[n]) {
- duplicatesExist = true;
- break;
- }
- }
- if (duplicatesExist) {
- break;
- }
- }
- }
- // updating validationStatus
- if (emptyChildInputCount > 0) {
- // if empty child inputs are present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more Search Setting Scope fields are empty.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (duplicatesExist) {
- // if duplicate input is present
- validationStatus = {
- "error": true,
- "subErrorMsg": "Duplicate values exist with " +
- "Search Setting Search Base and Scope pairs.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
- }
-
- // at-last, if the value of continueToCheckNextInputs is still true
- // this means that no error is found
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
-
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
- // Validating CALENDAR
- if ($.inArray(iosOperationConstants["CALENDAR_OPERATION_CODE"], configuredOperations) != -1) {
- // if CALENDAR is configured
- operation = iosOperationConstants["CALENDAR_OPERATION"];
- // initializing continueToCheckNextInputs to true
- continueToCheckNextInputs = true;
-
- var calendarAccountHostname = $("input#calendar-account-hostname").val();
- if (!calendarAccountHostname) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Account Hostname URL is empty. You cannot proceed.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
-
- if (continueToCheckNextInputs) {
- var calendarAccountPort = $("input#calendar-account-port").val();
- if (!calendarAccountPort) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Account Port is empty. You cannot proceed.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (!$.isNumeric(calendarAccountPort)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Account Port requires a number input.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (!inputIsValidAgainstRange(calendarAccountPort, 0, 65535)) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Account Port is not within the range " +
- "of valid port numbers.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
-
- // at-last, if the value of continueToCheckNextInputs is still true
- // this means that no error is found
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
-
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
- // Validating CALENDAR_SUBSCRIPTION
- if ($.inArray(iosOperationConstants["CALENDAR_SUBSCRIPTION_OPERATION_CODE"], configuredOperations) != -1) {
- // if CALENDAR_SUBSCRIPTION is configured
- operation = iosOperationConstants["CALENDAR_SUBSCRIPTION_OPERATION"];
- // initializing continueToCheckNextInputs to true
- continueToCheckNextInputs = true;
-
- var calendarSubscriptionHostname = $("input#calendar-subscription-hostname").val();
- if (!calendarSubscriptionHostname) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Account Hostname URL is empty. You cannot proceed.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
-
- // at-last, if the value of continueToCheckNextInputs is still true
- // this means that no error is found
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
-
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
- // Validating APN
- if ($.inArray(iosOperationConstants["APN_OPERATION_CODE"], configuredOperations) != -1) {
- // if APN is configured
- operation = iosOperationConstants["APN_OPERATION"];
- // initializing continueToCheckNextInputs to true
- continueToCheckNextInputs = true;
-
- var apnConfigurationsGridChildInputs = "div#apn-configurations .child-input";
- if ($(apnConfigurationsGridChildInputs).length == 0) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "APN Settings have zero configurations attached.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if ($(apnConfigurationsGridChildInputs).length > 0) {
- childInputCount = 0;
- childInputArray = [];
- // checking empty APN field count
- emptyChildInputCount = 0;
- duplicatesExist = false;
- // looping through each child input
- $(apnConfigurationsGridChildInputs).each(function () {
- childInputCount++;
- //if (childInputCount % 5 == 1) {
- // if child input is of first column
- childInput = $(this).val();
- childInputArray.push(childInput);
- // updating emptyChildInputCount
- if (!childInput) {
- // if child input field is empty
- emptyChildInputCount++;
- }
- //}
- });
- // checking for duplicates
- initialChildInputArrayLength = childInputArray.length;
- if (emptyChildInputCount == 0 && initialChildInputArrayLength > 1) {
- for (m = 0; m < (initialChildInputArrayLength - 1); m++) {
- poppedChildInput = childInputArray.pop();
- for (n = 0; n < childInputArray.length; n++) {
- if (poppedChildInput == childInputArray[n]) {
- duplicatesExist = true;
- break;
- }
- }
- if (duplicatesExist) {
- break;
- }
- }
- }
- // updating validationStatus
- if (emptyChildInputCount > 0) {
- // if empty child inputs are present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more APN fields of Configurations are empty.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (duplicatesExist) {
- // if duplicate input is present
- validationStatus = {
- "error": true,
- "subErrorMsg": "Duplicate values exist with " +
- "APN fields of Configurations.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
-
- // at-last, if the value of continueToCheckNextInputs is still true
- // this means that no error is found
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
-
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
- // Validating CELLULAR
- if ($.inArray(iosOperationConstants["CELLULAR_OPERATION_CODE"], configuredOperations) != -1) {
- // if CELLULAR is configured
- operation = iosOperationConstants["CELLULAR_OPERATION"];
- // initializing continueToCheckNextInputs to true
- continueToCheckNextInputs = true;
-
- var cellularAttachAPNName = $("input#cellular-attach-apn-name").val();
- if (!cellularAttachAPNName) {
- validationStatus = {
- "error": true,
- "subErrorMsg": "Cellular Configuration Name is empty. You cannot proceed.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
-
- if (continueToCheckNextInputs) {
- var cellularAPNConfigurationsGridChildInputs = "div#cellular-apn-configurations .child-input";
- if ($(cellularAPNConfigurationsGridChildInputs).length > 0) {
- childInputCount = 0;
- childInputArray = [];
- // checking empty APN field count
- emptyChildInputCount = 0;
- duplicatesExist = false;
- // looping through each child input
- $(cellularAPNConfigurationsGridChildInputs).each(function () {
- childInputCount++;
- if (childInputCount % 6 == 1) {
- // if child input is of first column
- childInput = $(this).val();
- childInputArray.push(childInput);
- // updating emptyChildInputCount
- if (!childInput) {
- // if child input field is empty
- emptyChildInputCount++;
- }
- }
- });
- // checking for duplicates
- initialChildInputArrayLength = childInputArray.length;
- if (emptyChildInputCount == 0 && initialChildInputArrayLength > 1) {
- for (m = 0; m < (initialChildInputArrayLength - 1); m++) {
- poppedChildInput = childInputArray.pop();
- for (n = 0; n < childInputArray.length; n++) {
- if (poppedChildInput == childInputArray[n]) {
- duplicatesExist = true;
- break;
- }
- }
- if (duplicatesExist) {
- break;
- }
- }
- }
- // updating validationStatus
- if (emptyChildInputCount > 0) {
- // if empty child inputs are present
- validationStatus = {
- "error": true,
- "subErrorMsg": "One or more APN fields of APN Configurations are empty.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- } else if (duplicatesExist) {
- // if duplicate input is present
- validationStatus = {
- "error": true,
- "subErrorMsg": "Duplicate values exist with " +
- "APN fields of APN Configurations.",
- "erroneousFeature": operation
- };
- continueToCheckNextInputs = false;
- }
- }
- }
-
- // at-last, if the value of continueToCheckNextInputs is still true
- // this means that no error is found
- if (continueToCheckNextInputs) {
- validationStatus = {
- "error": false,
- "okFeature": operation
- };
- }
-
- // updating validationStatusArray with validationStatus
- validationStatusArray.push(validationStatus);
- }
- }
- }
- // ending validation process
-
- // start taking specific notifying actions upon validation
- var wizardIsToBeContinued;
- var errorCount = 0;
- var mainErrorMsgWrapper, mainErrorMsg,
- subErrorMsgWrapper, subErrorMsg, subErrorIcon, subOkIcon, featureConfiguredIcon;
- var i;
- for (i = 0; i < validationStatusArray.length; i++) {
- validationStatus = validationStatusArray[i];
- if (validationStatus["error"]) {
- errorCount++;
- if (validationStatus["mainErrorMsg"]) {
- mainErrorMsgWrapper = "#policy-profile-main-error-msg";
- mainErrorMsg = mainErrorMsgWrapper + " span";
- $(mainErrorMsg).text(validationStatus["mainErrorMsg"]);
- $(mainErrorMsgWrapper).removeClass("hidden");
- } else if (validationStatus["subErrorMsg"]) {
- subErrorMsgWrapper = "#" + validationStatus["erroneousFeature"] + "-feature-error-msg";
- subErrorMsg = subErrorMsgWrapper + " span";
- subErrorIcon = "#" + validationStatus["erroneousFeature"] + "-error";
- subOkIcon = "#" + validationStatus["erroneousFeature"] + "-ok";
- featureConfiguredIcon = "#" + validationStatus["erroneousFeature"] + "-configured";
- // hiding featureConfiguredState as the first step
- if (!$(featureConfiguredIcon).hasClass("hidden")) {
- $(featureConfiguredIcon).addClass("hidden");
- }
- // updating error state and corresponding messages
- $(subErrorMsg).text(validationStatus["subErrorMsg"]);
- if ($(subErrorMsgWrapper).hasClass("hidden")) {
- $(subErrorMsgWrapper).removeClass("hidden");
- }
- if (!$(subOkIcon).hasClass("hidden")) {
- $(subOkIcon).addClass("hidden");
- }
- if ($(subErrorIcon).hasClass("hidden")) {
- $(subErrorIcon).removeClass("hidden");
- }
- }
- } else {
- if (validationStatus["okFeature"]) {
- subErrorMsgWrapper = "#" + validationStatus["okFeature"] + "-feature-error-msg";
- subErrorIcon = "#" + validationStatus["okFeature"] + "-error";
- subOkIcon = "#" + validationStatus["okFeature"] + "-ok";
- featureConfiguredIcon = "#" + validationStatus["okFeature"] + "-configured";
- // hiding featureConfiguredState as the first step
- if (!$(featureConfiguredIcon).hasClass("hidden")) {
- $(featureConfiguredIcon).addClass("hidden");
- }
- // updating success state and corresponding messages
- if (!$(subErrorMsgWrapper).hasClass("hidden")) {
- $(subErrorMsgWrapper).addClass("hidden");
- }
- if (!$(subErrorIcon).hasClass("hidden")) {
- $(subErrorIcon).addClass("hidden");
- }
- if ($(subOkIcon).hasClass("hidden")) {
- $(subOkIcon).removeClass("hidden");
- }
- }
- }
- }
-
- wizardIsToBeContinued = (errorCount == 0);
- return wizardIsToBeContinued;
-};
-
-stepForwardFrom["policy-profile"] = function () {
- policy["profile"] = operationModule.generateProfile(policy["platform"], configuredOperations);
- // updating next-page wizard title with selected platform
- $("#policy-criteria-page-wizard-title").text("ADD " + policy["platform"] + " POLICY");
- // updating ownership type options according to platform
- if (policy["platform"] == platformTypeConstants["IOS"] ||
- policy["platform"] == platformTypeConstants["WINDOWS"]) {
- var ownershipTypeSelectOptions = $("#ownership-input");
- ownershipTypeSelectOptions.empty();
- ownershipTypeSelectOptions.append($("
").
- attr("value", "BYOD").text("BYOD (Bring Your Own Device)"));
- ownershipTypeSelectOptions.attr("disabled", true);
- }
-};
-
-stepBackFrom["policy-profile"] = function () {
- // reinitialize configuredOperations
- configuredOperations = [];
- // clearing already-loaded platform specific hidden-operations html content from the relevant div
- // so that, the wrong content would not be shown at the first glance, in case
- // the user selects a different platform
- $(".wr-advance-operations").html(
- "
" +
- " " +
- " " +
- "Loading Platform Features . . ." +
- " " +
- " " +
- "
"
- );
-};
-
-stepForwardFrom["policy-criteria"] = function () {
- $("input[type='radio'].select-users-radio").each(function () {
- if ($(this).is(':radio')) {
- if ($(this).is(":checked")) {
- if ($(this).attr("id") == "users-radio-btn") {
- policy["selectedUsers"] = $("#users-input").val();
- policy["selectedUserRoles"] = null;
- } else if ($(this).attr("id") == "user-roles-radio-btn") {
- policy["selectedUsers"] = null;
- policy["selectedUserRoles"] = $("#user-roles-input").val();
- }
- }
- }
- });
- policy["selectedNonCompliantAction"] = $("#action-input").find(":selected").data("action");
- policy["selectedOwnership"] = $("#ownership-input").val();
- //updating next-page wizard title with selected platform
- $("#policy-naming-page-wizard-title").text("ADD " + policy["platform"] + " POLICY");
-};
-
-/**
- * Checks if provided input is valid against provided length range.
- *
- * @param input Alphanumeric or non-alphanumeric input
- * @param minLength Minimum Required Length
- * @param maxLength Maximum Required Length
- * @returns {boolean} Returns true if input matches the provided minimum length and maximum length
- */
-var inputIsValidAgainstLength = function (input, minLength, maxLength) {
- var length = input.length;
- return (length == minLength || (length > minLength && length < maxLength) || length == maxLength);
-};
-
-validateStep["policy-criteria"] = function () {
- var validationStatus = {};
- var selectedAssignees;
- var selectedField = "Role(s)";
-
- $("input[type='radio'].select-users-radio").each(function () {
- if ($(this).is(":checked")) {
- if ($(this).attr("id") == "users-radio-btn") {
- selectedAssignees = $("#users-input").val();
- selectedField = "User(s)";
- } else if ($(this).attr("id") == "user-roles-radio-btn") {
- selectedAssignees = $("#user-roles-input").val();
- }
- return false;
- }
- });
-
- if (selectedAssignees) {
- validationStatus["error"] = false;
- } else {
- validationStatus["error"] = true;
- validationStatus["mainErrorMsg"] = selectedField + " is a required field. It cannot be empty";
- }
-
- var wizardIsToBeContinued;
- if (validationStatus["error"]) {
- wizardIsToBeContinued = false;
- var mainErrorMsgWrapper = "#policy-criteria-main-error-msg";
- var mainErrorMsg = mainErrorMsgWrapper + " span";
- $(mainErrorMsg).text(validationStatus["mainErrorMsg"]);
- $(mainErrorMsgWrapper).removeClass("hidden");
- } else {
- wizardIsToBeContinued = true;
- }
-
- return wizardIsToBeContinued;
-};
-
-validateStep["policy-naming"] = function () {
- var validationStatus = {};
-
- // taking values of inputs to be validated
- var policyName = $("input#policy-name-input").val();
- // starting validation process and updating validationStatus
- if (!policyName) {
- validationStatus["error"] = true;
- validationStatus["mainErrorMsg"] = "Policy name is empty. You cannot proceed.";
- } else if (!inputIsValidAgainstLength(policyName, 1, 30)) {
- validationStatus["error"] = true;
- validationStatus["mainErrorMsg"] =
- "Policy name exceeds maximum allowed length.";
- } else {
- validationStatus["error"] = false;
- }
- // ending validation process
-
- // start taking specific actions upon validation
- var wizardIsToBeContinued;
- if (validationStatus["error"]) {
- wizardIsToBeContinued = false;
- var mainErrorMsgWrapper = "#policy-naming-main-error-msg";
- var mainErrorMsg = mainErrorMsgWrapper + " span";
- $(mainErrorMsg).text(validationStatus["mainErrorMsg"]);
- $(mainErrorMsgWrapper).removeClass("hidden");
- } else {
- wizardIsToBeContinued = true;
- }
-
- return wizardIsToBeContinued;
-};
-
-validateStep["policy-platform"] = function () {
- return false;
-};
-
-validateStep["policy-naming-publish"] = function () {
- var validationStatus = {};
-
- // taking values of inputs to be validated
- var policyName = $("input#policy-name-input").val();
- // starting validation process and updating validationStatus
- if (!policyName) {
- validationStatus["error"] = true;
- validationStatus["mainErrorMsg"] = "Policy name is empty. You cannot proceed.";
- } else if (!inputIsValidAgainstLength(policyName, 1, 30)) {
- validationStatus["error"] = true;
- validationStatus["mainErrorMsg"] =
- "Policy name exceeds maximum allowed length.";
- } else {
- validationStatus["error"] = false;
- }
- // ending validation process
-
- // start taking specific actions upon validation
- var wizardIsToBeContinued;
- if (validationStatus["error"]) {
- wizardIsToBeContinued = false;
- var mainErrorMsgWrapper = "#policy-naming-main-error-msg";
- var mainErrorMsg = mainErrorMsgWrapper + " span";
- $(mainErrorMsg).text(validationStatus["mainErrorMsg"]);
- $(mainErrorMsgWrapper).removeClass("hidden");
- } else {
- wizardIsToBeContinued = true;
- }
-
- return wizardIsToBeContinued;
-};
-
-stepForwardFrom["policy-naming-publish"] = function () {
- policy["policyName"] = $("#policy-name-input").val();
- policy["description"] = $("#policy-description-input").val();
- //All data is collected. Policy can now be updated.
- savePolicy(policy, true, "/api/device-mgt/v1.0/policies/");
-};
-
-stepForwardFrom["policy-naming"] = function () {
- policy["policyName"] = $("#policy-name-input").val();
- policy["description"] = $("#policy-description-input").val();
- //All data is collected. Policy can now be updated.
- savePolicy(policy, false, "/api/device-mgt/v1.0/policies/");
-};
-
-var savePolicy = function (policy, isActive, serviceURL) {
- var profilePayloads = [];
- // traverses key by key in policy["profile"]
- var key;
- for (key in policy["profile"]) {
- if (policy["platformId"] == platformIds["WINDOWS"] &&
- key == windowsOperationConstants["PASSCODE_POLICY_OPERATION_CODE"]) {
- policy["profile"][key].enablePassword = true;
- }
- if (policy["profile"].hasOwnProperty(key)) {
- profilePayloads.push({
- "featureCode": key,
- "deviceType": policy["platform"],
- "content": policy["profile"][key]
- });
- }
- }
-
- $.each(profilePayloads, function (i, item) {
- $.each(item.content, function (key, value) {
- //cannot add a true check since it will catch value = false as well
- if (value === null || value === undefined || value === "") {
- item.content[key] = null;
- }
- });
- });
-
- var payload = {
- "policyName": policy["policyName"],
- "description": policy["description"],
- "compliance": policy["selectedNonCompliantAction"],
- "ownershipType": policy["selectedOwnership"],
- "active": isActive,
- "profile": {
- "profileName": policy["policyName"],
- "deviceType": policy["platform"],
- "profileFeaturesList": profilePayloads
- }
- };
-
- if (policy["selectedUsers"]) {
- payload["users"] = policy["selectedUsers"];
- } else if (policy["selectedUserRoles"]) {
- payload["roles"] = policy["selectedUserRoles"];
- } else {
- payload["users"] = [];
- payload["roles"] = [];
- }
-
- console.log(JSON.stringify(payload));
-
- invokerUtil.post(
- serviceURL,
- payload,
- function () {
- $(".add-policy").addClass("hidden");
- $(".policy-naming").addClass("hidden");
- $(".policy-message").removeClass("hidden");
- },
- function (data) {
- }
- );
-};
-
-// Start of HTML embedded invoke methods
-var showAdvanceOperation = function (operation, button) {
- $(button).addClass('selected');
- $(button).siblings().removeClass('selected');
- var hiddenOperation = ".wr-hidden-operations-content > div";
- $(hiddenOperation + '[data-operation="' + operation + '"]').show();
- $(hiddenOperation + '[data-operation="' + operation + '"]').siblings().hide();
-};
-
-
-/**
- * This method will display appropriate fields based on wifi type
- * @param select
- */
-var changeAndroidWifiPolicy = function (select) {
- slideDownPaneAgainstValueSet(select, 'control-wifi-password', ['wep', 'wpa', '802eap']);
- slideDownPaneAgainstValueSet(select, 'control-wifi-eap', ['802eap']);
- slideDownPaneAgainstValueSet(select, 'control-wifi-phase2', ['802eap']);
- slideDownPaneAgainstValueSet(select, 'control-wifi-identity', ['802eap']);
- slideDownPaneAgainstValueSet(select, 'control-wifi-anoidentity', ['802eap']);
- slideDownPaneAgainstValueSet(select, 'control-wifi-cacert', ['802eap']);
-};
-
-/**
- * This method will display appropriate fields based on wifi EAP type
- * @param select
- * @param superSelect
- */
-var changeAndroidWifiPolicyEAP = function (select, superSelect) {
- slideDownPaneAgainstValueSet(select, 'control-wifi-password', ['peap', 'ttls', 'pwd' ,'fast', 'leap']);
- slideDownPaneAgainstValueSet(select, 'control-wifi-phase2', ['peap', 'ttls', 'fast']);
- slideDownPaneAgainstValueSet(select, 'control-wifi-provisioning', ['fast']);
- slideDownPaneAgainstValueSet(select, 'control-wifi-identity', ['peap', 'tls', 'ttls', 'pwd', 'fast', 'leap']);
- slideDownPaneAgainstValueSet(select, 'control-wifi-anoidentity', ['peap', 'ttls']);
- slideDownPaneAgainstValueSet(select, 'control-wifi-cacert', ['peap', 'tls', 'ttls']);
- if (superSelect.value != '802eap') {
- changeAndroidWifiPolicy(superSelect);
- }
-};
-
-/**
- * This method will encode the file-input and enter the values to given input files
- * @param fileInput
- * @param fileHiddenInput
- * @param fileNameHiddenInput
- */
-var base64EncodeFile = function (fileInput, fileHiddenInput, fileNameHiddenInput) {
- var file = fileInput.files[0];
- if (file) {
- var reader = new FileReader();
- reader.onload = function(readerEvt) {
- var binaryString = readerEvt.target.result;
- fileHiddenInput.value = (btoa(binaryString));
- fileNameHiddenInput.value = file.name.substr(0,file.name.lastIndexOf("."));
- };
- reader.readAsBinaryString(file);
- }
-};
-
-/**
- * Method to slide down a provided pane upon provided value set.
- *
- * @param selectElement Select HTML Element to consider
- * @param paneID HTML ID of div element to slide down
- * @param valueSet Applicable Value Set
- */
-var slideDownPaneAgainstValueSet = function (selectElement, paneID, valueSet) {
- var selectedValueOnChange = $(selectElement).find("option:selected").val();
- if ($(selectElement).is("input:checkbox")) {
- selectedValueOnChange = $(selectElement).is(":checked").toString();
- }
-
- var i, slideDownVotes = 0;
- for (i = 0; i < valueSet.length; i++) {
- if (selectedValueOnChange == valueSet[i]) {
- slideDownVotes++;
- }
- }
- var paneSelector = "#" + paneID;
- if (slideDownVotes > 0) {
- if (!$(paneSelector).hasClass("expanded")) {
- $(paneSelector).addClass("expanded");
- }
- $(paneSelector).slideDown();
- } else {
- if ($(paneSelector).hasClass("expanded")) {
- $(paneSelector).removeClass("expanded");
- }
- $(paneSelector).slideUp();
- /** now follows the code to reinitialize all inputs of the slidable pane */
- // reinitializing input fields into the defaults
- $(paneSelector + " input").each(
- function () {
- if ($(this).is("input:text")) {
- $(this).val($(this).data("default"));
- } else if ($(this).is("input:password")) {
- $(this).val("");
- } else if ($(this).is("input:checkbox")) {
- $(this).prop("checked", $(this).data("default"));
- // if this checkbox is the parent input of a grouped-input
- if ($(this).hasClass("parent-input")) {
- var groupedInput = $(this).parent().parent().parent();
- updateGroupedInputVisibility(groupedInput);
- }
- }
- }
- );
- // reinitializing select fields into the defaults
- $(paneSelector + " select").each(
- function () {
- var defaultOption = $(this).data("default");
- $("option:eq(" + defaultOption + ")", this).prop("selected", "selected");
- }
- );
- // collapsing expanded-panes (upon the selection of html-select-options) if any
- $(paneSelector + " .expanded").each(
- function () {
- if ($(this).hasClass("expanded")) {
- $(this).removeClass("expanded");
- }
- $(this).slideUp();
- }
- );
- // removing all entries of grid-input elements if exist
- $(paneSelector + " .grouped-array-input").each(
- function () {
- var gridInputs = $(this).find("[data-add-form-clone]");
- if (gridInputs.length > 0) {
- gridInputs.remove();
- }
- var helpTexts = $(this).find("[data-help-text=add-form]");
- if (helpTexts.length > 0) {
- helpTexts.show();
- }
- }
- );
- }
-};
-// End of HTML embedded invoke methods
-
-
-// Start of functions related to grid-input-view
-
-/**
- * Method to set count id to cloned elements.
- * @param {object} addFormContainer
- */
-var setId = function (addFormContainer) {
- $(addFormContainer).find("[data-add-form-clone]").each(function (i) {
- $(this).attr("id", $(this).attr("data-add-form-clone").slice(1) + "-" + (i + 1));
- if ($(this).find(".index").length > 0) {
- $(this).find(".index").html(i + 1);
- }
- });
-};
-
-/**
- * Method to set count id to cloned elements.
- * @param {object} addFormContainer
- */
-var showHideHelpText = function (addFormContainer) {
- var helpText = "[data-help-text=add-form]";
- if ($(addFormContainer).find("[data-add-form-clone]").length > 0) {
- $(addFormContainer).find(helpText).hide();
- } else {
- $(addFormContainer).find(helpText).show();
- }
-};
-
-function formatRepo(user) {
- if (user.loading) {
- return user.text;
- }
- if (!user.username) {
- return;
- }
- var markup = '
' +
- '
' +
- '
' +
- '
' + user.username + '
';
- if (user.firstname) {
- markup += '
' + user.firstname + '
';
- }
- if (user.emailAddress) {
- markup += '
' + user.emailAddress + '
';
- }
- markup += '
';
- return markup;
-}
-
-function formatRepoSelection(user) {
- return user.username || user.text;
-}
-
-function promptErrorPolicyPlatform(errorMsg) {
- var mainErrorMsgWrapper = "#policy-platform-main-error-msg";
- var mainErrorMsg = mainErrorMsgWrapper + " span";
- $(mainErrorMsg).text(errorMsg);
- $(mainErrorMsgWrapper).removeClass("hidden");
-}
-
-// End of functions related to grid-input-view
-
-
-$(document).ready(function () {
- var enabledPlatforms = $("#supportedPlatforms");
- var isAndroidEnabled = enabledPlatforms.data("android");
- var isWindowsEnabled = enabledPlatforms.data("windows");
- var isIosEnabled = enabledPlatforms.data("ios");
- var androidType = enabledPlatforms.data("android-type");
- var windowsType = enabledPlatforms.data("windows-type");
- var iosType = enabledPlatforms.data("ios-type");
-
- var androidLink = $(".android-platform");
- if (isAndroidEnabled) {
- androidLink.attr("data-platform-type", androidType);
- } else {
- androidLink.unbind("click");
- androidLink.attr("data-validate","true");
- androidLink.bind("click",function(){
- promptErrorPolicyPlatform("You need to configure Android plugin in order to use android policy wizard.");
- });
-
- }
- var windowsLink = $(".windows-platform") ;
- if (isWindowsEnabled) {
- windowsLink.attr("data-platform-type", windowsType);
- } else {
- windowsLink.unbind("click");
- windowsLink.attr("data-validate","true");
- windowsLink.bind("click",function(){
- promptErrorPolicyPlatform("You need to configure Windows plugin in order to use windows policy wizard.");
- });
- }
- var iosLink = $(".ios-platform");
- if (isIosEnabled) {
- iosLink.attr("data-platform-type", iosType);
- } else {
- iosLink.unbind("click");
- iosLink.attr("data-validate","true");
- iosLink.bind("click",function(){
- promptErrorPolicyPlatform("You need to configure IOS plugging in order to use ios related feature.");
- });
- }
-
- $("#users-input").select2({
- multiple: true,
- tags: false,
- ajax: {
- url: "/emm/api/invoker/execute/",
- method: "POST",
- dataType: 'json',
- delay: 250,
- id: function (user) {
- return user["username"];
- },
- data: function (params) {
- var postData = {};
- postData["requestMethod"] = "GET";
- postData["requestURL"] = "/api/device-mgt/v1.0/users/search/usernames?filter=" + params.term;
- postData["requestPayload"] = null;
- return JSON.stringify(postData);
- },
- processResults: function (data) {
- var newData = [];
- $.each(data, function (index, value) {
- value["id"] = value["username"];
- newData.push(value);
- });
- return {
- results: newData
- };
- },
- cache: true
- },
- escapeMarkup: function (markup) {
- return markup;
- }, // let our custom formatter work
- minimumInputLength: 1,
- templateResult: formatRepo, // omitted for brevity, see the source of this page
- templateSelection: formatRepoSelection // omitted for brevity, see the source of this page
- });
-
- $("#loading-content").remove();
- $(".policy-platform").removeClass("hidden");
- // Adding initial state of wizard-steps.
- $("#policy-platform-wizard-steps").html($(".wr-steps").html());
-
- $("select.select2[multiple=multiple]").select2({
- "tags": false
- });
-
- $("#users-select-field").hide();
- $("#user-roles-select-field").show();
-
- $("input[type='radio'].select-users-radio").change(function () {
- if ($("#users-radio-btn").is(":checked")) {
- $("#user-roles-select-field").hide();
- $("#users-select-field").show();
- }
- if ($("#user-roles-radio-btn").is(":checked")) {
- $("#users-select-field").hide();
- $("#user-roles-select-field").show();
- }
- });
-
- // Support for special input type "ANY" on user(s) & user-role(s) selection
- $("#user-roles-input").select2({
- "tags": false
- }).on("select2:select", function (e) {
- if (e.params.data.id == "ANY") {
- $(this).val("ANY").trigger("change");
- } else {
- $("option[value=ANY]", this).prop("selected", false).parent().trigger("change");
- }
- });
-
- // Maintains an array of configured features of the profile
- var advanceOperations = ".wr-advance-operations";
- $(advanceOperations).on("click", ".wr-input-control.switch", function (event) {
- var operationCode = $(this).parents(".operation-data").data("operation-code");
- var operation = $(this).parents(".operation-data").data("operation");
- var operationDataWrapper = $(this).data("target");
- // prevents event bubbling by figuring out what element it's being called from.
- if (event.target.tagName == "INPUT") {
- var featureConfiguredIcon;
- if ($("input[type='checkbox']", this).is(":checked")) {
- configuredOperations.push(operationCode);
- // when a feature is enabled, if "zero-configured-features" msg is available, hide that.
- var zeroConfiguredOperationsErrorMsg = "#policy-profile-main-error-msg";
- if (!$(zeroConfiguredOperationsErrorMsg).hasClass("hidden")) {
- $(zeroConfiguredOperationsErrorMsg).addClass("hidden");
- }
- // add configured-state-icon to the feature
- featureConfiguredIcon = "#" + operation + "-configured";
- if ($(featureConfiguredIcon).hasClass("hidden")) {
- $(featureConfiguredIcon).removeClass("hidden");
- }
- } else {
- //splicing the array if operation is present.
- var index = $.inArray(operationCode, configuredOperations);
- if (index != -1) {
- configuredOperations.splice(index, 1);
- }
- // when a feature is disabled, clearing all its current configured, error or success states
- var subErrorMsgWrapper = "#" + operation + "-feature-error-msg";
- var subErrorIcon = "#" + operation + "-error";
- var subOkIcon = "#" + operation + "-ok";
- featureConfiguredIcon = "#" + operation + "-configured";
-
- if (!$(subErrorMsgWrapper).hasClass("hidden")) {
- $(subErrorMsgWrapper).addClass("hidden");
- }
- if (!$(subErrorIcon).hasClass("hidden")) {
- $(subErrorIcon).addClass("hidden");
- }
- if (!$(subOkIcon).hasClass("hidden")) {
- $(subOkIcon).addClass("hidden");
- }
- if (!$(featureConfiguredIcon).hasClass("hidden")) {
- $(featureConfiguredIcon).addClass("hidden");
- }
- // reinitializing input fields into the defaults
- $(operationDataWrapper + " input").each(
- function () {
- if ($(this).is("input:text")) {
- $(this).val($(this).data("default"));
- } else if ($(this).is("input:password")) {
- $(this).val("");
- } else if ($(this).is("input:checkbox")) {
- $(this).prop("checked", $(this).data("default"));
- // if this checkbox is the parent input of a grouped-input
- if ($(this).hasClass("parent-input")) {
- var groupedInput = $(this).parent().parent().parent();
- updateGroupedInputVisibility(groupedInput);
- }
- }
- }
- );
- // reinitializing select fields into the defaults
- $(operationDataWrapper + " select").each(
- function () {
- var defaultOption = $(this).data("default");
- $("option:eq(" + defaultOption + ")", this).prop("selected", "selected");
- }
- );
- // collapsing expanded-panes (upon the selection of html-select-options) if any
- $(operationDataWrapper + " .expanded").each(
- function () {
- if ($(this).hasClass("expanded")) {
- $(this).removeClass("expanded");
- }
- $(this).slideUp();
- }
- );
- // removing all entries of grid-input elements if exist
- $(operationDataWrapper + " .grouped-array-input").each(
- function () {
- var gridInputs = $(this).find("[data-add-form-clone]");
- if (gridInputs.length > 0) {
- gridInputs.remove();
- }
- var helpTexts = $(this).find("[data-help-text=add-form]");
- if (helpTexts.length > 0) {
- helpTexts.show();
- }
- }
- );
- }
- }
- });
-
- // adding support for cloning multiple profiles per feature with cloneable class definitions
- $(advanceOperations).on("click", ".multi-view.add.enabled", function () {
- // get a copy of .cloneable and create new .cloned div element
- var cloned = "
" + $(".cloneable", $(this).parent().parent()).html() + "";
- // append newly created .cloned div element to panel-body
- $(this).parent().parent().append(cloned);
- // enable remove action of newly cloned div element
- $(".cloned", $(this).parent().parent()).each(
- function () {
- if ($(".multi-view.remove", this).hasClass("disabled")) {
- $(".multi-view.remove", this).removeClass("disabled");
- }
- if (!$(".multi-view.remove", this).hasClass("enabled")) {
- $(".multi-view.remove", this).addClass("enabled");
- }
- }
- );
- });
-
- $(advanceOperations).on("click", ".multi-view.remove.enabled", function () {
- $(this).parent().remove();
- });
-
- // enabling or disabling grouped-input based on the status of a parent check-box
- $(advanceOperations).on("click", ".grouped-input", function () {
- updateGroupedInputVisibility(this);
- });
-
- // add form entry click function for grid inputs
- $(advanceOperations).on("click", "[data-click-event=add-form]", function () {
- var addFormContainer = $("[data-add-form-container=" + $(this).attr("href") + "]");
- var clonedForm = $("[data-add-form=" + $(this).attr("href") + "]").clone().
- find("[data-add-form-element=clone]").attr("data-add-form-clone", $(this).attr("href"));
-
- // adding class .child-input to capture text-input-array-values
- $("input, select", clonedForm).addClass("child-input");
-
- $(addFormContainer).append(clonedForm);
- setId(addFormContainer);
- showHideHelpText(addFormContainer);
- });
-
- // remove form entry click function for grid inputs
- $(advanceOperations).on("click", "[data-click-event=remove-form]", function () {
- var addFormContainer = $("[data-add-form-container=" + $(this).attr("href") + "]");
-
- $(this).closest("[data-add-form-element=clone]").remove();
- setId(addFormContainer);
- showHideHelpText(addFormContainer);
- });
-
- $(".wizard-stepper").click(function () {
- // button clicked here can be either a continue button or a back button.
- var currentStep = $(this).data("current");
- var validationIsRequired = $(this).data("validate");
- var wizardIsToBeContinued;
-
- if (validationIsRequired) {
- wizardIsToBeContinued = validateStep[currentStep]();
- } else {
- wizardIsToBeContinued = true;
- }
-
- if (wizardIsToBeContinued) {
- // When moving back and forth, following code segment will
- // remove if there are any visible error-messages.
- var errorMsgWrappers = ".alert.alert-danger";
- $(errorMsgWrappers).each(
- function () {
- if (!$(this).hasClass("hidden")) {
- $(this).addClass("hidden");
- }
- }
- );
-
- var nextStep = $(this).data("next");
- var isBackBtn = $(this).data("is-back-btn");
-
- // if current button is a continuation...
- if (!isBackBtn) {
- // initiate stepForwardFrom[*] functions to gather form data.
- if (stepForwardFrom[currentStep]) {
- stepForwardFrom[currentStep](this);
- }
- } else {
- // initiate stepBackFrom[*] functions to rollback.
- if (stepBackFrom[currentStep]) {
- stepBackFrom[currentStep]();
- }
- }
-
- // following step occurs only at the last stage of the wizard.
- if (!nextStep) {
- window.location.href = $(this).data("direct");
- }
-
- // updating next wizard step as current.
- $(".itm-wiz").each(function () {
- var step = $(this).data("step");
- if (step == nextStep) {
- $(this).addClass("itm-wiz-current");
- } else {
- $(this).removeClass("itm-wiz-current");
- }
- });
-
- // adding next update of wizard-steps.
- $("#" + nextStep + "-wizard-steps").html($(".wr-steps").html());
-
- // hiding current section of the wizard and showing next section.
- $("." + currentStep).addClass("hidden");
- $("." + nextStep).removeClass("hidden");
- }
- });
-
-});
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/templates/hidden-operations-android.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/templates/hidden-operations-android.hbs
deleted file mode 100644
index 9eb9fac829..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/templates/hidden-operations-android.hbs
+++ /dev/null
@@ -1,1273 +0,0 @@
-
-
-
-
-
-
-
-
-
- Passcode Policy
-
-
-
-
-
-
-
- This configuration can be used to set a passcode policy to an Android Device.
- Once this configuration profile is installed on a device, corresponding users will not be
- able
- to modify these settings on their devices.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Allow simple value
-
-
-
-
-
-
-
-
-
- Require alphanumeric value
-
-
-
-
-
-
-
- Minimum passcode length
-
-
-
-
-
-
- None
-
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
-
-
-
-
-
- Minimum number of complex characters
-
-
-
-
-
-
- None
-
- 01
- 02
- 03
- 04
- 05
-
-
-
-
-
- Maximum passcode age in days*
-
-
-
-
- ( Should be in between 1-to-730 days or none )
-
-
-
-
-
-
- Passcode history*
-
-
-
-
- ( Should be in between 1-to-50 passcodes or none )
-
-
-
-
-
-
- Maximum number of failed attempts
-
-
-
-
-
-
- None
-
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
-
-
-
-
-
-
-
-
-
-
-
-
- Restrictions
-
-
-
-
-
-
-
- This configurations can be used to restrict certain settings on an Android device.
- Once this configuration profile is installed on a device, corresponding users will not be
- able
- to modify these settings on their devices.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Allow use of camera
-
-
-
-
-
-
-
-
-
- Disallow configuring credentials
-
-
-
-
-
-
-
-
-
- Disallow configuring VPN
-
-
-
-
-
-
-
-
-
-
- Disallow configuring app control
-
-
-
-
-
-
-
-
-
- Disallow cross profile copy paste
-
-
-
-
-
-
-
-
-
- Disallow debuging
-
-
-
-
-
-
-
-
-
- Disallow install apps
-
-
-
-
-
-
-
-
-
- Disallow install from unknown sources
-
-
-
-
-
-
-
-
-
- Disallow modify accounts
-
-
-
-
-
-
-
-
-
- Disallow outgoing beam
-
-
-
-
-
-
-
-
-
- Disallow location sharing
-
-
-
-
-
-
-
-
-
- Disallow uninstall apps
-
-
-
-
-
-
-
-
-
- Disallow parent profile app linking
-
-
-
-
-
-
-
-
-
- Ensure verifying apps
-
-
-
-
-
-
-
-
-
- Enable auto timing
-
-
-
-
-
-
-
-
-
- Disable screen capture
-
-
-
-
-
-
-
-
-
- Disallow SMS
-
-
-
-
-
-
-
-
-
- Disallow volume adjust
-
-
-
-
-
-
-
-
-
- Disallow cell broadcast
-
-
-
-
-
-
-
-
-
- Disallow configuring bluetooth.
-
-
-
-
-
-
-
-
-
- Disallow configuring mobile networks
-
-
-
-
-
-
-
-
-
- Disallow configuring tethering
-
-
-
-
-
-
-
-
-
- Disallow configuring Wifi
-
-
-
-
-
-
-
-
-
- Disallow safe boot
-
-
-
-
-
-
-
-
-
- Disallow outgoing calls
-
-
-
-
-
-
-
-
-
- Disallow mount physical media
-
-
-
-
-
-
-
-
-
- Disallow create window
-
-
-
-
-
-
-
-
-
- Disallow factory reset
-
-
-
-
-
-
-
-
-
- Disallow remove user
-
-
-
-
-
-
-
-
-
- Disallow add user
-
-
-
-
-
-
-
-
-
- Disallow network reset
-
-
-
-
-
-
-
-
-
- Disallow USB file transfer
-
-
-
-
-
-
-
-
-
- Disallow unmute microphone
-
-
-
-
-
-
-
-
-
-
- Disable status bar
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Encryption Settings
-
-
-
-
-
-
-
- This configuration can be used to encrypt data on an Android device, when the device is
- locked and
- make it readable when the passcode is entered. Once this configuration profile is installed
- on a device,
- corresponding users will not be able to modify these settings on their devices.
-
-
-
-
-
-
-
- Un-check following checkbox in case you do not need the device to be encrypted.
-
-
-
-
-
-
- Enable storage-encryption
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Wi-Fi Settings
-
-
-
-
-
-
-
- This configurations can be used to configure Wi-Fi access on an Android device.
- Once this configuration profile is installed on a device, corresponding users will not be
- able
- to modify these settings on their devices.
-
-
-
-
- Please note that * sign represents required fields of data.
-
-
-
-
-
-
-
- Service Set Identifier (SSID)*
-
-
-
-
-
- Service Set Identifier should be 1-to-30 characters long
-
-
-
-
-
- Security*
-
-
-
-
-
- None
- WEP
- WPA/WPA 2 PSK
- 802.1x EAP
-
-
-
-
-
- EAP Method
-
-
-
-
-
- PEAP
- TLS
- TTLS
- PWD
- SIM
- AKA
-
-
-
-
- Phase 2 Authentication
-
-
-
-
-
- None
- PAP
- MCHAP
- MCHAPV2
- GTC
-
-
-
-
- Provisioning
-
-
-
-
-
- 0
- 1
- 2
- 3
-
-
-
-
- Identity
-
-
-
-
-
- Identity should be 1-to-30 characters long
-
-
-
-
-
- Anonymous Identity
-
-
-
-
-
- Anonymous Identity should be 1-to-30 characters long
-
-
-
-
-
- CA Certificate
-
-
-
-
-
-
-
-
-
-
- Password
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Application Restriction Settings
-
-
-
-
-
-
-
- This configuration can be used to create a black list or white list of applications.
-
-
-
-
-
-
-
-
-
-
- Select type
-
-
-
-
-
-
- Black List
- White List
-
-
-
-
-
-
-
-
-
-
-
-
-
- VPN Settings
-
-
-
-
-
-
-
- This configurations can be used to configure VPN settings on an Android device.
- Once this configuration profile is installed on a device, corresponding users will not be
- able
- to modify these settings on their devices.
-
-
-
-
- Please note that * sign represents required fields of data.
-
-
-
-
-
-
-
- VPN Server Address*
-
-
-
-
-
-
-
-
- VPN Server Port
-
-
-
-
-
-
-
-
- Shared Secret
-
-
-
-
-
-
-
-
- DNS Server
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Work-Profile Configurations
-
-
-
-
-
-
-
- The configurations below can be applied to the devices where the agent is running in Android
- Work-Profile.
-
-
-
-
-
-
-
-
-
-
-
- Profile Name
-
-
-
-
-
-
-
-
-
- Enable System Apps
-
-
-
-
- ( Should be exact package names seperated by commas. Ex: com.google.android.apps.maps,
- com.google.android.calculator )
-
-
-
-
-
- Hide System Apps
-
-
-
-
- ( Should be exact package names seperated by commas. Ex: com.google.android.apps.maps,
- com.google.android.calculator )
-
-
-
-
-
- Unhide System Apps
-
-
-
-
- ( Should be exact package names seperated by commas. Ex: com.google.android.apps.maps,
- com.google.android.calculator )
-
-
-
-
-
- Enable Google Play Store Apps
-
-
-
-
- ( Should be exact package names seperated by commas. Ex: com.google.android.apps.maps,
- com.google.android.calculator )
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/templates/hidden-operations-ios.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/templates/hidden-operations-ios.hbs
deleted file mode 100644
index ef6f2d3683..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/templates/hidden-operations-ios.hbs
+++ /dev/null
@@ -1,4832 +0,0 @@
-
-
-
-
-
-
-
-
-
- Passcode Policy
-
-
-
-
-
-
-
- This configuration can be used to set a passcode policy to an iOS Device.
- Once this configuration profile is installed on a device, corresponding users
- will not be able
- to modify these settings on their devices.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Force Passcode
-
-
-
-
-
-
-
-
-
- Allow simple value
-
-
-
-
-
-
-
-
-
- Require alphanumeric value
-
-
-
-
-
-
-
- Minimum passcode length
-
-
-
-
-
-
- None
-
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
-
-
-
-
-
- Minimum number of complex characters
-
-
-
-
-
-
- None
-
- 01
- 02
- 03
- 04
-
-
-
-
-
- Maximum passcode age in days*
- ( Should be in between 1-to-730 days or none )
-
-
-
-
-
-
-
-
-
- Passcode history*
- ( Should be in between 1-to-50 passcodes or none )
-
-
-
-
-
-
-
-
-
- Auto Lock Time in minutes*
-
-
-
-
-
-
- None
-
- 01
- 02
- 03
- 04
- 05
-
-
-
-
-
- Grace period in minutes for device lock*
-
-
-
-
-
-
- None
-
- Immediately
- 01
- 05
- 10
- 15
- 30
- 60
-
-
-
-
-
- Maximum number of failed attempts*
-
-
-
-
-
-
- None
-
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
-
-
-
-
-
-
-
-
-
-
-
-
- VPN Settings
-
-
-
-
-
-
-
- This configurations can be used to configure VPN settings on an iOS device.
- Once this configuration profile is installed on a device, corresponding users will not
- be able
- to modify these settings on their devices.
-
-
-
-
-Please note that * sign represents required fields of data.
-
-
-
-
-
-
-
-
- Connection Name*
-
-
-
-
-
-
-
-
-
-
- Override Primary
-
-
-
-
-
-
-
-
- On-demand Enabled
-
-
-
-
-
-
-
-
- VPN Type*
-
-
-
-
-
- PPTP
- L2TP
- IPSec
- IKEv2
-
-
-
- For PPTP Configuration :
-
-
-
-
-
- VPN Account Username*
-
-
-
-
-
-
-
-
-
-
- Token Card Enabled
-
-
-
-
-
-
-
- VPN Account Password
-
-
-
-
-
-
-
-
-
- Comm Remote Address*
-
-
-
-
-
-
-
-
-
-
- RSA SecureID Enabled
-
-
-
-
-
-
-
-
- CCP Encryption Enabled
-
-
-
-
-
-
-
- For L2TP Configuration :
-
-
-
-
-
- VPN Account Username*
-
-
-
-
-
-
-
-
-
-
- Token Card Enabled
-
-
-
-
-
-
-
- VPN Account Password
-
-
-
-
-
-
-
-
-
- Comm Remote Address*
-
-
-
-
-
-
-
-
-
-
- RSA SecureID Enabled
-
-
-
-
-
-
- For IPSec Configuration :
-
-
-
-
-
- Remote Address*
-
-
-
-
-
-
-
-
- Authentication Method*
-
-
-
-
-
- Shared Secret
- Certificate
-
-
-
-
-
-
- Payload Certificate UUID*
-
-
-
-
-
-
-
-
-
-
-
- XAuth Enabled
-
-
-
-
-
-
-
- XAuth Name*
-
-
-
-
-
-
-
-
-
-
-
- Prompt for VPN PIN
-
-
-
-
-
-
- For IKEv2 Configuration :
-
-
-
-
-
- Remote Address*
-
-
-
-
-
-
-
-
- Local Identifier*
-
-
-
-
-
- FQDN
- User FQDN
- Address
- ASN1DN
-
-
-
-
- Remote Identifier*
-
-
-
-
-
- FQDN
- User FQDN
- Address
- ASN1DN
-
-
-
-
- Authentication Method*
-
-
-
-
-
- Shared Secret
- Certificate
-
-
-
-
-
- Shared Secret*
-
-
-
-
-
-
-
-
-
-
- Payload Certificate UUID*
-
-
-
-
-
-
-
-
-
-
-
- Extended Authentication Enabled
-
-
-
-
-
-
-
- Dead Peer Detection Interval
-
-
-
-
-
- None
- Low
- Medium
- High
-
-
-
-
- Server Certificate Issuer Common Name
-
-
-
-
-
-
-
-
- Server Certificate Common Name
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Per App VPN Settings
-
-
-
-
-
-
-
- This configuration can be used to configure add-on VPN software (per-app VPN),
- and it works only on VPN services of
- type 'VPN'. Once this configuration profile is installed on a device,
- corresponding users will not be able
- to modify these settings on their devices.
-
-
-
-
- Please note that * sign represents required fields of data.
-
-
-
-
-
-
-
-
- VPNUUID*
-
-
-
-
-
-
-
-
-
-
- On Demand Match App Enabled
-
-
-
-
-
-
-
-
-
-
- App-to-Per-App VPN Mapping
-
-
-
-
-
-
-
- This configuration can be used to configure app-to-per-app VPN mappings.
- Once this configuration profile is installed on a device, corresponding users will not be able
- to modify these settings on their devices.
-
-
-
-
- Please note that * sign represents required fields of data.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Wi-Fi Settings
-
-
-
-
-
-
-
- These configurations can be used to set how devices connect to your wireless network(s),
- including the necessary authentication
- information. Once this configuration profile is installed on an iOS device,
- corresponding users will not be able
- to modify these settings on their devices.
-
-
-
-
-
-
-
-
-
-
- Service Set Identifier (SSID)
-
-
-
-
-
-
-
-
-
- Domain Name
-
-
-
-
- ( For Wi-Fi Hotspot 2.0 negotiation )
-
-
-
-
-
-
-
-
- Hidden Network
-
-
-
-
-
-
-
-
-
- Hot Spot
-
-
-
-
-
-
-
-
-
- Enable Service Provider Roaming
-
-
-
-
-
-
-
-
-
- Auto Join
-
-
-
-
-
-
-
- Displayed Operator Name
-
-
-
-
-
-
-
-
-
- Proxy Setup
-
-
-
-
-
-
- None
-
- Manual
- Automatic
-
-
-
-
-
-
-
- Encryption Security Type
-
-
-
-
-
- None
- WEP
- WPA
- ANY
-
-
-
-
-
-For WEP, WPA or ANY Encryption Security Type :
-
-
-
-
-
- Wi-Fi Password
-
-
-
-
-
-
-
-
-
-EAP Client Configuration ( Optional ) :
-
-
-
-
-
-
-
- Username
-
-
-
-
-
-
-
-
-
- Password
-
-
-
-
-
-
-
-
-
-
-
- One Time Password
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Allow TLS Trust Exceptions
-
-
-
-
-
-
-
-
-
- Require TLS Certificate
-
-
-
-
-
-
-
- TTLS Inner Authentication Type
-
-
-
-
-
- PAP
- CHAP
- MSCHAP
- MSCHAPv2
-
-
-
-
-
- Outer Identity
-
-
-
-
- ( Only relevant to TTLS, PEAP and EAP-FAST )
-
-
-
-
-EAP-Fast Support :
-
-
-
-
-
-
-
- Number of expected RANDs for EAP-SIM
-
-
-
-
-
- 2
- 3
-
-
-
-
-
-
-
- Certificate Payload UUID
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Email Settings
-
-
-
-
-
-
-
- These configurations can be used to define settings for connecting
- to your POP or IMAP email accounts.
- Once this configuration profile is installed on an iOS device,
- corresponding users will not be able to modify these settings on their devices.
-
-
-
-
-
-
-
-
-
-
-
-
-
- AirPlay Settings
-
-
-
-
-
-
-
- This configuration can be used to define settings for connecting to AirPlay
- destinations.
- Once this configuration profile is installed on an iOS device,
- corresponding users will not be able to modify these settings on their devices.
- (This feature is supported only on iOS 7.0 and later.)
-
-
-
-
-
-
-
-
-
-
-
-
-
- Manage Domains
-
-
-
-
-
-
-
- This payload defines web domains that are under an enterprise’s management.
-
-
-
-
-
-
-
-
-
-
-
-
-
- LDAP Settings
-
-
-
-
-
-
-
- This configuration can be used to define settings for connecting to LDAP
- servers.
- Once this configuration profile is installed on an iOS device,
- corresponding users will not be able to modify these settings on their devices.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Calendar
-
-
-
-
-
-
-
- This configuration can be used to define settings for connecting to CalDAV
- servers.
- Once this configuration profile is installed on an iOS device,
- corresponding users will not be able to modify these settings on their devices.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Calendar Subscription
-
-
-
-
-
-
-
- This configuration can be used to define settings for calendar subscriptions.
- Once this configuration profile is installed on an iOS device,
- corresponding users will not be able to modify these settings on their devices.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Access Point Names ( APN )
-
-
-
-
-
-
-
- These configurations can be used to specify Access Point Names ( APN ).
- Once this configuration profile is installed on an iOS device, corresponding
- users will not
- be able to modify these settings on their devices.
- (This feature is not supported on iOS 7.0 and later.)
-
-
-
-
-
-
-
-
-
-
-
-
-
- Cellular Network Settings
-
-
-
-
-
-
-
- These configurations can be used to specify Cellular Network Settings on an iOS
- device.
- Cellular settings cannot be installed if an APN setting is already installed and
- upon successful installation, corresponding users will not be able to modify
- these
- settings on their devices.
- (This feature is supported only on iOS 7.0 and later.)
-
-
-
-
-
-
-
-
-
-
-
- Cellular Configuration Name
-
-
-
-
-
-
-
-
-
- Authentication Type
-
-
-
-
-
- PAP
- CHAP
-
-
-
-
-
- Username
-
-
-
-
-
-
-
-
-
- Password
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Restrictions
-
-
-
-
-
-
-
- These configurations can be used to restrict apps, device features and
- media content available on an iOS device. Once this configuration profile is installed
- on a device, corresponding users will not be able to modify these settings on their
- devices.
-
-
-
-
-
-
-
-
-
-Restrictions on Device Functionality :
-
-
-
-Restrictions on Applications :
-
-
-
-
-
- Other Restrictions :
-
-
-
-
-
-
-
-
-
-
-
-
-
- Application Restriction Settings
-
-
-
-
-
-
-
- This configuration can be used to create a black list or white list of
- applications.
-
-
-
-
-
-
-
-
-
-
-
- None
-
- Black List
- White List
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/templates/hidden-operations-windows.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/templates/hidden-operations-windows.hbs
deleted file mode 100644
index 2547a69cec..0000000000
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.create/public/templates/hidden-operations-windows.hbs
+++ /dev/null
@@ -1,566 +0,0 @@
-
-
-
-
-
-
-
-
-
- Passcode Policy
-
-
-
-
-
-
-
- This configuration can be used to set a passcode policy to an Windows Device.
- Once this configuration profile is installed on a device, corresponding users will not be able
- to modify these settings on their devices.
-
-
-
-
-
-
-
-
-
-
-
-
-
- Allow simple value
-
-
-
-
-
-
-
-
-
- Require alphanumeric value
-
-
-
-
-
-
-
- Minimum passcode length
-
-
-
-
-
-
- None
-
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
-
-
-
-
-
- Minimum number of complex characters
-
-
-
-
-
-
- None
-
- 01
- 02
- 03
- 04
- 05
-
-
-
-
-
- Maximum passcode age in days
-
-
-
-
- ( Should be in between 1-to-730 days or none )
-
-
-
-
-
-
- Passcode history
-
-
-
-
- ( Should be in between 1-to-50 passcodes or none )
-
-
-
-
-
-
- Maximum number of failed attempts
-
-
-
-
-
-
- None
-
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
-
-
-
-
-
-
-
-
-
-
-
-
- Restrictions on Camera
-
-
-
-
-
-
-
- This configuration can be used to restrict the usage of camera on an Windows device together with all the applications using the camera.
- Once this configuration profile is installed on a device, corresponding users will not be able
- to modify these settings on their devices.
-
-
-
-
-
-
-
- Un-check following checkbox in case you need to disable camera.
-
-
-
-
-
-
- Allow use of camera
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Encryption Settings
-
-
-
-
-
-
-
- This configuration can be used to encrypt data on an Windows device, when the device is locked and
- make it readable when the passcode is entered. Once this configuration profile is installed on a device,
- corresponding users will not be able to modify these settings on their devices.
-
-
-
-
-
-
-
- Un-check following checkbox in case you need to disable storage-encryption.
-
-
-
-
-
-
- Enable storage-encryption
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Application Restriction Settings
-
-
-
-
-
-
-
- This configuration can be used to create a black list or white list of applications.
-
-
-
-
-
-
-
-
-
-
-
- None
-
- Black List
- White List
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file