This commit is contained in:
Priit Tark 2015-05-14 11:02:26 +03:00
parent 14675f5bb7
commit ab6f59c09e
8 changed files with 48 additions and 2 deletions

View file

@ -0,0 +1,11 @@
class Registrant::WhoisController < RegistrantController
def index
authorize! :view, Registrant::Whois
if params[:domain_name].present?
whois_url = "#{ENV['restful_whois_url']}/v1/#{params[:domain_name]}"
binding.pry
page = Nokogiri::HTML(open(whois_url))
@results = 'ee'
end
end
end

View file

@ -13,6 +13,7 @@ class Ability
when 'ApiUser' when 'ApiUser'
epp epp
registrar registrar
registrant # refactor
end end
can :show, :dashboard can :show, :dashboard
@ -63,6 +64,10 @@ class Ability
can :manage, :deposit can :manage, :deposit
end end
def registrant
can :manage, Registrant::Whois
end
def user def user
can :show, :dashboard can :show, :dashboard
end end

View file

@ -36,6 +36,9 @@
- active_class = %w(registrant/domains registrant/check registrant/renew registrant/tranfer registrant/keyrelays).include?(params[:controller]) ? 'active' :nil - active_class = %w(registrant/domains registrant/check registrant/renew registrant/tranfer registrant/keyrelays).include?(params[:controller]) ? 'active' :nil
%li{class: active_class}= link_to t(:domains), registrant_domains_path %li{class: active_class}= link_to t(:domains), registrant_domains_path
- active_class = %w(registrant/whois).include?(params[:controller]) ? 'active' :nil
%li{class: active_class}= link_to t(:whois), registrant_whois_path
%ul.nav.navbar-nav.navbar-right %ul.nav.navbar-nav.navbar-right
- if user_signed_in? - if user_signed_in?
%li= link_to t(:log_out, user: current_user), '/registrant/logout' %li= link_to t(:log_out, user: current_user), '/registrant/logout'

View file

@ -0,0 +1,21 @@
= render 'shared/title', name: t(:whois)
- if ENV['restful_whois_url'].blank?
%p
Registrant configuration issue: missing restful_whois_url
- else
.row
.col-md-12{style: 'margin-bottom: -15px;'}
= form_tag registrant_whois_path, class: 'form-horizontal', method: :get do
.col-md-11
.form-group
= text_field_tag :domain_name, params[:domain_name], class: 'form-control', placeholder: t(:domain_name), autocomplete: 'off', autofocus: true
.col-md-1.text-right.text-center-xs
.form-group
%button.btn.btn-default
&nbsp;
%span.glyphicon.glyphicon-search
&nbsp;
%hr
- if @results
= @results

View file

@ -35,6 +35,9 @@ key_path: '/home/registry/registry/shared/ca/private/webclient.key.pem'
epp_hostname: 'registry.gitlab.eu' epp_hostname: 'registry.gitlab.eu'
repp_url: 'https://repp.gitlab.eu/repp/v1/' repp_url: 'https://repp.gitlab.eu/repp/v1/'
# Registrant server configuration
restful_whois_url: 'https://restful-whois.example.com'
# SMTP configuration (for Admin/EPP/Registrar/Registrant servers) # SMTP configuration (for Admin/EPP/Registrar/Registrant servers)
smtp_address: 'server-hostname' smtp_address: 'server-hostname'
smtp_port: '25' # 587, 465 smtp_port: '25' # 587, 465

View file

@ -766,3 +766,4 @@ en:
contact_email_update_subject: 'Teie domeenide kontakt epostiaadress on muutunud / Contact e-mail addresses of your domains have changed' contact_email_update_subject: 'Teie domeenide kontakt epostiaadress on muutunud / Contact e-mail addresses of your domains have changed'
object_status_prohibits_operation: 'Object status prohibits operation' object_status_prohibits_operation: 'Object status prohibits operation'
domain_registrant_update_subject: "Kinnitustaotlus domeeni %{name} registreerija vahetuseks / Application for approval for registrant chache of %{name}" domain_registrant_update_subject: "Kinnitustaotlus domeeni %{name} registreerija vahetuseks / Application for approval for registrant chache of %{name}"
whois: WHOIS

View file

@ -191,7 +191,7 @@ common: &default_settings
development: development:
<<: *default_settings <<: *default_settings
# Turn on communication to New Relic service in development mode # Turn on communication to New Relic service in development mode
monitor_mode: true monitor_mode: false
app_name: Registry (Development) app_name: Registry (Development)
# Rails Only - when running in Developer Mode, the New Relic Agent will # Rails Only - when running in Developer Mode, the New Relic Agent will
@ -199,7 +199,7 @@ development:
# executed since starting the mongrel. # executed since starting the mongrel.
# NOTE: There is substantial overhead when running in developer mode. # NOTE: There is substantial overhead when running in developer mode.
# Do not use for production or load testing. # Do not use for production or load testing.
developer_mode: true developer_mode: false
test: test:
<<: *default_settings <<: *default_settings

View file

@ -126,6 +126,8 @@ Rails.application.routes.draw do
end end
end end
resources :whois
# resources :contacts do # resources :contacts do
# member do # member do
# get 'delete' # get 'delete'