Skip to content

Commit f264351

Browse files
author
SadiJr
committed
Permite informar apenas o loginbasedomain em temas
1 parent ebc5744 commit f264351

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

server/src/main/java/org/apache/cloudstack/gui/theme/GuiThemeServiceImpl.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,7 @@ public GuiThemeJoin createGuiTheme(CreateGuiThemeCmd cmd) {
207207
CallContext.current().setEventDetails(String.format("Name: %s, AccountIDs: %s, DomainIDs: %s, RecursiveDomains: %s, CommonNames: %s", name, providedAccountIds,
208208
providedDomainIds, recursiveDomains, commonNames));
209209

210-
if (StringUtils.isAllBlank(css, jsonConfiguration)) {
211-
throw new CloudRuntimeException("Either the `css` or `jsonConfiguration` parameter must be informed.");
212-
}
213-
214-
validateParameters(jsonConfiguration, providedDomainIds, providedAccountIds, commonNames, baseDomainName, null);
210+
validateParameters(css, jsonConfiguration, providedDomainIds, providedAccountIds, commonNames, baseDomainName, null);
215211

216212
if (shouldSetGuiThemeToPrivate(providedDomainIds, providedAccountIds)) {
217213
isPublic = false;
@@ -304,7 +300,11 @@ protected Pair<List<GuiThemeJoinVO>, Integer> listGuiThemesInternal(ListGuiTheme
304300
return guiThemeJoinDao.listGuiThemes(id, name, commonName, domainUuid, accountUuid, listAll, showRemoved, showPublic);
305301
}
306302

307-
protected void validateParameters(String jsonConfig, String domainIds, String accountIds, String commonNames, String loginBaseDomain, Long idOfThemeToBeUpdated) {
303+
protected void validateParameters(String css, String jsonConfig, String domainIds, String accountIds, String commonNames, String loginBaseDomain, Long idOfThemeToBeUpdated) {
304+
if (StringUtils.isAllBlank(css, jsonConfig, loginBaseDomain)) {
305+
throw new CloudRuntimeException("At least one of the `css`, `jsonconfiguration`, or `loginbasedomain` parameters must be informed.");
306+
}
307+
308308
if (isConsideredDefaultTheme(commonNames, domainIds, accountIds)) {
309309
checkIfDefaultThemeIsAllowed(commonNames, domainIds, accountIds, idOfThemeToBeUpdated);
310310
}
@@ -362,11 +362,7 @@ public GuiThemeJoin updateGuiTheme(UpdateGuiThemeCmd cmd) {
362362
CallContext.current().setEventDetails(String.format("ID: %s, Name: %s, AccountIDs: %s, DomainIDs: %s, RecursiveDomains: %s, CommonNames: %s", guiThemeId, name,
363363
providedAccountIds, providedDomainIds, recursiveDomains, commonNames));
364364

365-
if (StringUtils.isAllBlank(css, jsonConfiguration)) {
366-
throw new CloudRuntimeException("Either the `css` or `jsonConfiguration` parameter must be informed.");
367-
}
368-
369-
validateParameters(jsonConfiguration, providedDomainIds, providedAccountIds, commonNames, baseDomainName, guiThemeId);
365+
validateParameters(css, jsonConfiguration, providedDomainIds, providedAccountIds, commonNames, baseDomainName, guiThemeId);
370366

371367
if (shouldSetGuiThemeToPrivate(providedDomainIds, providedAccountIds)) {
372368
isPublic = false;

0 commit comments

Comments
 (0)