mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +02:00
Merge branch 'master' into registry-927
This commit is contained in:
commit
2636fe2525
40 changed files with 313 additions and 105 deletions
|
@ -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
|
||||
|
|
|
@ -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.',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue