From a718f73c95385c99c33a357c9e31e6ee974a390f Mon Sep 17 00:00:00 2001 From: Charitha Goonetilleke Date: Tue, 3 Mar 2020 06:34:30 +0000 Subject: [PATCH] Recover the deleted files recovered the deleted files named adroid-policy-edit.js, android-policy-operation.js --- .../public/js/operation-mod.js | 60 +++- .../public/js/android-policy-edit.js | 85 +++++ .../public/templates/android-policy-edit.hbs | 324 +++++++++++++++++ .../public/templates/android-policy-view.hbs | 323 +++++++++++++++++ .../public/js/android-policy-operations.js | 85 +++++ .../templates/android-policy-operations.hbs | 328 +++++++++++++++++- 6 files changed, 1203 insertions(+), 2 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js index f01769a99..98c10f832 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-mod/public/js/operation-mod.js @@ -49,6 +49,7 @@ var androidOperationModule = function () { var androidOperationConstants = { "PASSCODE_POLICY_OPERATION_CODE": "PASSCODE_POLICY", "VPN_OPERATION_CODE": "VPN", + "APN_OPERATION_CODE": "APN", "CAMERA_OPERATION_CODE": "CAMERA", "BACKUP_SERVICE_CODE": "BACKUP_SERVICE", "ENCRYPT_STORAGE_OPERATION_CODE": "ENCRYPT_STORAGE", @@ -67,6 +68,7 @@ var androidOperationModule = function () { "DISALLOW_CONFIG_MOBILE_NETWORKS": "DISALLOW_CONFIG_MOBILE_NETWORKS", "DISALLOW_CONFIG_TETHERING": "DISALLOW_CONFIG_TETHERING", "DISALLOW_CONFIG_VPN": "DISALLOW_CONFIG_VPN", + "DISALLOW_CONFIG_APN": "DISALLOW_CONFIG_APN", "DISALLOW_CONFIG_WIFI": "DISALLOW_CONFIG_WIFI", "DISALLOW_APPS_CONTROL": "DISALLOW_APPS_CONTROL", "DISALLOW_CREATE_WINDOWS": "DISALLOW_CREATE_WINDOWS", @@ -180,6 +182,30 @@ var androidOperationModule = function () { "wifiCaCertName": operationPayload["cacertName"] }; break; + case androidOperationConstants["APN_OPERATION_CODE"]: + payload = { + "apnName": operationPayload["name"], + "apnApn": operationPayload["apn"], + "apnProxyAddress": operationPayload["proxyAddress"], + "apnProxyPort": operationPayload["proxyPort"], + "apnUsername": operationPayload["username"], + "apnPassword": operationPayload["password"], + "apnServer": operationPayload["server"], + "apnMMSC": operationPayload["mMSC"], + "apnMMSProxyAddress": operationPayload["mmsProxyAddress"], + "apnMMSProxyPort": operationPayload["mMSProxyPort"], + "apnMCC": operationPayload["mCC"], + "apnMNC": operationPayload["mNC"], + "apnAuthenticationType": operationPayload["authenticationType"], + "apnType": operationPayload["type"], + "apnProtocol": operationPayload["protocol"], + "apnRoamingProtocol": operationPayload["roamingProtocol"], + "apnIsEnable": operationPayload["isEnable"], + "apnBearer": operationPayload["bearer"], + "apnMVNOType": operationPayload["mVNOType"], + "apnMVNOValue": operationPayload["mVNOValue"] + }; + break; case androidOperationConstants["GLOBAL_PROXY_OPERATION_CODE"]: payload = { "proxyConfigType": operationPayload["proxyConfigType"], @@ -372,6 +398,7 @@ var androidOperationModule = function () { "DISALLOW_CONFIG_MOBILE_NETWORKS": operationData["disallowConfigMobileNetworks"], "DISALLOW_CONFIG_TETHERING": operationData["disallowConfigTethering"], "DISALLOW_CONFIG_VPN": operationData["disallowConfigVpn"], + "DISALLOW_CONFIG_APN": operationData["disallowConfigApn"], "DISALLOW_CONFIG_WIFI": operationData["disallowConfigWifi"], "DISALLOW_APPS_CONTROL": operationData["disallowAppControl"], "DISALLOW_CREATE_WINDOWS": operationData["disallowCreateWindows"], @@ -469,6 +496,33 @@ var androidOperationModule = function () { } }; break; + case androidOperationConstants["APN_OPERATION_CODE"]: + operationType = operationTypeConstants["PROFILE"]; + payload = { + "operation": { + "name": operationData["apnName"], + "apn": operationData["apnApn"], + "proxyAddress": operationData["apnProxyAddress"], + "proxyPort": operationData["apnProxyPort"], + "username": operationData["apnUsername"], + "password": operationData["apnPassword"], + "server": operationData["apnServer"], + "mMSC": operationData["apnMMSC"], + "mmsProxyAddress": operationData["apnMMSProxyAddress"], + "mMSProxyPort": operationData["apnMMSProxyPort"], + "mCC": operationData["apnMCC"], + "mNC": operationData["apnMNC"], + "authenticationType": operationData["apnAuthenticationType"], + "type": operationData["apnType"], + "protocol": operationData["apnProtocol"], + "roamingProtocol": operationData["apnRoamingProtocol"], + "isEnable": operationData["apnIsEnable"], + "bearer": operationData["apnBearer"], + "mVNOType": operationData["apnMVNOType"], + "mVNOValue": operationData["apnMVNOValue"] + } + }; + break; case androidOperationConstants["GLOBAL_PROXY_OPERATION_CODE"]: operationType = operationTypeConstants["PROFILE"]; payload = { @@ -776,6 +830,7 @@ var androidOperationModule = function () { "CAMERA": "control-camera", "BACKUP_SERVICE": "enable-backup", "VPN": "configure-vpn", + "APN": "configure-apn", "DEVICE_LOCK": "lock-devices", "DEVICE_UNLOCK": "unlock-devices", "DEVICE_LOCATION": "location", @@ -1262,6 +1317,9 @@ var androidOperationModule = function () { } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_VPN"]) { restrictions["disallowConfigVpn"] = restriction["enabled"]; continue; + } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_APN"]) { + restrictions["disallowConfigApn"] = restriction["enabled"]; + continue; } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_WIFI"]) { restrictions["disallowConfigWifi"] = restriction["enabled"]; continue; @@ -1377,4 +1435,4 @@ var androidOperationModule = function () { }; return publicMethods; -}(); +}(); \ No newline at end of file diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/js/android-policy-edit.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/js/android-policy-edit.js index 819c46ea9..4b2bc2bf2 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/js/android-policy-edit.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/js/android-policy-edit.js @@ -49,6 +49,8 @@ var androidOperationConstants = { "GLOBAL_PROXY_OPERATION_CODE": "GLOBAL_PROXY", "VPN_OPERATION": "vpn", "VPN_OPERATION_CODE": "VPN", + "APN_OPERATION": "apn", + "APN_OPERATION_CODE": "APN", "APPLICATION_OPERATION": "app-restriction", "APPLICATION_OPERATION_CODE": "APP-RESTRICTION", "KIOSK_APPS_CODE": "KIOSK_APPS", @@ -953,6 +955,89 @@ var validatePolicyProfile = function () { validationStatusArray.push(validationStatus); } + // Validating APN + if ($.inArray(androidOperationConstants["APN_OPERATION_CODE"], configuredOperations) !== -1) { + // if APN is configured + operation = androidOperationConstants["APN_OPERATION"]; + // initializing continueToCheckNextInputs to true + continueToCheckNextInputs = true; + + var apnName= $("input#apn-name").val(); + var apnProxyPort = $("input#apn-proxy-port").val(); + var apnMMSProxyPort = $("input#apn-mms-proxy-port").val(); + var apnMCC = $("input#apn-mcc").val(); + var apnMNC = $("input#apn-mnc").val(); + + if (!apnName) { + validationStatus = { + "error": true, + "subErrorMsg": "APN name is required.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } + + if (!$.isNumeric(apnProxyPort)) { + validationStatus = { + "error": true, + "subErrorMsg": "APN Proxy port requires a number input.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } else if (!inputIsValidAgainstRange(apnProxyPort, 0, 65535)) { + validationStatus = { + "error": true, + "subErrorMsg": "APN Proxy port is not within the range of valid port numbers.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } + + if (!$.isNumeric(apnMMSProxyPort)) { + validationStatus = { + "error": true, + "subErrorMsg": "APN MMS proxy port requires a number input.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } else if (!inputIsValidAgainstRange(apnMMSProxyPort, 0, 65535)) { + validationStatus = { + "error": true, + "subErrorMsg": "APN MMS proxy port is not within the range of valid port numbers.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } + + if (!$.isNumeric(apnMCC)) { + validationStatus = { + "error": true, + "subErrorMsg": "APN MCC requires a number input.", + "erroneousFeature": operation + }; + continueToCheckNextInputs = false; + } + + if (!$.isNumeric(apnMNC)) { + validationStatus = { + "error": true, + "subErrorMsg": "APN MNC requires a number input.", + "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); + } + // Validating PROXY if ($.inArray(androidOperationConstants["GLOBAL_PROXY_OPERATION_CODE"], configuredOperations) !== -1) { // if PROXY is configured diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs index ec1d532b7..f57a3bd5c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.policy-edit/public/templates/android-policy-edit.hbs @@ -75,6 +75,15 @@ + + + + + + Access Point Name + + + @@ -1635,6 +1644,321 @@ + +
+
+ +
+
+ Please note that * sign represents required fields of data. +
+
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ +
+ + +
+
+
+
+ +
+ +
+
+ +
+
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ +
+ + +
+
+
+
+ +
+ + +
+
+ +
+
+ Please note that * sign represents required fields of data. +
+
+ +
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ +
+ + +
+
+
+
+ +
@@ -2564,7 +2891,6 @@
-