#4396 added protocol and relative path generated from code

pull/4855/head
Kartones 9 years ago
parent 2c45608aeb
commit 7c51afcc28

@ -67,6 +67,10 @@ class Admin::OrganizationsController < ApplicationController
def load_organization_and_members
@organization = current_user.organization
raise RecordNotFound unless @organization.present? && current_user.organization_owner?
# INFO: Special scenario of handcrafted URL to go to organization-based signup page
@organization_signup_url =
"#{CartoDB.protocol}://#{@organization.name}.#{CartoDB.account_host}#{CartoDB.path(self, 'signup_organization_user')}"
end
end

@ -133,8 +133,7 @@
<% if @organization[:whitelisted_email_domains].length === 0 %>
<span class="Form-titleText--negative">Sign up will only be enabled when whitelist is not empty.</span>
<% else %>
<% url = "http://#{@organization.name}.#{CartoDB.account_host}/signup" %>
Sign up url is: <a href="<%= url %>"><%= url %></a>.
Sign up url is: <a href="<%= @organization_signup_url %>"><%= @organization_signup_url %></a>.
<% end %>
</p>
</div>

@ -113,6 +113,11 @@ module CartoDB
@@request_host=value
end
def self.protocol(protocol_override=nil)
default_protocol = self.use_https? ? 'https' : 'http'
protocol_override.nil? ? default_protocol : protocol_override
end
# "private" methods, not intended for direct usage
# ------------------------------------------------
@ -135,11 +140,6 @@ module CartoDB
@@https_port = self.get_https_port
end
def self.protocol(protocol_override=nil)
default_protocol = self.use_https? ? 'https' : 'http'
protocol_override.nil? ? default_protocol : protocol_override
end
def self.subdomain_based_base_url(subdomain, org_username=nil, protocol_override=nil)
protocol = self.protocol(protocol_override)
base_url ="#{protocol}://#{subdomain}#{self.session_domain}#{protocol == 'http' ? self.http_port : self.https_port}"

Loading…
Cancel
Save