mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 10:16:01 +02:00
Registrar refactor
This commit is contained in:
parent
6573d81b94
commit
ec4c06bb06
95 changed files with 564 additions and 539 deletions
24
app/controllers/registrar/xml_consoles_controller.rb
Normal file
24
app/controllers/registrar/xml_consoles_controller.rb
Normal file
|
@ -0,0 +1,24 @@
|
|||
class Registrar::XmlConsolesController < Registrar::DeppController # EPP controller
|
||||
def show
|
||||
authorize! :view, :registrar_xml_console
|
||||
end
|
||||
|
||||
def create
|
||||
authorize! :create, :registrar_xml_console
|
||||
begin
|
||||
@result = depp_current_user.server.request(params[:payload])
|
||||
rescue
|
||||
@result = 'CONNECTION ERROR - Is the EPP server running?'
|
||||
end
|
||||
render :show
|
||||
end
|
||||
|
||||
def load_xml
|
||||
# binding.pry
|
||||
cl_trid = "#{depp_current_user.tag}-#{Time.now.to_i}"
|
||||
xml_dir_path = Depp::Engine.root + 'app/views/depp/xml_consoles/epp_requests'
|
||||
xml = File.read("#{xml_dir_path}/#{params[:obj]}/#{params[:epp_action]}.xml")
|
||||
xml.gsub!('<clTRID>ABC-12345</clTRID>', "<clTRID>#{cl_trid}</clTRID>")
|
||||
render text: xml
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue