Merge branch 'master' into registry-927

This commit is contained in:
Maciej Szlosarczyk 2018-08-31 14:25:59 +03:00
commit 2636fe2525
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
40 changed files with 313 additions and 105 deletions

View file

@ -1,7 +1,7 @@
module Admin
class DomainsController < BaseController
load_and_authorize_resource
before_action :set_domain, only: [:show, :edit, :update, :zonefile]
before_action :set_domain, only: %i[show edit update keep]
authorize_resource
helper_method :force_delete_templates
def index
@ -33,7 +33,8 @@ module Admin
end
def show
@domain.valid?
# Validation is needed to warn users
@domain.validate
end
def edit
@ -60,6 +61,11 @@ module Admin
@versions = @domain.versions
end
def keep
@domain.keep
redirect_to edit_admin_domain_url(@domain), notice: t('.kept')
end
private
def set_domain

View file

@ -145,7 +145,9 @@ class EppController < ApplicationController
# VALIDATION
def latin_only
return true if params['frame'].blank?
return true if params['frame'].match(/\A[\p{Latin}\p{Z}\p{P}\p{S}\p{Cc}\p{Cf}\w_\'\+\-\.\(\)\/]*\Z/i)
if params['frame'].match?(/\A[\p{Latin}\p{Z}\p{P}\p{S}\p{Cc}\p{Cf}\w_\'\+\-\.\(\)\/]*\Z/i)
return true
end
epp_errors << {
msg: 'Parameter value policy error. Allowed only Latin characters.',