@@ -171,73 +171,41 @@ function epp_RegisterDomain($params = array())
171
171
'tech ' ,
172
172
'billing '
173
173
) as $ i => $ contactType ) {
174
+ // contact:create
174
175
$ from = $ to = array ();
175
176
$ from [] = '/{{ id }}/ ' ;
176
- $ id = strtoupper ($ params ['registrarprefix ' ] . '- ' . $ contactType . '' . $ params ['domainid ' ]);
177
- $ to [] = htmlspecialchars ($ id );
177
+ $ to [] = strtoupper ($ s ->generateRandomString ());
178
+ $ from [] = '/{{ name }}/ ' ;
179
+ $ to [] = htmlspecialchars ($ params ['firstname ' ] . ' ' . $ params ['lastname ' ]);
180
+ $ from [] = '/{{ org }}/ ' ;
181
+ $ to [] = htmlspecialchars ($ params ['companyname ' ]);
182
+ $ from [] = '/{{ street1 }}/ ' ;
183
+ $ to [] = htmlspecialchars ($ params ['address1 ' ]);
184
+ $ from [] = '/{{ street2 }}/ ' ;
185
+ $ to [] = htmlspecialchars ($ params ['address2 ' ]);
186
+ $ from [] = '/{{ street3 }}/ ' ;
187
+ $ street3 = (isset ($ params ['address3 ' ]) ? $ params ['address3 ' ] : '' );
188
+ $ to [] = htmlspecialchars ($ street3 );
189
+ $ from [] = '/{{ city }}/ ' ;
190
+ $ to [] = htmlspecialchars ($ params ['city ' ]);
191
+ $ from [] = '/{{ state }}/ ' ;
192
+ $ to [] = htmlspecialchars ($ params ['state ' ]);
193
+ $ from [] = '/{{ postcode }}/ ' ;
194
+ $ to [] = htmlspecialchars ($ params ['postcode ' ]);
195
+ $ from [] = '/{{ country }}/ ' ;
196
+ $ to [] = htmlspecialchars ($ params ['country ' ]);
197
+ $ from [] = '/{{ phonenumber }}/ ' ;
198
+ $ to [] = htmlspecialchars ($ params ['fullphonenumber ' ]);
199
+ $ from [] = '/{{ email }}/ ' ;
200
+ $ to [] = htmlspecialchars ($ params ['email ' ]);
201
+ $ from [] = '/{{ authInfo }}/ ' ;
202
+ $ to [] = htmlspecialchars ($ s ->generateObjectPW ());
178
203
$ from [] = '/{{ clTRID }}/ ' ;
179
204
$ clTRID = str_replace ('. ' , '' , round (microtime (1 ), 3 ));
180
- $ to [] = htmlspecialchars ($ params ['registrarprefix ' ] . '-contact-check- ' . $ clTRID ); // vezi la create tot acest id sa fie
205
+ $ to [] = htmlspecialchars ($ params ['registrarprefix ' ] . '-contact-create- ' . $ clTRID );
206
+ $ from [] = "/<\w+:\w+>\s*<\/\w+:\w+>\s+/ims " ;
207
+ $ to [] = '' ;
181
208
$ xml = preg_replace ($ from , $ to , '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
182
- <epp xmlns="urn:ietf:params:xml:ns:epp-1.0"
183
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
184
- xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
185
- <command>
186
- <check>
187
- <contact:check
188
- xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"
189
- xsi:schemaLocation="urn:ietf:params:xml:ns:contact-1.0 contact-1.0.xsd">
190
- <contact:id>{{ id }}</contact:id>
191
- </contact:check>
192
- </check>
193
- <clTRID>{{ clTRID }}</clTRID>
194
- </command>
195
- </epp> ' );
196
- $ r = $ s ->write ($ xml , __FUNCTION__ );
197
- $ r = $ r ->response ->resData ->children ('urn:ietf:params:xml:ns:contact-1.0 ' )->chkData ;
198
-
199
- // $reason = (string)$r->cd[0]->reason;
200
- // if (!$reason) {
201
- // $reason = 'Contact is not available';
202
- // }
203
-
204
- if (1 == (int )$ r ->cd [0 ]->id ->attributes ()->avail ) {
205
-
206
- // contact:create
207
- $ from = $ to = array ();
208
- $ from [] = '/{{ id }}/ ' ;
209
- $ to [] = strtoupper ($ s ->generateRandomString ());
210
- $ from [] = '/{{ name }}/ ' ;
211
- $ to [] = htmlspecialchars ($ params ['firstname ' ] . ' ' . $ params ['lastname ' ]);
212
- $ from [] = '/{{ org }}/ ' ;
213
- $ to [] = htmlspecialchars ($ params ['companyname ' ]);
214
- $ from [] = '/{{ street1 }}/ ' ;
215
- $ to [] = htmlspecialchars ($ params ['address1 ' ]);
216
- $ from [] = '/{{ street2 }}/ ' ;
217
- $ to [] = htmlspecialchars ($ params ['address2 ' ]);
218
- $ from [] = '/{{ street3 }}/ ' ;
219
- $ street3 = (isset ($ params ['address3 ' ]) ? $ params ['address3 ' ] : '' );
220
- $ to [] = htmlspecialchars ($ street3 );
221
- $ from [] = '/{{ city }}/ ' ;
222
- $ to [] = htmlspecialchars ($ params ['city ' ]);
223
- $ from [] = '/{{ state }}/ ' ;
224
- $ to [] = htmlspecialchars ($ params ['state ' ]);
225
- $ from [] = '/{{ postcode }}/ ' ;
226
- $ to [] = htmlspecialchars ($ params ['postcode ' ]);
227
- $ from [] = '/{{ country }}/ ' ;
228
- $ to [] = htmlspecialchars ($ params ['country ' ]);
229
- $ from [] = '/{{ phonenumber }}/ ' ;
230
- $ to [] = htmlspecialchars ($ params ['fullphonenumber ' ]);
231
- $ from [] = '/{{ email }}/ ' ;
232
- $ to [] = htmlspecialchars ($ params ['email ' ]);
233
- $ from [] = '/{{ authInfo }}/ ' ;
234
- $ to [] = htmlspecialchars ($ s ->generateObjectPW ());
235
- $ from [] = '/{{ clTRID }}/ ' ;
236
- $ clTRID = str_replace ('. ' , '' , round (microtime (1 ), 3 ));
237
- $ to [] = htmlspecialchars ($ params ['registrarprefix ' ] . '-contact-create- ' . $ clTRID );
238
- $ from [] = "/<\w+:\w+>\s*<\/\w+:\w+>\s+/ims " ;
239
- $ to [] = '' ;
240
- $ xml = preg_replace ($ from , $ to , '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
241
209
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"
242
210
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
243
211
xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
@@ -270,14 +238,9 @@ function epp_RegisterDomain($params = array())
270
238
<clTRID>{{ clTRID }}</clTRID>
271
239
</command>
272
240
</epp> ' );
273
- $ r = $ s ->write ($ xml , __FUNCTION__ );
274
- $ r = $ r ->response ->resData ->children ('urn:ietf:params:xml:ns:contact-1.0 ' )->creData ;
275
- $ contacts [$ i + 1 ] = $ r ->id ;
276
- }
277
- else {
278
- $ id = strtoupper ($ params ['registrarprefix ' ] . '- ' . $ contactType . '' . $ params ['domainid ' ]);
279
- $ contacts [$ i + 1 ] = htmlspecialchars ($ id );
280
- }
241
+ $ r = $ s ->write ($ xml , __FUNCTION__ );
242
+ $ r = $ r ->response ->resData ->children ('urn:ietf:params:xml:ns:contact-1.0 ' )->creData ;
243
+ $ contacts [$ i + 1 ] = $ r ->id ;
281
244
}
282
245
283
246
foreach (array (
@@ -2145,4 +2108,4 @@ function (Blueprint $table)
2145
2108
}
2146
2109
}
2147
2110
2148
- ?>
2111
+ ?>
0 commit comments