<?php
/*
This file belongs to the Webinterface of schokokeks.org Hosting
Written by schokokeks.org Hosting, namely
Bernd Wurst <bernd@schokokeks.org>
Hanno Böck <hanno@schokokeks.org>
This code is published under a 0BSD license.
Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
*/
require_once('inc/security.php');
require_once('inc/icons.php');
require_once('inc/jquery.php');
javascript();
require_once('domainapi.php');
require_once('domains.php');
require_role(ROLE_CUSTOMER);
if (! config('http.net-apikey')) {
system_failure("Dieses System ist nicht eingerichtet zum Hinzufügen von Domains");
}
title("Domain hinzufügen");
$section='domains_domains';
output('<p>Mit dieser Funktion können Sie eine neue Domain bestellen oder eine bestehende, extern registrierte Domain verfügbar machen.</p>');
$form = '<p>Domainname: <input type="text" name="domain" size="50" /> <input type="submit" value="Verfügbarkeit prüfen" />';
output(html_form('adddomain_search', '', '', $form));
if (isset($_REQUEST['domain'])) {
$request = idn_to_utf8(trim($_REQUEST['domain']), 0, INTL_IDNA_VARIANT_UTS46);
if (substr($request, 0, 4) == 'www.') {
$request = str_replace('www.', '', $request);
}
verify_input_hostname_utf8($request);
$punycode = idn_to_ascii($request, 0, INTL_IDNA_VARIANT_UTS46);
if (!check_domain($punycode)) {
warning("Ungültiger Domainname: ".filter_output_html($request));
redirect('');
}
$dom = new Domain();
if ($dom->loadByName($request) !== false) {
if ($dom->is_customerdomain()) {
warning('Diese Domain ist bereits in Ihrem Kundenkonto eingetragen!');
} else {