line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::UKDomain::Nominet::Automaton; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7036
|
use 5.006; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require Exporter; |
8
|
1
|
|
|
1
|
|
784
|
use AutoLoader qw(AUTOLOAD); |
|
1
|
|
|
|
|
1421
|
|
|
1
|
|
|
|
|
5
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $errstr; # Global error string for returning error condition details |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
## BEGIN variables ## |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# Email Match |
15
|
|
|
|
|
|
|
our $email_match='(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6}'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# List of emails used for certain operations |
18
|
|
|
|
|
|
|
our %emails = ( |
19
|
|
|
|
|
|
|
'REQUEST' => 'applications@nic.uk', |
20
|
|
|
|
|
|
|
'RECEIVE' => 'applications@nic.uk', |
21
|
|
|
|
|
|
|
'account MODIFY' => 'applications@nic.uk', |
22
|
|
|
|
|
|
|
'contact MODIFY' => 'applications@nic.uk', |
23
|
|
|
|
|
|
|
'nameserver MODIFY' => 'applications@nic.uk', |
24
|
|
|
|
|
|
|
'LIST' => 'auto-list@nic.uk', |
25
|
|
|
|
|
|
|
'BULK' => 'auto-bulk@nic.uk', |
26
|
|
|
|
|
|
|
'MODIFY' => undef, |
27
|
|
|
|
|
|
|
'DELETE' => undef, |
28
|
|
|
|
|
|
|
'QUERY' => undef, |
29
|
|
|
|
|
|
|
'RELEASE' => undef, |
30
|
|
|
|
|
|
|
'RENEW' => undef |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# List of emails based on SLD, for other operations |
34
|
|
|
|
|
|
|
our %emails_sld = ( |
35
|
|
|
|
|
|
|
'co.uk' => 'auto-co@nic.uk', |
36
|
|
|
|
|
|
|
'me.uk' => 'auto-me@nic.uk', |
37
|
|
|
|
|
|
|
'org.uk' => 'auto-org@nic.uk', |
38
|
|
|
|
|
|
|
'net.uk' => 'auto-net@nic.uk', |
39
|
|
|
|
|
|
|
'ltd.uk' => 'auto-ltd@nic.uk', |
40
|
|
|
|
|
|
|
'plc.uk' => 'auto-plc@nic.uk', |
41
|
|
|
|
|
|
|
'sch.uk' => 'auto-sch@nic.uk' |
42
|
|
|
|
|
|
|
); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
our @slds = keys %emails_sld; # Gets a list of SLDS |
45
|
|
|
|
|
|
|
our $sldsi = join('|',@slds); # Join list for regex use |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
our @operations = keys %emails; # Gets a list of operations |
48
|
|
|
|
|
|
|
our $operationsi = join('|',@operations); # Join list for regex use |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
# List of regex rules for fields |
51
|
|
|
|
|
|
|
our %rules = ( |
52
|
|
|
|
|
|
|
'operation' => "($operationsi)", |
53
|
|
|
|
|
|
|
'key' => '([A-Za-z0-9\-]\.('.$sldsi.')){1,63}$', |
54
|
|
|
|
|
|
|
'account-name' => '[[:print:]]{1,80}', |
55
|
|
|
|
|
|
|
'account-id' => '[[:print:]]{1,80}', |
56
|
|
|
|
|
|
|
'contact-id' => '[[:print:]]{1,80}', |
57
|
|
|
|
|
|
|
'name' => '[[:print:]]{1,80}', |
58
|
|
|
|
|
|
|
'trad-name' => '[[:print:]]{1,80}', |
59
|
|
|
|
|
|
|
'type' => '(LTD|PLC|PTNR|LLP|STRA|IND|IP|SCH|RCHAR|GOV|CRC|STAT|OTHER|FIND|FCORP|FOTHER)', |
60
|
|
|
|
|
|
|
'opt-out' => '(y|Y|n|N)', |
61
|
|
|
|
|
|
|
'co-no' => '[0-9]{1,10}', |
62
|
|
|
|
|
|
|
'addr' => '[[:print:]]{1,256}', |
63
|
|
|
|
|
|
|
'city' => '[[:print:]]{1,80}', |
64
|
|
|
|
|
|
|
'locality' => '[[:print:]]{1,80}', |
65
|
|
|
|
|
|
|
'county' => '[[:print:]]{1,80}', |
66
|
|
|
|
|
|
|
'postcode' => '[A-Z0-9 ]{1,10}', |
67
|
|
|
|
|
|
|
'country' => '[A-Z]{2}', # See: http://www.iso.org/iso/iso3166_en_code_lists.txt |
68
|
|
|
|
|
|
|
'email' => $email_match, |
69
|
|
|
|
|
|
|
'phone' => '[\+0-9][0-9\.\-]{1,20}', |
70
|
|
|
|
|
|
|
'fax' => '[\+0-9][0-9\.\-]{1,20}', |
71
|
|
|
|
|
|
|
'mobile' => '[\+0-9][0-9\.\-]{1,20}', |
72
|
|
|
|
|
|
|
'dns' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
73
|
|
|
|
|
|
|
'dns-id' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
74
|
|
|
|
|
|
|
'dns0' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
75
|
|
|
|
|
|
|
'dns0-id' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
76
|
|
|
|
|
|
|
'dns1' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
77
|
|
|
|
|
|
|
'dns1-id' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
78
|
|
|
|
|
|
|
'dns2' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
79
|
|
|
|
|
|
|
'dns2-id' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
80
|
|
|
|
|
|
|
'dns3' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
81
|
|
|
|
|
|
|
'dns3-id' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
82
|
|
|
|
|
|
|
'dns4' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
83
|
|
|
|
|
|
|
'dns4-id' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
84
|
|
|
|
|
|
|
'dns5' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
85
|
|
|
|
|
|
|
'dns5-id' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
86
|
|
|
|
|
|
|
'dns6' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
87
|
|
|
|
|
|
|
'dns6-id' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
88
|
|
|
|
|
|
|
'dns7' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
89
|
|
|
|
|
|
|
'dns7-id' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
90
|
|
|
|
|
|
|
'dns8' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
91
|
|
|
|
|
|
|
'dns8-id' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
92
|
|
|
|
|
|
|
'dns9' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
93
|
|
|
|
|
|
|
'dns9-id' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
94
|
|
|
|
|
|
|
'a1-id' => '[[:print:]]{1,80}', |
95
|
|
|
|
|
|
|
'a1-name' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
96
|
|
|
|
|
|
|
'a1-email' => $email_match, |
97
|
|
|
|
|
|
|
'a1-phone' => '[\+0-9][0-9\.\-]{1,20}', |
98
|
|
|
|
|
|
|
'a1-fax' => '[\+0-9][0-9\.\-]{1,20}', |
99
|
|
|
|
|
|
|
'a1-mobile' => '[\+0-9][0-9\.\-]{1,20}', |
100
|
|
|
|
|
|
|
'a2-id' => '[[:print:]]{1,80}', |
101
|
|
|
|
|
|
|
'a2-name' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
102
|
|
|
|
|
|
|
'a2-email' => $email_match, |
103
|
|
|
|
|
|
|
'a2-phone' => '[\+0-9][0-9\.\-]{1,20}', |
104
|
|
|
|
|
|
|
'a2-fax' => '[\+0-9][0-9\.\-]{1,20}', |
105
|
|
|
|
|
|
|
'a2-mobile' => '[\+0-9][0-9\.\-]{1,20}', |
106
|
|
|
|
|
|
|
'a3-id' => '[[:print:]]{1,80}', |
107
|
|
|
|
|
|
|
'a3-name' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
108
|
|
|
|
|
|
|
'a3-email' => $email_match, |
109
|
|
|
|
|
|
|
'a3-phone' => '[\+0-9][0-9\.\-]{1,20}', |
110
|
|
|
|
|
|
|
'a3-fax' => '[\+0-9][0-9\.\-]{1,20}', |
111
|
|
|
|
|
|
|
'a3-mobile' => '[\+0-9][0-9\.\-]{1,20}', |
112
|
|
|
|
|
|
|
'b-addr' => '[[:print:]]{1,256}', |
113
|
|
|
|
|
|
|
'b-locality' => '[[:print:]]{1,80}', |
114
|
|
|
|
|
|
|
'b-city' => '[[:print:]]{1,80}', |
115
|
|
|
|
|
|
|
'b-county' => '[[:print:]]{1,80}', |
116
|
|
|
|
|
|
|
'b-postcode' => '[A-Z0-9 ]{1,10}', |
117
|
|
|
|
|
|
|
'b-country' => '[A-Z]{2}', # See: http://www.iso.org/iso/iso3166_en_code_lists.txt |
118
|
|
|
|
|
|
|
'b1-name' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
119
|
|
|
|
|
|
|
'b1-email' => $email_match, |
120
|
|
|
|
|
|
|
'b1-phone' => '[\+0-9][0-9\.\-]{1,20}', |
121
|
|
|
|
|
|
|
'b1-fax' => '[\+0-9][0-9\.\-]{1,20}', |
122
|
|
|
|
|
|
|
'b1-mobile' => '[\+0-9][0-9\.\-]{1,20}', |
123
|
|
|
|
|
|
|
'b2-name' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
124
|
|
|
|
|
|
|
'b2-email' => $email_match, |
125
|
|
|
|
|
|
|
'b2-phone' => '[\+0-9][0-9\.\-]{1,20}', |
126
|
|
|
|
|
|
|
'b2-fax' => '[\+0-9][0-9\.\-]{1,20}', |
127
|
|
|
|
|
|
|
'b2-mobile' => '[\+0-9][0-9\.\-]{1,20}', |
128
|
|
|
|
|
|
|
'b3-name' => '([a-z0-9][a-z0-9\-\.\, ]+)', |
129
|
|
|
|
|
|
|
'b3-email' => $email_match, |
130
|
|
|
|
|
|
|
'b3-phone' => '[\+0-9][0-9\.\-]{1,20}', |
131
|
|
|
|
|
|
|
'b3-fax' => '[\+0-9][0-9\.\-]{1,20}', |
132
|
|
|
|
|
|
|
'b3-mobile' => '[\+0-9][0-9\.\-]{1,20}', |
133
|
|
|
|
|
|
|
'registrar-tag' => '[A-Z0-9\-]+', |
134
|
|
|
|
|
|
|
'first-bill' => '(th|bc)', |
135
|
|
|
|
|
|
|
'recur-bill' => '(th|bc)', |
136
|
|
|
|
|
|
|
'auto-bill' => '[0-9]{0,3}', |
137
|
|
|
|
|
|
|
'next-bill' => '[0-9]{0,3}', |
138
|
|
|
|
|
|
|
'notes' => '[[:print:]]*', |
139
|
|
|
|
|
|
|
'month' => '[0-9]{4}-[0-9]{2}|all', |
140
|
|
|
|
|
|
|
'expiry' => '[0-9]{4}-[0-9]{2}', |
141
|
|
|
|
|
|
|
); |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
our @fields = keys %rules; # Gets a list of fields |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
# We need to map the old depreciated fields onto the new ones... |
146
|
|
|
|
|
|
|
our %depreciated = ( |
147
|
|
|
|
|
|
|
'domain' => 'key', |
148
|
|
|
|
|
|
|
'for' => 'account-name', |
149
|
|
|
|
|
|
|
'reg-trad-name' => 'trad-name', |
150
|
|
|
|
|
|
|
'reg-type' => 'type', |
151
|
|
|
|
|
|
|
'reg-opt-out' => 'opt-out', |
152
|
|
|
|
|
|
|
'reg-co-no' => 'co-no', |
153
|
|
|
|
|
|
|
'reg-addr' => 'addr', |
154
|
|
|
|
|
|
|
'reg-city' => 'city', |
155
|
|
|
|
|
|
|
'reg-locality' => 'locality', |
156
|
|
|
|
|
|
|
'reg-county' => 'county', |
157
|
|
|
|
|
|
|
'reg-postcode' => 'postcode', |
158
|
|
|
|
|
|
|
'reg-country' => 'country', |
159
|
|
|
|
|
|
|
'reg-ref' => undef, |
160
|
|
|
|
|
|
|
'reg-contact' => 'a1-name', |
161
|
|
|
|
|
|
|
'reg-email' => 'a1-email', |
162
|
|
|
|
|
|
|
'reg-phone' => 'a1-phone', |
163
|
|
|
|
|
|
|
'reg-fax' => 'a1-fax', |
164
|
|
|
|
|
|
|
'reg-mobile' => 'a1-mobile', |
165
|
|
|
|
|
|
|
'admin-c' => undef, |
166
|
|
|
|
|
|
|
'a-addr' => undef, |
167
|
|
|
|
|
|
|
'a-phone' => undef, |
168
|
|
|
|
|
|
|
'a-fax' => undef, |
169
|
|
|
|
|
|
|
'a-email' => undef, |
170
|
|
|
|
|
|
|
'billing-c' => undef, |
171
|
|
|
|
|
|
|
'b-email' => 'b1-email', |
172
|
|
|
|
|
|
|
'b-phone' => 'b1-phone', |
173
|
|
|
|
|
|
|
'b-fax' => 'b1-fax', |
174
|
|
|
|
|
|
|
'b-mobile' => 'b1-mobile', |
175
|
|
|
|
|
|
|
'ips-key' => 'registrar-tag', |
176
|
|
|
|
|
|
|
'tech-c' => undef, |
177
|
|
|
|
|
|
|
't-addr' => undef, |
178
|
|
|
|
|
|
|
't-phone' => undef, |
179
|
|
|
|
|
|
|
't-fax' => undef, |
180
|
|
|
|
|
|
|
't-email' => undef, |
181
|
|
|
|
|
|
|
'e-mail' => 'email', |
182
|
|
|
|
|
|
|
'fax-no' => 'fax', |
183
|
|
|
|
|
|
|
'address' => 'addr', |
184
|
|
|
|
|
|
|
'org-trad-name' => 'trad-name', |
185
|
|
|
|
|
|
|
'org-type' => 'type', |
186
|
|
|
|
|
|
|
'org-co-no' => 'co-no', |
187
|
|
|
|
|
|
|
'org-postcode' => undef, |
188
|
|
|
|
|
|
|
'org-country' => undef, |
189
|
|
|
|
|
|
|
'org-addr' => undef, |
190
|
|
|
|
|
|
|
'nserver' => 'dns', |
191
|
|
|
|
|
|
|
); |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
## END variables ## |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
196
|
|
|
|
|
|
|
our @EXPORT = qw(); |
197
|
|
|
|
|
|
|
our $VERSION = '1.08'; |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
# Preloaded methods go here. |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
# Autoload methods go after =cut, and are processed by the autosplit program. |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
1; |
204
|
|
|
|
|
|
|
__END__ |