<?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/debug.php');
require_once('inc/base.php');
require_once('inc/security.php');
require_once('inc/error.php');
require_once('httpnet.php');
require_once('modules/email/include/vmail.php');
function get_domain_offer($domainname)
{
$domainname = filter_input_hostname($domainname);
$domainname = preg_replace('/^www\./', '', $domainname);
$basename = preg_replace('/([^\.]+)\..*$/', '\1', $domainname);
DEBUG('Found Basename: ' . $basename);
$tld = preg_replace('/^[^\.]*\./', '', $domainname);
DEBUG('Found TLD: ' . $tld);
$cid = (int) $_SESSION['customerinfo']['customerno'];
$result = db_query("SELECT id FROM kundendaten.domains WHERE domainname=:domainname AND tld=:tld", ["domainname" => $basename, "tld" => $tld]);
if ($result->rowCount() != 0) {
warning('Diese Domain ist in unserem System bereits vorhanden und kann daher nicht noch einmal eingetragen werden.');
return;
}
$data = ["domainname" => $domainname, "basename" => $basename, "tld" => $tld];
$result = db_query("SELECT tld, gebuehr, setup FROM misc.domainpreise_kunde WHERE kunde=:cid AND tld=:tld AND ruecksprache='N'", [":cid" => $cid, ":tld" => $tld]);
if ($result->rowCount() != 1) {
$result = db_query("SELECT tld, gebuehr, setup FROM misc.domainpreise WHERE tld=:tld AND ruecksprache='N'", [":tld" => $tld]);
}
if ($result->rowCount() != 1) {
warning('Die Endung »' . $tld . '« steht zur automatischen Eintragung nicht zur Verfügung.');
return;
}