...
|
...
|
@@ -15,6 +15,7 @@ |
15
|
15
|
*/
|
16
|
16
|
package org.thingsboard.server.controller;
|
17
|
17
|
|
|
18
|
+import com.fasterxml.jackson.databind.node.ObjectNode;
|
18
|
19
|
import org.springframework.beans.factory.annotation.Autowired;
|
19
|
20
|
import org.springframework.security.access.prepost.PreAuthorize;
|
20
|
21
|
import org.springframework.web.bind.annotation.PathVariable;
|
...
|
...
|
@@ -59,7 +60,11 @@ public class AdminController extends BaseController { |
59
|
60
|
public AdminSettings getAdminSettings(@PathVariable("key") String key) throws ThingsboardException {
|
60
|
61
|
try {
|
61
|
62
|
accessControlService.checkPermission(getCurrentUser(), Resource.ADMIN_SETTINGS, Operation.READ);
|
62
|
|
- return checkNotNull(adminSettingsService.findAdminSettingsByKey(TenantId.SYS_TENANT_ID, key));
|
|
63
|
+ AdminSettings adminSettings = checkNotNull(adminSettingsService.findAdminSettingsByKey(TenantId.SYS_TENANT_ID, key));
|
|
64
|
+ if (adminSettings.getKey().equals("mail")) {
|
|
65
|
+ ((ObjectNode) adminSettings.getJsonValue()).put("password", "");
|
|
66
|
+ }
|
|
67
|
+ return adminSettings;
|
63
|
68
|
} catch (Exception e) {
|
64
|
69
|
throw handleException(e);
|
65
|
70
|
}
|
...
|
...
|
@@ -74,6 +79,7 @@ public class AdminController extends BaseController { |
74
|
79
|
adminSettings = checkNotNull(adminSettingsService.saveAdminSettings(TenantId.SYS_TENANT_ID, adminSettings));
|
75
|
80
|
if (adminSettings.getKey().equals("mail")) {
|
76
|
81
|
mailService.updateMailConfiguration();
|
|
82
|
+ ((ObjectNode) adminSettings.getJsonValue()).put("password", "");
|
77
|
83
|
}
|
78
|
84
|
return adminSettings;
|
79
|
85
|
} catch (Exception e) {
|
...
|
...
|
|