|
55 | 55 | import com.cloud.api.commands.DeleteVlanIpRangeCmd; |
56 | 56 | import com.cloud.api.commands.DeleteZoneCmd; |
57 | 57 | import com.cloud.api.commands.LDAPConfigCmd; |
| 58 | +import com.cloud.api.commands.LDAPRemoveCmd; |
58 | 59 | import com.cloud.api.commands.ListNetworkOfferingsCmd; |
59 | 60 | import com.cloud.api.commands.UpdateCfgCmd; |
60 | 61 | import com.cloud.api.commands.UpdateDiskOfferingCmd; |
@@ -1239,6 +1240,21 @@ public boolean deleteZone(DeleteZoneCmd cmd) { |
1239 | 1240 |
|
1240 | 1241 | } |
1241 | 1242 |
|
| 1243 | + @Override |
| 1244 | + @DB |
| 1245 | + public boolean removeLDAP(LDAPRemoveCmd cmd) { |
| 1246 | + _configDao.expunge(LDAPParams.hostname.toString()); |
| 1247 | + _configDao.expunge(LDAPParams.port.toString()); |
| 1248 | + _configDao.expunge(LDAPParams.queryfilter.toString()); |
| 1249 | + _configDao.expunge(LDAPParams.searchbase.toString()); |
| 1250 | + _configDao.expunge(LDAPParams.usessl.toString()); |
| 1251 | + _configDao.expunge(LDAPParams.dn.toString()); |
| 1252 | + _configDao.expunge(LDAPParams.passwd.toString()); |
| 1253 | + _configDao.expunge(LDAPParams.truststore.toString()); |
| 1254 | + _configDao.expunge(LDAPParams.truststorepass.toString()); |
| 1255 | + return true; |
| 1256 | + } |
| 1257 | + |
1242 | 1258 | @Override |
1243 | 1259 | @DB |
1244 | 1260 | public boolean updateLDAP(LDAPConfigCmd cmd) { |
@@ -1284,65 +1300,65 @@ public boolean updateLDAP(LDAPConfigCmd cmd) { |
1284 | 1300 | // store the result in DB COnfiguration |
1285 | 1301 | ConfigurationVO cvo = _configDao.findByName(LDAPParams.hostname.toString()); |
1286 | 1302 | if (cvo == null) { |
1287 | | - cvo = new ConfigurationVO("Advanced", "DEFAULT", "management-server", LDAPParams.hostname.toString(), null, "Hostname or ip address of the ldap server eg: my.ldap.com"); |
| 1303 | + cvo = new ConfigurationVO("Hidden", "DEFAULT", "management-server", LDAPParams.hostname.toString(), null, "Hostname or ip address of the ldap server eg: my.ldap.com"); |
1288 | 1304 | } |
1289 | 1305 | cvo.setValue(hostname); |
1290 | 1306 | _configDao.persist(cvo); |
1291 | 1307 |
|
1292 | 1308 | cvo = _configDao.findByName(LDAPParams.port.toString()); |
1293 | 1309 | if (cvo == null) { |
1294 | | - cvo = new ConfigurationVO("Advanced", "DEFAULT", "management-server", LDAPParams.port.toString(), null, "Specify the LDAP port if required, default is 389"); |
| 1310 | + cvo = new ConfigurationVO("Hidden", "DEFAULT", "management-server", LDAPParams.port.toString(), null, "Specify the LDAP port if required, default is 389"); |
1295 | 1311 | } |
1296 | 1312 | cvo.setValue(port.toString()); |
1297 | 1313 | _configDao.persist(cvo); |
1298 | 1314 |
|
1299 | 1315 | cvo = _configDao.findByName(LDAPParams.queryfilter.toString()); |
1300 | 1316 | if (cvo == null) { |
1301 | | - cvo = new ConfigurationVO("Advanced", "DEFAULT", "management-server", LDAPParams.queryfilter.toString(), null, |
| 1317 | + cvo = new ConfigurationVO("Hidden", "DEFAULT", "management-server", LDAPParams.queryfilter.toString(), null, |
1302 | 1318 | "You specify a query filter here, which narrows down the users, who can be part of this domain"); |
1303 | 1319 | } |
1304 | 1320 | cvo.setValue(queryFilter); |
1305 | 1321 | _configDao.persist(cvo); |
1306 | 1322 |
|
1307 | 1323 | cvo = _configDao.findByName(LDAPParams.searchbase.toString()); |
1308 | 1324 | if (cvo == null) { |
1309 | | - cvo = new ConfigurationVO("Advanced", "DEFAULT", "management-server", LDAPParams.searchbase.toString(), null, |
| 1325 | + cvo = new ConfigurationVO("Hidden", "DEFAULT", "management-server", LDAPParams.searchbase.toString(), null, |
1310 | 1326 | "The search base defines the starting point for the search in the directory tree Example: dc=cloud,dc=com."); |
1311 | 1327 | } |
1312 | 1328 | cvo.setValue(searchBase); |
1313 | 1329 | _configDao.persist(cvo); |
1314 | 1330 |
|
1315 | 1331 | cvo = _configDao.findByName(LDAPParams.usessl.toString()); |
1316 | 1332 | if (cvo == null) { |
1317 | | - cvo = new ConfigurationVO("Advanced", "DEFAULT", "management-server", LDAPParams.usessl.toString(), null, "Check Use SSL if the external LDAP server is configured for LDAP over SSL."); |
| 1333 | + cvo = new ConfigurationVO("Hidden", "DEFAULT", "management-server", LDAPParams.usessl.toString(), null, "Check Use SSL if the external LDAP server is configured for LDAP over SSL."); |
1318 | 1334 | } |
1319 | 1335 | cvo.setValue(useSSL.toString()); |
1320 | 1336 | _configDao.persist(cvo); |
1321 | 1337 |
|
1322 | 1338 | cvo = _configDao.findByName(LDAPParams.dn.toString()); |
1323 | 1339 | if (cvo == null) { |
1324 | | - cvo = new ConfigurationVO("Advanced", "DEFAULT", "management-server", LDAPParams.dn.toString(), null, "Specify the distinguished name of a user with the search permission on the directory"); |
| 1340 | + cvo = new ConfigurationVO("Hidden", "DEFAULT", "management-server", LDAPParams.dn.toString(), null, "Specify the distinguished name of a user with the search permission on the directory"); |
1325 | 1341 | } |
1326 | 1342 | cvo.setValue(bindDN); |
1327 | 1343 | _configDao.persist(cvo); |
1328 | 1344 |
|
1329 | 1345 | cvo = _configDao.findByName(LDAPParams.passwd.toString()); |
1330 | 1346 | if (cvo == null) { |
1331 | | - cvo = new ConfigurationVO("Advanced", "DEFAULT", "management-server", LDAPParams.passwd.toString(), null, "Enter the password"); |
| 1347 | + cvo = new ConfigurationVO("Hidden", "DEFAULT", "management-server", LDAPParams.passwd.toString(), null, "Enter the password"); |
1332 | 1348 | } |
1333 | 1349 | cvo.setValue(DBEncryptionUtil.encrypt(bindPasswd)); |
1334 | 1350 | _configDao.persist(cvo); |
1335 | 1351 |
|
1336 | 1352 | cvo = _configDao.findByName(LDAPParams.truststore.toString()); |
1337 | 1353 | if (cvo == null) { |
1338 | | - cvo = new ConfigurationVO("Advanced", "DEFAULT", "management-server", LDAPParams.truststore.toString(), null, "Enter the path to trusted keystore"); |
| 1354 | + cvo = new ConfigurationVO("Hidden", "DEFAULT", "management-server", LDAPParams.truststore.toString(), null, "Enter the path to trusted keystore"); |
1339 | 1355 | } |
1340 | 1356 | cvo.setValue(trustStore); |
1341 | 1357 | _configDao.persist(cvo); |
1342 | 1358 |
|
1343 | 1359 | cvo = _configDao.findByName(LDAPParams.truststorepass.toString()); |
1344 | 1360 | if (cvo == null) { |
1345 | | - cvo = new ConfigurationVO("Advanced", "DEFAULT", "management-server", LDAPParams.truststorepass.toString(), null, "Enter the password for trusted keystore"); |
| 1361 | + cvo = new ConfigurationVO("Hidden", "DEFAULT", "management-server", LDAPParams.truststorepass.toString(), null, "Enter the password for trusted keystore"); |
1346 | 1362 | } |
1347 | 1363 | cvo.setValue(DBEncryptionUtil.encrypt(trustStorePassword)); |
1348 | 1364 | _configDao.persist(cvo); |
|
0 commit comments