Commit 4c2b344a authored by Charl's avatar Charl
Browse files

added contrib/cozaeppdisableautorenew.php

parent 511e19a7
* Copyright (c) 2012-2014, AllWorldIT
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <>.
* Official Website:
* Lead developer:
* Nigel Kukard <>
* ! ! P L E A S E N O T E ! !
* * If you make changes to this file, please consider contributing
* anything useful back to the community. Don't be a sour prick.
* * If you find this module useful please consider making a
* donation to support modules like this.
* WHMCS hosting, theming, module development, payment gateway
* integration, customizations and consulting all available from
* Buzybuy - cozaepp Disable Auto Renew
* This script is a modification of the original cozaeppsync.php script from AllWorldIT combined with code from
* Everything Web CC script.
* This script will loop through all the coza domains in your WHMCS database.
* Each domain's auto renew will be set to false on the domain.
* This script can also be reversed and set each domain's auto renew to true by editing the flag value below.
// This file brings in a few constants we need
require_once dirname(__FILE__) . '/../../../dbconnect.php';
// Setup include dir
$include_path = ROOTDIR . '/modules/registrars/cozaepp';
set_include_path($include_path . PATH_SEPARATOR . get_include_path());
// Include EPP stuff we need
require_once 'cozaepp.php';
// Additional functions we need
require_once ROOTDIR . '/includes/functions.php';
// Include registrar functions aswell
require_once ROOTDIR . '/includes/registrarfunctions.php';
// Grab module parameters
$params = getregistrarconfigoptions('cozaepp');
echo("COZA-EPP Domain Set Auto Renew To False Report\n");
// Request balance from registrar
try {
$client = _cozaepp_Client();
// Pull list of domains which are registered using this module
$queryresult = mysql_query("
WHERE registrar = 'cozaepp'"
while($data = mysql_fetch_array($queryresult)) {
$domains[] = trim(strtolower($data['domain']));
// Loop with each one
foreach ($domains as $domain) {
// Get domain info
$output = $client->request('
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:xsi=""
xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
<domain:info xmlns:domain="urn:ietf:params:xml:ns:domain-1.0"
xsi:schemaLocation="urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd">
<domain:name hosts="all">'.$domain.'</domain:name>
<cozadomain:info xmlns:cozadomain=""
xsi:schemaLocation=" coza-domain-1.0.xsd">
$doc= new DOMDocument();
$coderes = $doc->getElementsByTagName('result')->item(0)->getAttribute('code');
if ($coderes == '1000') {
// Is autorenew enabled?
if ($doc->getElementsByTagName('autorenew') &&
$doc->getElementsByTagName('autorenew')->item(0) &&
strtolower(trim($doc->getElementsByTagName('autorenew')->item(0)->nodeValue)) != "false"
) {
// Disable autorenew via update
$output = $client->request('
<epp:epp xmlns:xsi="" xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" xmlns:cozadomain=""
xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
<domain:update xsi:schemaLocation="urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd">
<cozadomain:update xsi:schemaLocation=" coza-domain-1.0.xsd">
$doc= new DOMDocument();
$coderes = $doc->getElementsByTagName('result')->item(0)->getAttribute('code');
if($coderes == '1001') {
if($doc->getElementsByTagName('msg')) {
if($doc->getElementsByTagName('msg')->item(0)) {
echo "- ".$domain." results: ".$doc->getElementsByTagName('msg')->item(0)->nodeValue."\n";
} else {
$status = "$domain response error\n";
} else {
echo "Domain renew status update on $domain not successful: "._cozaepp_message($coderes)."\n";
} else {
echo "- ".$domain." already has auto-renew disabled.\n";
} else {
echo "Domain info on $domain not successful: "._cozaepp_message($coderes)."\n";
} catch (Exception $e) {
echo("ERROR: ".$e->getMessage()."\n");
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment