boolean isSecure = site.hasSecureServer() ? site.getSecureUrl().equals(entry.getKey().getUrl()) : false; boolean isAlias = site.getAliases().contains(entry.getKey()); if (!(isSite || isSecure || isAlias)) {
return (secure ? getSecureUrl() : getUrl());
/** * Returns the server prefix for the given resource in this site, used to distinguish between * secure (https) and non-secure (http) sites.<p> * * This is required since a resource may have an individual "secure" setting using the property * {@link org.opencms.file.CmsPropertyDefinition#PROPERTY_SECURE}, which means this resource * must be delivered only using a secure protocol.<p> * * The result will look like <code>http://site.enterprise.com:8080/</code> or <code>https://site.enterprise.com/</code>.<p> * * @param cms the current users OpenCms context * @param resourceName the resource name * * @return the server prefix for the given resource in this site * * @see #getSecureUrl() * @see #getUrl() */ public String getServerPrefix(CmsObject cms, String resourceName) { if (resourceName.startsWith(cms.getRequestContext().getSiteRoot())) { // make sure this can also be used with a resource root path resourceName = resourceName.substring(cms.getRequestContext().getSiteRoot().length()); } boolean secure = OpenCms.getStaticExportManager().isSecureLink( cms, resourceName, cms.getRequestContext().isSecureRequest()); return (secure ? getSecureUrl() : getUrl()); }
return (secure ? getSecureUrl() : getUrl());
secureUrl = site.getSecureUrl(); } catch (Exception e) { LOG.error(
&& getSiteManager().getWorkplaceSiteMatcher().getUrl().equals(site.getSecureUrl())) {
secureUrl = site.getSecureUrl();
secureUrl = site.getSecureUrl(); } catch (Exception e) { LOG.error(Messages.get().getBundle().key(
secureElem.addAttribute(A_SERVER, site.getSecureUrl()); secureElem.addAttribute(A_EXCLUSIVE, "" + site.isExclusiveUrl()); secureElem.addAttribute(A_ERROR, "" + site.isExclusiveError());
serverPrefix = targetSite.getSecureUrl(); } else if (!secureLink && secureRequest) { serverPrefix = targetSite.getUrl();
serverPrefix = targetSite.getSecureUrl(); } else if (!secureLink && secureRequest) { serverPrefix = targetSite.getUrl();
secureElem.addAttribute(A_SERVER, site.getSecureUrl());