diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java index b7fcd5f92..2349aa3ef 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementAdminServiceImpl.java @@ -1072,7 +1072,7 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe private static void validateScheduleDate(String dateString){ try { - if (dateString != null) { + if (dateString != null && !dateString.isEmpty()) { SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); sdf.setLenient(false); sdf.parse(dateString); diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/public/templates/operations.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/public/templates/operations.hbs index 0b94ae088..877ef2e47 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/public/templates/operations.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/public/templates/operations.hbs @@ -205,7 +205,7 @@ showDropdowns: true, timePickerIncrement: 1, locale: { - format: 'MM-DD-YYYY hh:mm a' + format: "YYYY-MM-DDTHH:mm:ssZZ" } }); }); @@ -222,7 +222,7 @@ showDropdowns: true, timePickerIncrement: 1, locale: { - format: 'MM-DD-YYYY hh:mm a' + format: "YYYY-MM-DDTHH:mm:ssZZ" } }); } diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-mod/public/js/operation-mod.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-mod/public/js/operation-mod.js index 369f9cbf5..4c4f57fc5 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-mod/public/js/operation-mod.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-mod/public/js/operation-mod.js @@ -80,9 +80,9 @@ var operationModule = function () { "AUTO_TIME" : "AUTO_TIME", "SET_SCREEN_CAPTURE_DISABLED" : "SET_SCREEN_CAPTURE_DISABLED", "SET_STATUS_BAR_DISABLED" : "SET_STATUS_BAR_DISABLED", - "APPLICATION_OPERATION_CODE":"APP-RESTRICTION", - "SYSTEM_UPDATE_POLICY_CODE": "SYSTEM_UPDATE_POLICY", - "KIOSK_APPS_CODE": "KIOSK_APPS" + "APPLICATION_OPERATION_CODE" : "APP-RESTRICTION", + "SYSTEM_UPDATE_POLICY_CODE" : "SYSTEM_UPDATE_POLICY", + "KIOSK_APPS_CODE" : "KIOSK_APPS" }; // Constants to define Windows Operation Constants @@ -151,8 +151,10 @@ var operationModule = function () { break; case iosOperationConstants["DOMAIN_OPERATION_CODE"]: payload = { - "emailDomains": operationPayload["emailDomains"], - "webDomains": operationPayload["webDomains"] + "operation": { + "emailDomains": operationData["emailDomains"], + "webDomains": operationData["webDomains"] + } }; break; case iosOperationConstants["RESTRICTIONS_OPERATION_CODE"]: @@ -335,31 +337,31 @@ var operationModule = function () { break; case iosOperationConstants["EMAIL_OPERATION_CODE"]: payload = { - "emailAccountDescription": operationPayload["emailAccountDescription"], - "emailAccountName": operationPayload["emailAccountName"], - "emailAccountType": operationPayload["emailAccountType"], - "emailAddress": operationPayload["emailAddress"], - "emailIncomingMailServerAuthentication": operationPayload["incomingMailServerAuthentication"], - "emailIncomingMailServerHostname": operationPayload["incomingMailServerHostName"], - "emailIncomingMailServerPort": operationPayload["incomingMailServerPortNumber"], - "emailIncomingUseSSL": operationPayload["incomingMailServerUseSSL"], - "emailIncomingMailServerUsername": operationPayload["incomingMailServerUsername"], - "emailIncomingMailServerPassword": operationPayload["incomingPassword"], - "emailOutgoingMailServerPassword": operationPayload["outgoingPassword"], - "emailOutgoingPasswordSameAsIncomingPassword": operationPayload["outgoingPasswordSameAsIncomingPassword"], - "emailOutgoingMailServerAuthentication": operationPayload["outgoingMailServerAuthentication"], - "emailOutgoingMailServerHostname": operationPayload["outgoingMailServerHostName"], - "emailOutgoingMailServerPort": operationPayload["outgoingMailServerPortNumber"], - "emailOutgoingUseSSL": operationPayload["outgoingMailServerUseSSL"], - "emailOutgoingMailServerUsername": operationPayload["outgoingMailServerUsername"], - "emailPreventMove": operationPayload["preventMove"], - "emailPreventAppSheet": operationPayload["preventAppSheet"], - "emailDisableMailRecentsSyncing": operationPayload["disableMailRecentsSyncing"], - "emailIncomingMailServerIMAPPathPrefix": operationPayload["incomingMailServerIMAPPathPrefix"], - "emailSMIMEEnabled": operationPayload["smimeenabled"], - "emailSMIMESigningCertificateUUID": operationPayload["smimesigningCertificateUUID"], - "emailSMIMEEncryptionCertificateUUID": operationPayload["smimeencryptionCertificateUUID"], - "emailSMIMEEnablePerMessageSwitch": operationPayload["smimeenablePerMessageSwitch"] + "emailAccountDescription": operationPayload["emailAccountDescription"], + "emailAccountName": operationPayload["emailAccountName"], + "emailAccountType": operationPayload["emailAccountType"], + "emailAddress": operationPayload["emailAddress"], + "emailIncomingMailServerAuthentication": operationPayload["incomingMailServerAuthentication"], + "emailIncomingMailServerHostname": operationPayload["incomingMailServerHostName"], + "emailIncomingMailServerPort": operationPayload["incomingMailServerPortNumber"], + "emailIncomingUseSSL": operationPayload["incomingMailServerUseSSL"], + "emailIncomingMailServerUsername": operationPayload["incomingMailServerUsername"], + "emailIncomingMailServerPassword": operationPayload["incomingPassword"], + "emailOutgoingMailServerPassword": operationPayload["outgoingPassword"], + "emailOutgoingPasswordSameAsIncomingPassword": operationPayload["outgoingPasswordSameAsIncomingPassword"], + "emailOutgoingMailServerAuthentication": operationPayload["outgoingMailServerAuthentication"], + "emailOutgoingMailServerHostname": operationPayload["outgoingMailServerHostName"], + "emailOutgoingMailServerPort": operationPayload["outgoingMailServerPortNumber"], + "emailOutgoingUseSSL": operationPayload["outgoingMailServerUseSSL"], + "emailOutgoingMailServerUsername": operationPayload["outgoingMailServerUsername"], + "emailPreventMove": operationPayload["preventMove"], + "emailPreventAppSheet": operationPayload["preventAppSheet"], + "emailDisableMailRecentsSyncing": operationPayload["disableMailRecentsSyncing"], + "emailIncomingMailServerIMAPPathPrefix": operationPayload["incomingMailServerIMAPPathPrefix"], + "emailSMIMEEnabled": operationPayload["smimeenabled"], + "emailSMIMESigningCertificateUUID": operationPayload["smimesigningCertificateUUID"], + "emailSMIMEEncryptionCertificateUUID": operationPayload["smimeencryptionCertificateUUID"], + "emailSMIMEEnablePerMessageSwitch": operationPayload["smimeenablePerMessageSwitch"] }; break; case iosOperationConstants["AIRPLAY_OPERATION_CODE"]: @@ -439,7 +441,7 @@ var operationModule = function () { break; case iosOperationConstants["WIFI_OPERATION_CODE"]: operationType = operationTypeConstants["PROFILE"]; - if(operationData["wifiProxyPort"] == ""){ + if (operationData["wifiProxyPort"] == "") { operationData["wifiProxyPort"] = -1; } payload = { @@ -511,35 +513,35 @@ var operationModule = function () { }; } else if (operationData["vpnType"] == "IPSec") { ipSec = { - "remoteAddress" : operationData["ipsecRemoteAddress"], - "authenticationMethod" : operationData["ipsecAuthenticationMethod"], - "localIdentifier" : operationData["ipsecLocalIdentifier"], - "sharedSecret" : operationData["ipsecSharedSecret"], - "payloadCertificateUUID" : operationData["ipsecPayloadCertificateUUID"], - "XAuthEnabled" : operationData["ipsecXAuthEnabled"], - "XAuthName" : operationData["ipsecXAuthName"], - "promptForVPNPIN" : operationData["ipsecPromptForVPNPIN"] + "remoteAddress": operationData["ipsecRemoteAddress"], + "authenticationMethod": operationData["ipsecAuthenticationMethod"], + "localIdentifier": operationData["ipsecLocalIdentifier"], + "sharedSecret": operationData["ipsecSharedSecret"], + "payloadCertificateUUID": operationData["ipsecPayloadCertificateUUID"], + "XAuthEnabled": operationData["ipsecXAuthEnabled"], + "XAuthName": operationData["ipsecXAuthName"], + "promptForVPNPIN": operationData["ipsecPromptForVPNPIN"] }; } else if (operationData["vpnType"] == "IKEv2") { ikev2 = { - "remoteAddress" : operationData["ikev2RemoteAddress"], - "localIdentifier" : operationData["ikev2LocalIdentifier"], - "remoteIdentifier" : operationData["ikev2RemoteIdentifier"], - "authenticationMethod" : operationData["ikev2AuthenticationMethod"], - "sharedSecret" : operationData["ikev2SharedSecret"], - "payloadCertificateUUID" : operationData["ikev2PayloadCertificateUUID"], - "extendedAuthEnabled" : operationData["ikev2ExtendedAuthEnabled"], - "authName" : operationData["ikev2AuthName"], - "authPassword" : operationData["ikev2AuthPassword"], - "deadPeerDetectionInterval" : operationData["ikev2DeadPeerDetectionInterval"], - "serverCertificateIssuerCommonName" : operationData["ikev2ServerCertificateIssuerCommonName"], - "serverCertificateCommonName" : operationData["ikev2ServerCertificateCommonName"] + "remoteAddress": operationData["ikev2RemoteAddress"], + "localIdentifier": operationData["ikev2LocalIdentifier"], + "remoteIdentifier": operationData["ikev2RemoteIdentifier"], + "authenticationMethod": operationData["ikev2AuthenticationMethod"], + "sharedSecret": operationData["ikev2SharedSecret"], + "payloadCertificateUUID": operationData["ikev2PayloadCertificateUUID"], + "extendedAuthEnabled": operationData["ikev2ExtendedAuthEnabled"], + "authName": operationData["ikev2AuthName"], + "authPassword": operationData["ikev2AuthPassword"], + "deadPeerDetectionInterval": operationData["ikev2DeadPeerDetectionInterval"], + "serverCertificateIssuerCommonName": operationData["ikev2ServerCertificateIssuerCommonName"], + "serverCertificateCommonName": operationData["ikev2ServerCertificateCommonName"] }; } else if (operationData["vpnType"] == "PulseSecure") { pulseSecure = { - "remoteAddress" : operationData["pulsesecureRemoteAddress"], - "userName" : operationData["pulsesecureName"], - "sharedSecret" : operationData["pulsesecureSharedSecret"] + "remoteAddress": operationData["pulsesecureRemoteAddress"], + "userName": operationData["pulsesecureName"], + "sharedSecret": operationData["pulsesecureSharedSecret"] }; } @@ -566,13 +568,13 @@ var operationModule = function () { "onDemandMatchDomainsAlways": domainsAlways, "onDemandMatchDomainsNever": domainsNever, "onDemandMatchDomainsOnRetry": domainsRetry, - "onDemandRules" : operationData["onDemandRules"], - "vendorConfigs" : operationData["vendorConfigs"], - "vpnType" : operationData["vpnType"], + "onDemandRules": operationData["onDemandRules"], + "vendorConfigs": operationData["vendorConfigs"], + "vpnType": operationData["vpnType"], "ppp": ppp, "ipSec": ipSec, "ikEv2": ikev2, - "pulseSecure" : pulseSecure + "pulseSecure": pulseSecure } }; break; @@ -762,11 +764,15 @@ var operationModule = function () { case iosOperationConstants["DOMAIN_OPERATION_CODE"]: operationType = operationTypeConstants["PROFILE"]; payload = { - "emailDomains": operationData["emailDomains"], - "webDomains": operationData["webDomains"] + "operation": { + "emailDomains": operationData["emailDomains"], + "webDomains": operationData["webDomains"] + } }; break; - case iosOperationConstants["CELLULAR_OPERATION_CODE"]: + case + iosOperationConstants["CELLULAR_OPERATION_CODE"] + : operationType = operationTypeConstants["PROFILE"]; payload = { "operation": { @@ -778,7 +784,9 @@ var operationModule = function () { } }; break; - case iosOperationConstants["NOTIFICATION_OPERATION_CODE"]: + case + iosOperationConstants["NOTIFICATION_OPERATION_CODE"] + : operationType = operationTypeConstants["PROFILE"]; payload = { "operation": { @@ -798,7 +806,8 @@ var operationModule = function () { payload["deviceIDs"] = deviceList; } return payload; - }; + } + ; /** * Convert the android platform specific code to the generic payload. @@ -840,8 +849,8 @@ var operationModule = function () { "wifiProvisioning": operationPayload["provisioning"], "wifiIdentity": operationPayload["identity"], "wifiAnoIdentity": operationPayload["anonymousIdentity"], - "wifiCaCert" : operationPayload["cacert"], - "wifiCaCertName" : operationPayload["cacertName"] + "wifiCaCert": operationPayload["cacert"], + "wifiCaCertName": operationPayload["cacertName"] }; break; case androidOperationConstants["VPN_OPERATION_CODE"]: @@ -888,40 +897,40 @@ var operationModule = function () { operationType = operationTypeConstants["PROFILE"]; payload = { "operation": { - "CAMERA" : operationData["cameraEnabled"], - "DISALLOW_ADJUST_VOLUME" : operationData["disallowAdjustVolumeEnabled"], - "DISALLOW_CONFIG_BLUETOOTH" : operationData["disallowConfigBluetooth"], - "DISALLOW_CONFIG_CELL_BROADCASTS" : operationData["disallowConfigCellBroadcasts"], - "DISALLOW_CONFIG_CREDENTIALS" : operationData["disallowConfigCredentials"], - "DISALLOW_CONFIG_MOBILE_NETWORKS" : operationData["disallowConfigMobileNetworks"], - "DISALLOW_CONFIG_TETHERING" : operationData["disallowConfigTethering"], - "DISALLOW_CONFIG_VPN" : operationData["disallowConfigVpn"], - "DISALLOW_CONFIG_WIFI" : operationData["disallowConfigWifi"], - "DISALLOW_APPS_CONTROL" : operationData["disallowAppControl"], - "DISALLOW_CREATE_WINDOWS" : operationData["disallowCreateWindows"], - "DISALLOW_CROSS_PROFILE_COPY_PASTE" : operationData["disallowCrossProfileCopyPaste"], - "DISALLOW_DEBUGGING_FEATURES" : operationData["disallowDebugging"], - "DISALLOW_FACTORY_RESET" : operationData["disallowFactoryReset"], - "DISALLOW_ADD_USER" : operationData["disallowAddUser"], - "DISALLOW_INSTALL_APPS" : operationData["disallowInstallApps"], - "DISALLOW_INSTALL_UNKNOWN_SOURCES" : operationData["disallowInstallUnknownSources"], - "DISALLOW_MODIFY_ACCOUNTS" : operationData["disallowModifyAccounts"], - "DISALLOW_MOUNT_PHYSICAL_MEDIA" : operationData["disallowMountPhysicalMedia"], - "DISALLOW_NETWORK_RESET" : operationData["disallowNetworkReset"], - "DISALLOW_OUTGOING_BEAM" : operationData["disallowOutgoingBeam"], - "DISALLOW_OUTGOING_CALLS" : operationData["disallowOutgoingCalls"], - "DISALLOW_REMOVE_USER" : operationData["disallowRemoveUser"], - "DISALLOW_SAFE_BOOT" : operationData["disallowSafeBoot"], - "DISALLOW_SHARE_LOCATION" : operationData["disallowLocationSharing"], - "DISALLOW_SMS" : operationData["disallowSMS"], - "DISALLOW_UNINSTALL_APPS" : operationData["disallowUninstallApps"], - "DISALLOW_UNMUTE_MICROPHONE" : operationData["disallowUnmuteMicrophone"], - "DISALLOW_USB_FILE_TRANSFER" : operationData["disallowUSBFileTransfer"], - "ALLOW_PARENT_PROFILE_APP_LINKING" : operationData["disallowParentProfileAppLinking"], - "ENSURE_VERIFY_APPS" : operationData["ensureVerifyApps"], - "AUTO_TIME" : operationData["enableAutoTime"], - "SET_SCREEN_CAPTURE_DISABLED" : operationData["disableScreenCapture"], - "SET_STATUS_BAR_DISABLED" : operationData["disableStatusBar"] + "CAMERA": operationData["cameraEnabled"], + "DISALLOW_ADJUST_VOLUME": operationData["disallowAdjustVolumeEnabled"], + "DISALLOW_CONFIG_BLUETOOTH": operationData["disallowConfigBluetooth"], + "DISALLOW_CONFIG_CELL_BROADCASTS": operationData["disallowConfigCellBroadcasts"], + "DISALLOW_CONFIG_CREDENTIALS": operationData["disallowConfigCredentials"], + "DISALLOW_CONFIG_MOBILE_NETWORKS": operationData["disallowConfigMobileNetworks"], + "DISALLOW_CONFIG_TETHERING": operationData["disallowConfigTethering"], + "DISALLOW_CONFIG_VPN": operationData["disallowConfigVpn"], + "DISALLOW_CONFIG_WIFI": operationData["disallowConfigWifi"], + "DISALLOW_APPS_CONTROL": operationData["disallowAppControl"], + "DISALLOW_CREATE_WINDOWS": operationData["disallowCreateWindows"], + "DISALLOW_CROSS_PROFILE_COPY_PASTE": operationData["disallowCrossProfileCopyPaste"], + "DISALLOW_DEBUGGING_FEATURES": operationData["disallowDebugging"], + "DISALLOW_FACTORY_RESET": operationData["disallowFactoryReset"], + "DISALLOW_ADD_USER": operationData["disallowAddUser"], + "DISALLOW_INSTALL_APPS": operationData["disallowInstallApps"], + "DISALLOW_INSTALL_UNKNOWN_SOURCES": operationData["disallowInstallUnknownSources"], + "DISALLOW_MODIFY_ACCOUNTS": operationData["disallowModifyAccounts"], + "DISALLOW_MOUNT_PHYSICAL_MEDIA": operationData["disallowMountPhysicalMedia"], + "DISALLOW_NETWORK_RESET": operationData["disallowNetworkReset"], + "DISALLOW_OUTGOING_BEAM": operationData["disallowOutgoingBeam"], + "DISALLOW_OUTGOING_CALLS": operationData["disallowOutgoingCalls"], + "DISALLOW_REMOVE_USER": operationData["disallowRemoveUser"], + "DISALLOW_SAFE_BOOT": operationData["disallowSafeBoot"], + "DISALLOW_SHARE_LOCATION": operationData["disallowLocationSharing"], + "DISALLOW_SMS": operationData["disallowSMS"], + "DISALLOW_UNINSTALL_APPS": operationData["disallowUninstallApps"], + "DISALLOW_UNMUTE_MICROPHONE": operationData["disallowUnmuteMicrophone"], + "DISALLOW_USB_FILE_TRANSFER": operationData["disallowUSBFileTransfer"], + "ALLOW_PARENT_PROFILE_APP_LINKING": operationData["disallowParentProfileAppLinking"], + "ENSURE_VERIFY_APPS": operationData["ensureVerifyApps"], + "AUTO_TIME": operationData["enableAutoTime"], + "SET_SCREEN_CAPTURE_DISABLED": operationData["disableScreenCapture"], + "SET_STATUS_BAR_DISABLED": operationData["disableStatusBar"] } }; break; @@ -929,7 +938,7 @@ var operationModule = function () { operationType = operationTypeConstants["PROFILE"]; payload = { "operation": { - "lockCode" : operationData["lockCode"] + "lockCode": operationData["lockCode"] } }; break; @@ -937,7 +946,7 @@ var operationModule = function () { operationType = operationTypeConstants["PROFILE"]; payload = { "operation": { - "encrypted" : operationData["encryptStorageEnabled"] + "encrypted": operationData["encryptStorageEnabled"] } }; break; @@ -955,8 +964,8 @@ var operationModule = function () { operationType = operationTypeConstants["PROFILE"]; payload = { "operation": { - "schedule" : operationData["schedule"], - "server" : operationData["server"] + "schedule": operationData["schedule"], + "server": operationData["server"] } }; break; @@ -964,7 +973,7 @@ var operationModule = function () { operationType = operationTypeConstants["PROFILE"]; payload = { "operation": { - "pin" : operationData["pin"] + "pin": operationData["pin"] } }; break; @@ -973,15 +982,15 @@ var operationModule = function () { payload = { "operation": { "ssid": operationData["wifiSSID"], - "type": operationData["wifiType"], - "password" : operationData["wifiPassword"], - "eap" : operationData["wifiEAP"], - "phase2" : operationData["wifiPhase2"], - "provisioning" : operationData["wifiProvisioning"], - "identity" : operationData["wifiIdentity"], - "anonymousIdentity" : operationData["wifiAnoIdentity"], - "cacert" : operationData["wifiCaCert"], - "cacertName" : operationData["wifiCaCertName"] + "type": operationData["wifiType"], + "password": operationData["wifiPassword"], + "eap": operationData["wifiEAP"], + "phase2": operationData["wifiPhase2"], + "provisioning": operationData["wifiProvisioning"], + "identity": operationData["wifiIdentity"], + "anonymousIdentity": operationData["wifiAnoIdentity"], + "cacert": operationData["wifiCaCert"], + "cacertName": operationData["wifiCaCertName"] } }; break; @@ -1000,8 +1009,8 @@ var operationModule = function () { operationType = operationTypeConstants["PROFILE"]; payload = { "operation": { - "message" : operationData["lock-message"], - "isHardLockEnabled" : operationData["hard-lock"] + "message": operationData["lock-message"], + "isHardLockEnabled": operationData["hard-lock"] } }; break; @@ -1152,7 +1161,7 @@ var operationModule = function () { operationType = operationTypeConstants["PROFILE"]; payload = { "operation": { - "enabled" : operationData["cameraEnabled"] + "enabled": operationData["cameraEnabled"] } }; break; @@ -1160,7 +1169,7 @@ var operationModule = function () { operationType = operationTypeConstants["PROFILE"]; payload = { "operation": { - "lockCode" : operationData["lockCode"] + "lockCode": operationData["lockCode"] } }; break; @@ -1168,7 +1177,7 @@ var operationModule = function () { operationType = operationTypeConstants["PROFILE"]; payload = { "operation": { - "encrypted" : operationData["encryptStorageEnabled"] + "encrypted": operationData["encryptStorageEnabled"] } }; break; @@ -1176,7 +1185,7 @@ var operationModule = function () { operationType = operationTypeConstants["PROFILE"]; payload = { "operation": { - "message" : operationData["message"] + "message": operationData["message"] } }; break; @@ -1283,7 +1292,9 @@ var operationModule = function () { */ $.fn.filterByData = function (prop, val) { return this.filter( - function () {return $(this).data(prop) == val;} + function () { + return $(this).data(prop) == val; + } ); }; @@ -1604,18 +1615,18 @@ var operationModule = function () { var operationCode = operationCodes[i]; var payload = publicMethods.generatePayload(platformType, operationCode, null); - if(platformType == platformTypeConstants["ANDROID"] && - operationCodes[i] == androidOperationConstants["CAMERA_OPERATION_CODE"]){ + if (platformType == platformTypeConstants["ANDROID"] && + operationCodes[i] == androidOperationConstants["CAMERA_OPERATION_CODE"]) { var operations = payload["operation"]; - for (var key in operations){ + for (var key in operations) { operationCode = key; var restriction = false; - if(operations[key]){ + if (operations[key]) { restriction = true; } var payloadResult = { "operation": { - "enabled" : restriction + "enabled": restriction } }; generatedProfile[operationCode] = payloadResult["operation"]; @@ -1643,108 +1654,108 @@ var operationModule = function () { var configuredFeature = payload[i]; var featureCode = configuredFeature["featureCode"]; var operationPayload = configuredFeature["content"]; - if(platformType == platformTypeConstants["ANDROID"]){ - var restriction = JSON.parse(operationPayload); - if(featureCode == androidOperationConstants["CAMERA_OPERATION_CODE"]){ + if (platformType == platformTypeConstants["ANDROID"]) { + var restriction = JSON.parse(operationPayload); + if (featureCode == androidOperationConstants["CAMERA_OPERATION_CODE"]) { restrictions["cameraEnabled"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_ADJUST_VOLUME"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_ADJUST_VOLUME"]) { restrictions["disallowAdjustVolumeEnabled"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_BLUETOOTH"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_BLUETOOTH"]) { restrictions["disallowConfigBluetooth"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_CELL_BROADCASTS"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_CELL_BROADCASTS"]) { restrictions["disallowConfigCellBroadcasts"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_CREDENTIALS"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_CREDENTIALS"]) { restrictions["disallowConfigCredentials"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_MOBILE_NETWORKS"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_MOBILE_NETWORKS"]) { restrictions["disallowConfigMobileNetworks"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_TETHERING"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_TETHERING"]) { restrictions["disallowConfigTethering"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_VPN"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_VPN"]) { restrictions["disallowConfigVpn"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_WIFI"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_CONFIG_WIFI"]) { restrictions["disallowConfigWifi"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_APPS_CONTROL"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_APPS_CONTROL"]) { restrictions["disallowAppControl"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_CREATE_WINDOWS"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_CREATE_WINDOWS"]) { restrictions["disallowCreateWindows"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_CROSS_PROFILE_COPY_PASTE"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_CROSS_PROFILE_COPY_PASTE"]) { restrictions["disallowCrossProfileCopyPaste"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_DEBUGGING_FEATURES"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_DEBUGGING_FEATURES"]) { restrictions["disallowDebugging"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_FACTORY_RESET"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_FACTORY_RESET"]) { restrictions["disallowFactoryReset"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_ADD_USER"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_ADD_USER"]) { restrictions["disallowAddUser"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_INSTALL_APPS"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_INSTALL_APPS"]) { restrictions["disallowInstallApps"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_INSTALL_UNKNOWN_SOURCES"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_INSTALL_UNKNOWN_SOURCES"]) { restrictions["disallowInstallUnknownSources"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_MODIFY_ACCOUNTS"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_MODIFY_ACCOUNTS"]) { restrictions["disallowModifyAccounts"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_MOUNT_PHYSICAL_MEDIA"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_MOUNT_PHYSICAL_MEDIA"]) { restrictions["disallowMountPhysicalMedia"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_NETWORK_RESET"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_NETWORK_RESET"]) { restrictions["disallowNetworkReset"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_OUTGOING_BEAM"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_OUTGOING_BEAM"]) { restrictions["disallowOutgoingBeam"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_OUTGOING_CALLS"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_OUTGOING_CALLS"]) { restrictions["disallowOutgoingCalls"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_REMOVE_USER"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_REMOVE_USER"]) { restrictions["disallowRemoveUser"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_SAFE_BOOT"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_SAFE_BOOT"]) { restrictions["disallowSafeBoot"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_SHARE_LOCATION"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_SHARE_LOCATION"]) { restrictions["disallowLocationSharing"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_SMS"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_SMS"]) { restrictions["disallowSMS"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_UNINSTALL_APPS"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_UNINSTALL_APPS"]) { restrictions["disallowUninstallApps"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_UNMUTE_MICROPHONE"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_UNMUTE_MICROPHONE"]) { restrictions["disallowUnmuteMicrophone"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["DISALLOW_USB_FILE_TRANSFER"]){ + } else if (featureCode == androidOperationConstants["DISALLOW_USB_FILE_TRANSFER"]) { restrictions["disallowUSBFileTransfer"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["ALLOW_PARENT_PROFILE_APP_LINKING"]){ + } else if (featureCode == androidOperationConstants["ALLOW_PARENT_PROFILE_APP_LINKING"]) { restrictions["disallowParentProfileAppLinking"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["ENSURE_VERIFY_APPS"]){ + } else if (featureCode == androidOperationConstants["ENSURE_VERIFY_APPS"]) { restrictions["ensureVerifyApps"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["AUTO_TIME"]){ + } else if (featureCode == androidOperationConstants["AUTO_TIME"]) { restrictions["enableAutoTime"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["SET_SCREEN_CAPTURE_DISABLED"]){ + } else if (featureCode == androidOperationConstants["SET_SCREEN_CAPTURE_DISABLED"]) { restrictions["disableScreenCapture"] = restriction["enabled"]; continue; - } else if (featureCode == androidOperationConstants["SET_STATUS_BAR_DISABLED"]){ + } else if (featureCode == androidOperationConstants["SET_STATUS_BAR_DISABLED"]) { restrictions["disableStatusBar"] = restriction["enabled"]; continue; } diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/public/js/device-detail.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/public/js/device-detail.js index ddc267e1c..1107b513d 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/public/js/device-detail.js +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/public/js/device-detail.js @@ -85,6 +85,7 @@ var InitiateViewOption = null; } function loadOperationsLog(update) { + var owner = $("#device-owner").data("owner"); var operationsLogTable = "#operations-log-table"; if (update) { operationTable = $(operationsLogTable).DataTable(); @@ -100,7 +101,7 @@ var InitiateViewOption = null; order: [], ajax: { url: "/emm/api/operation/paginate", - data: {deviceId : deviceIdentifier, deviceType: deviceType}, + data: {deviceId : deviceIdentifier, deviceType: deviceType ,owner:owner }, dataSrc: function (json) { $("#operations-spinner").addClass("hidden"); $("#operations-log-container").empty(); diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.hbs index 7f0bac0b9..b5c1287dd 100644 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.hbs +++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.view/view.hbs @@ -16,7 +16,7 @@ {{/if}}