getGroups(DeviceIdentifier deviceIdentifier) throws GroupManagementException {
+ if (deviceIdentifier == null) {
+ String msg = "Received empty device identifier for getGroups";
+ log.error(msg);
+ throw new GroupManagementException(msg);
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Get groups of device " + deviceIdentifier.getId());
+ }
DeviceManagementProviderService managementProviderService = new DeviceManagementProviderServiceImpl();
try {
Device device = managementProviderService.getDevice(deviceIdentifier, false);
@@ -560,11 +839,21 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
return groupDAO.getGroups(device.getId(),
PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
} catch (DeviceManagementException e) {
- throw new GroupManagementException("Error occurred while retrieving the device details.", e);
+ String msg = "Error occurred while retrieving the device details.";
+ log.error(msg, e);
+ throw new GroupManagementException(msg, e);
} catch (GroupManagementDAOException e) {
- throw new GroupManagementException("Error occurred while retrieving device groups.", e);
+ String msg = "Error occurred while retrieving device groups.";
+ log.error(msg, e);
+ throw new GroupManagementException(msg, e);
} catch (SQLException e) {
- throw new GroupManagementException("Error occurred while opening database connection.", e);
+ String msg = "Error occurred while opening database connection.";
+ log.error(msg, e);
+ throw new GroupManagementException(msg, e);
+ } catch (Exception e) {
+ String msg = "Error occurred in getGroups";
+ log.error(msg, e);
+ throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@@ -575,7 +864,9 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
*/
@Override
public DeviceGroup createDefaultGroup(String groupName) throws GroupManagementException {
-
+ if (log.isDebugEnabled()) {
+ log.debug("Create default group " + groupName);
+ }
DeviceGroup defaultGroup = this.getGroup(groupName);
if (defaultGroup == null) {
defaultGroup = new DeviceGroup(groupName);
@@ -586,10 +877,13 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
this.createGroup(defaultGroup, DeviceGroupConstants.Roles.DEFAULT_ADMIN_ROLE,
DeviceGroupConstants.Permissions.DEFAULT_ADMIN_PERMISSIONS);
} catch (GroupAlreadyExistException e) {
- if (log.isDebugEnabled()) {
- log.debug("Default group: " + defaultGroup.getName() + " already exists. Skipping group creation.",
- e);
- }
+ String msg = "Default group: " + defaultGroup.getName() + " already exists. Skipping group creation.";
+ log.error(msg, e);
+ throw new GroupManagementException(msg, e);
+ } catch (Exception e) {
+ String msg = "Error occurred in createDefaultGroup for groupName '" + groupName + "'";
+ log.error(msg, e);
+ throw new GroupManagementException(msg, e);
}
return this.getGroup(groupName);
} else {
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml
index af03f4fad96..9629cbd85a7 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml
@@ -22,7 +22,7 @@
device-mgt
org.wso2.carbon.devicemgt
- 3.0.87-SNAPSHOT
+ 3.0.90-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml
index 80c10f51cca..25ce73bbfc5 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml
@@ -22,7 +22,7 @@
device-mgt
org.wso2.carbon.devicemgt
- 3.0.87-SNAPSHOT
+ 3.0.90-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js
index 452c09f0123..bafbd11a412 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/js/listing.js
@@ -158,7 +158,7 @@ function resetPassword(username) {
domain = username.substr(0, username.indexOf('/'));
username = username.substr(username.indexOf('/') + 1);
}
- var resetPasswordServiceURL = apiBasePath + "/admin/users/" + username + "/credentials";
+ var resetPasswordServiceURL = apiBasePath + "/admin/users/" + encodeURIComponent(username) + "/credentials";
if (domain) {
resetPasswordServiceURL += '?domain=' + encodeURIComponent(domain);
}
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.default.user-menu/public/js/user-menu.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.default.user-menu/public/js/user-menu.js
index ecd93a8bc62..7ef1c320bc3 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.default.user-menu/public/js/user-menu.js
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.default.user-menu/public/js/user-menu.js
@@ -86,7 +86,9 @@ $(document).ready(function () {
$("#change-password-success-link").click(function () {
hidePopup();
});
- window.location.href = "/devicemgt/logout";
+ setTimeout(function(){
+ window.location.href = "/devicemgt/logout";
+ },10000);
}
}, function (jqXHR) {
if (jqXHR.status == 400) {
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.default.user-menu/user-menu.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.default.user-menu/user-menu.hbs
index ee2ccdc9689..7e0fac5d3e7 100644
--- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.default.user-menu/user-menu.hbs
+++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.header.default.user-menu/user-menu.hbs
@@ -104,7 +104,7 @@
- You can now try to login using your new password.
+ You will be logged out automatically, Please login using your new password.