Bernd Wurst commited on 2018-02-20 11:35:38
Zeige 5 geänderte Dateien mit 26 Einfügungen und 25 Löschungen.
... | ... |
@@ -83,6 +83,9 @@ function redirect($target) |
83 | 83 |
if (! $debugmode) { |
84 | 84 |
header("Location: {$target}"); |
85 | 85 |
} else { |
86 |
+ if ($target == '') { |
|
87 |
+ $target = $_SERVER['REQUEST_URI']; |
|
88 |
+ } |
|
86 | 89 |
if (strpos($target, '?') === false) { |
87 | 90 |
print 'REDIRECT: '.internal_link($target, $target); |
88 | 91 |
} else { |
... | ... |
@@ -51,13 +51,13 @@ if (isset($_REQUEST['domain'])) { |
51 | 51 |
if ($avail['status'] == 'available') { |
52 | 52 |
output('<p class="domain-available">Die Domain '.filter_input_general($_REQUEST['domain']).' ist verfügbar!</p>'); |
53 | 53 |
# Neue Domain eintragen |
54 |
- $data = get_domain_offer($_REQUEST['domain']); |
|
54 |
+ $data = get_domain_offer($avail['domainSuffix']); |
|
55 | 55 |
if (!$data) { |
56 | 56 |
redirect(''); |
57 | 57 |
} |
58 | 58 |
$form = '<p>Folgende Konditionen gelten bei Registrierung der Domain im nächsten Schritt:</p> |
59 | 59 |
<table> |
60 |
- <tr><td>Domainname:</td><td><strong>'.$data['domainname'].'</strong></td></tr> |
|
60 |
+ <tr><td>Domainname:</td><td><strong>'.filter_input_general($_REQUEST['domain']).'</strong></td></tr> |
|
61 | 61 |
<tr><td>Jahresgebühr:</td><td style="text-align: right;">'.$data['gebuehr'].' €</td></tr>'; |
62 | 62 |
if ($data['setup']) { |
63 | 63 |
$form .= '<tr><td>Setup-Gebühr (einmalig):</td><td style="text-align: right;">'.$data['setup'].' €</td></tr>'; |
... | ... |
@@ -76,7 +76,7 @@ if (isset($_REQUEST['domain'])) { |
76 | 76 |
if ($avail['status'] == 'registered' && $avail['transferMethod'] != 'authInfo') { |
77 | 77 |
output('<p>Diese Domainendung kann nicht automatisiert übertragen werden. Bitte wenden Sie sich an den Support.</p>'); |
78 | 78 |
} else { |
79 |
- $data = get_domain_offer($_REQUEST['domain']); |
|
79 |
+ $data = get_domain_offer($avail['domainSuffix']); |
|
80 | 80 |
|
81 | 81 |
if (! $data) { |
82 | 82 |
// Die Include-Datei setzt eine passende Warning-Nachricht |
... | ... |
@@ -85,7 +85,7 @@ if (isset($_REQUEST['domain'])) { |
85 | 85 |
|
86 | 86 |
$form = '<p>Folgende Konditionen gelten beim Transfer der Domain im nächsten Schritt:</p> |
87 | 87 |
<table> |
88 |
- <tr><td>Domainname:</td><td><strong>'.$data['domainname'].'</strong></td></tr> |
|
88 |
+ <tr><td>Domainname:</td><td><strong>'.filter_input_general($avail['domainNameUnicode']).'</strong></td></tr> |
|
89 | 89 |
<tr><td>Jahresgebühr:</td><td style="text-align: right;">'.$data['gebuehr'].' €</td></tr>'; |
90 | 90 |
if ($data['setup']) { |
91 | 91 |
$form .= '<tr><td>Setup-Gebühr (einmalig):</td><td style="text-align: right;">'.$data['setup'].' €</td></tr>'; |
... | ... |
@@ -93,7 +93,7 @@ if (isset($_REQUEST['domain'])) { |
93 | 93 |
$form .='</table>'; |
94 | 94 |
|
95 | 95 |
|
96 |
- $form .= '<p><input type="hidden" name="domain" value="'.filter_input_general($_REQUEST['domain']).'"> |
|
96 |
+ $form .= '<p><input type="hidden" name="domain" value="'.filter_input_general($avail['domainNameUnicode']).'"> |
|
97 | 97 |
<input type="submit" name="submit" value="Ich möchte diese Domain zu '.config('company_name').' umziehen"></p>'; |
98 | 98 |
|
99 | 99 |
output(html_form('domains_transferin', 'domainreg', '', $form)); |
... | ... |
@@ -160,7 +160,7 @@ if ($dom->mailserver_lock == 1 && $dom->status != 'prereg') { |
160 | 160 |
if ($TXT == $dom->secret) { |
161 | 161 |
unset_mailserver_lock($dom); |
162 | 162 |
success_msg("Die Domain {$dom->fqdn} wurde erfolgreich bestätigt und kann nun in vollem Umfang verwendet werden."); |
163 |
- redirect("domains"); |
|
163 |
+ redirect(""); |
|
164 | 164 |
} |
165 | 165 |
|
166 | 166 |
if ($dom->dns == 1 || have_module('dns')) { |
... | ... |
@@ -60,13 +60,18 @@ if (!$dom) { |
60 | 60 |
system_failure("Keine Domain"); |
61 | 61 |
} |
62 | 62 |
|
63 |
-$pricedata = get_domain_offer($dom->fqdn); |
|
63 |
+$avail = api_domain_available($dom->fqdn); |
|
64 |
+$tld = $avail['extension']; |
|
65 |
+if ($tld != $dom->tld) { |
|
66 |
+ system_failure("Fehler in den Daten! Bitte Support informieren"); |
|
67 |
+} |
|
68 |
+ |
|
69 |
+$pricedata = get_domain_offer($tld); |
|
64 | 70 |
if (!$pricedata) { |
65 | 71 |
redirect('adddomain'); |
66 | 72 |
} |
67 | 73 |
$mode=NULL; |
68 | 74 |
|
69 |
-$avail = api_domain_available($dom->fqdn); |
|
70 | 75 |
if ($avail['status'] == 'available') { |
71 | 76 |
set_domain_prereg($dom->id); |
72 | 77 |
$mode = 'reg'; |
... | ... |
@@ -233,18 +233,12 @@ function change_user($domain, $uid) |
233 | 233 |
} |
234 | 234 |
|
235 | 235 |
|
236 |
-function get_domain_offer($domainname) |
|
236 |
+function get_domain_offer($tld) |
|
237 | 237 |
{ |
238 |
- $domainname = filter_input_hostname($domainname); |
|
239 |
- $domainname = preg_replace('/^www\./', '', $domainname); |
|
240 |
- |
|
241 |
- $basename = preg_replace('/([^\.]+)\..*$/', '\1', $domainname); |
|
242 |
- DEBUG('Found Basename: '.$basename); |
|
243 |
- $tld = preg_replace('/^[^\.]*\./', '', $domainname); |
|
244 |
- DEBUG('Found TLD: '.$tld); |
|
238 |
+ $tld = filter_input_hostname($tld); |
|
245 | 239 |
$cid = (int) $_SESSION['customerinfo']['customerno']; |
246 | 240 |
|
247 |
- $data = array("domainname" => $domainname, "basename" => $basename, "tld" => $tld); |
|
241 |
+ $data = array("tld" => $tld); |
|
248 | 242 |
|
249 | 243 |
$result = db_query("SELECT tld, gebuehr, setup FROM misc.domainpreise_kunde WHERE kunde=:cid AND tld=:tld AND ruecksprache='N'", array(":cid" => $cid, ":tld" => $tld)); |
250 | 244 |
if ($result->rowCount() != 1) { |
... | ... |
@@ -286,15 +280,14 @@ function insert_domain_external($domain, $dns = false, $mail = true) |
286 | 280 |
{ |
287 | 281 |
$cid = (int) $_SESSION['customerinfo']['customerno']; |
288 | 282 |
$uid = (int) $_SESSION['userinfo']['uid']; |
289 |
- if (strpos($domain, ' ') !== false) { |
|
290 |
- system_failure("Ungültige Zeichen im Domainname"); |
|
291 |
- } |
|
292 |
- $parts = explode('.', $domain); |
|
293 |
- if (count($parts) !== 2) { |
|
294 |
- system_failure("Ungültiger Domainname"); |
|
283 |
+ require_once("domainapi.php"); |
|
284 |
+ $info = api_domain_available($domain); |
|
285 |
+ if (in_array($info['status'], array('nameContainsForbiddenCharacter', 'suffixDoesNotExist'))) { |
|
286 |
+ system_failure("Diese Domain scheint ungültig zu sein!"); |
|
295 | 287 |
} |
296 |
- $domainname = $parts[0]; |
|
297 |
- $tld = $parts[1]; |
|
288 |
+ $tld = $info['domainSuffix']; |
|
289 |
+ $domainname = str_replace(".$tld", "", $info['domainNameUnicode']); |
|
290 |
+ |
|
298 | 291 |
db_query("INSERT INTO kundendaten.domains (status, kunde, useraccount, domainname, tld, billing, provider, dns, mail, mailserver_lock) VALUES |
299 | 292 |
('external', ?, ?, ?, ?, 'external', 'other', 0, ?, 1)", array($cid, $uid, $domainname, $tld, ($mail ? 'auto' : 'none'))); |
300 | 293 |
$id = db_insert_id(); |
301 | 294 |