#!/usr/local/bin/php -d variables_order="EGPCS"
this manual for mor information on how to upgrade.';
exit;
}
unset($version);
/**
* Check for Curl
*/
if (!function_exists('curl_init')) {
echo 'You need cURL to use this plugin.';
exit;
}
/**
* Check SimpleXML
*/
if (!function_exists(simplexml_load_string)) {
die('ERROR: SimpleXML not availible'. PHP_EOL);
}
/**
* Read plugin config file
*/
$config = $_ENV['DOCUMENT_ROOT'] .'/../etc/oneclick.conf';
$settings = unserialize(file_get_contents($config));
/**
* Check for Settings
*/
if (!(strlen($settings['da_user']) > 0 && strlen($settings['da_passwd']) > 0)) {
echo 'You need to configure this plugin before you can use it';
exit;
}
/**
* Read user config file
*/
$usrConfig = $_ENV['DOCUMENT_ROOT'] .'/../etc/usr_'. $_ENV['USERNAME'] .'.conf';
if (file_exists($usrConfig)) {
$usrSettings = unserialize(@file_get_contents($usrConfig));
} else {
$usrSettings = array();
}
$replace = array();
$replace['{{ voucher_url }}'] = htmlentities(strip_tags($settings['voucher_url']));
parse_str($_ENV['QUERY_STRING'], $qstr);
parse_str($_ENV['POST'], $_POST);
$replace['{{ domain }}'] = htmlentities(strip_tags(trim($_POST['domain'])));
$replace['{{ voucher }}'] = htmlentities(strip_tags(trim($_POST['voucher'])));
$replace['{{ email }}'] = htmlentities(strip_tags(trim($_POST['email'])));
$replace['{{ revoke }}'] = htmlentities(strip_tags(trim($_POST['revoke'])));
if ($_SERVER['REQUEST_METHOD'] == 'POST' && !isset($qstr['action'])) {
$error = false;
if (!@checkdnsrr(str_replace('*.', '', $replace['{{ domain }}']), 'ANY')) {
$errorMsg .= "The hostname ". str_replace('*.', '', $replace['{{ domain }}']) ." does not revolve to an ip address.
". PHP_EOL;
$error = true;
}
$mail = explode("@", $replace['{{ email }}'], 2);
if (!@checkdnsrr($mail[1], 'ANY')) {
$errorMsg .= "The domain '". $mail[1] ."' is not able to receive mail, can't resolve domain.
". PHP_EOL;
$error = true;
}
if (strlen($_POST['voucher']) < 4) {
$errorMsg .= "Invalid voucher, the voucher should be minimal 5 characters.
". PHP_EOL;
$error = true;
}
if (!array_key_exists('subagree', $_POST)) {
$errorMsg .= "Please check and agree the terms and conditions
". PHP_EOL;
$error = true;
}
if ($error) {
echo '