Commit 81e8ff51 authored by Scott's avatar Scott
Browse files

The scope of the namespaces that ZACR and this module can now support


has widened. Much of the code is also specific to the ZACR EPP registry
system.

Rename assets to better suit what the module does.

Signed-off-by: Scott's avatarScott Barr <scott@barr.co.za>
parent 3856725c
......@@ -36,8 +36,8 @@
* integration, customizations and consulting all available from
* http://allworldit.com
* Buzybuy - cozaepp Disable Auto Renew
* This script is a modification of the original cozaeppsync.php script from AllWorldIT combined with code from
* Buzybuy - zacr Disable Auto Renew
* This script is a modification of the original zacrsync.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.
......@@ -48,24 +48,24 @@
// This file brings in a few constants we need
require_once dirname(__FILE__) . '/../../../dbconnect.php';
// Setup include dir
$include_path = ROOTDIR . '/modules/registrars/cozaepp';
$include_path = ROOTDIR . '/modules/registrars/zacr';
set_include_path($include_path . PATH_SEPARATOR . get_include_path());
// Include EPP stuff we need
require_once 'cozaepp.php';
require_once 'zacr.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');
$params = getregistrarconfigoptions('zacr');
echo("COZA-EPP Domain Set Auto Renew To False Report\n");
echo("ZACR Domain Set Auto Renew To False Report\n");
echo("---------------------------------------------------\n");
// Request balance from registrar
try {
$client = _cozaepp_Client();
$client = _zacr_Client();
// Pull list of domains which are registered using this module
$queryresult = mysql_query("
......@@ -73,7 +73,7 @@ try {
domain
FROM
tbldomains
WHERE registrar = 'cozaepp'"
WHERE registrar = 'zacr'"
);
while($data = mysql_fetch_array($queryresult)) {
$domains[] = trim(strtolower($data['domain']));
......@@ -149,7 +149,7 @@ foreach ($domains as $domain) {
}
}
} else {
echo "Domain renew status update on $domain not successful: "._cozaepp_message($coderes)."\n";
echo "Domain renew status update on $domain not successful: "._zacr_message($coderes)."\n";
continue;
}
} else {
......@@ -157,7 +157,7 @@ foreach ($domains as $domain) {
continue;
}
} else {
echo "Domain info on $domain not successful: "._cozaepp_message($coderes)."\n";
echo "Domain info on $domain not successful: "._zacr_message($coderes)."\n";
continue;
}
......
<?php
/**
* AWIT COZAEPP - COZA EPP Module
* AWIT ZACR - COZA EPP Module
* Copyright (c) 2014, AllWorldIT
*
* This program is free software: you can redistribute it and/or modify
......@@ -23,17 +23,17 @@ if (!defined("WHMCS"))
die("This file cannot be accessed directly");
// Our global supported field list
$AWIT_COZAEPP_SUPPORTED_FIELDS = array(
$AWIT_ZACR_SUPPORTED_FIELDS = array(
"max_items"
);
// Addon configuration
function awit_cozaepp_config()
function awit_zacr_config()
{
// Configuration
$configarray = array(
"name" => "AWIT COZAEPP",
"name" => "AWIT ZACR",
"description" => "This module is to facilitate displaying of epp messages.",
"version" => "0.1",
"author" => "AllWorldIT",
......@@ -54,21 +54,21 @@ function awit_cozaepp_config()
function awit_cozaepp_get_config_custom_fields()
function awit_zacr_get_config_custom_fields()
{
global $AWIT_COZAEPP_SUPPORTED_FIELDS;
global $AWIT_ZACR_SUPPORTED_FIELDS;
// Query modules table
$table = "tbladdonmodules";
$fields = "setting,value";
$where = array( 'module' => 'awit_cozaepp' );
$where = array( 'module' => 'awit_zacr' );
$result = select_query($table,$fields,$where);
// Filter out the settings we need
$custom_fields = array();
while ($row = mysql_fetch_array($result)) {
// Check in our global list
if (in_array($row['setting'],$AWIT_COZAEPP_SUPPORTED_FIELDS)) {
if (in_array($row['setting'],$AWIT_ZACR_SUPPORTED_FIELDS)) {
$custom_fields[$row['setting']] = $row['value'];
}
}
......@@ -78,21 +78,21 @@ function awit_cozaepp_get_config_custom_fields()
function _awit_cozaepp_getMaxItems()
function _awit_zacr_getMaxItems()
{
$customFields = awit_cozaepp_get_config_custom_fields();
$customFields = awit_zacr_get_config_custom_fields();
return $customFields['max_items'];
}
// Addon activation
function awit_cozaepp_activate()
function awit_zacr_activate()
{
// Create Custom DB Table
$result = mysql_query("
CREATE TABLE `mod_awit_cozaepp_messages` (
CREATE TABLE `mod_awit_zacr_messages` (
`id` INT( 1 ) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`created` DATETIME NOT NULL,
`code` VARCHAR(10) NOT NULL,
......@@ -111,11 +111,11 @@ function awit_cozaepp_activate()
function awit_cozaepp_deactivate()
function awit_zacr_deactivate()
{
// Remove custom tables
$result1 = mysql_query("
DROP TABLE `mod_awit_cozaepp_messages`
DROP TABLE `mod_awit_zacr_messages`
");
if (!$result) {
......@@ -129,7 +129,7 @@ function awit_cozaepp_deactivate()
// Addon output
function awit_cozaepp_output($vars)
function awit_zacr_output($vars)
{
// Check if we have to display all records
if (isset($_POST['button']) && $_POST['button'] == 'Display All') {
......@@ -189,7 +189,7 @@ function awit_cozaepp_output($vars)
$orderClause = 'ORDER BY created DESC';
// Max amount of records to show per page
$recordMax = _awit_cozaepp_getMaxItems();
$recordMax = _awit_zacr_getMaxItems();
// Validation
if (!is_numeric($recordMax)) {
......@@ -226,7 +226,7 @@ function awit_cozaepp_output($vars)
SELECT
COUNT(*) AS cnt
FROM
mod_awit_cozaepp_messages
mod_awit_zacr_messages
%s %s
",
$whereClause,
......@@ -242,7 +242,7 @@ function awit_cozaepp_output($vars)
SELECT
*
FROM
mod_awit_cozaepp_messages
mod_awit_zacr_messages
%s %s %s
",
$whereClause,
......
<?php
$_ADDONLANG['intro'] = "AWIT COZAEPP Module";
$_ADDONLANG['intro'] = "AWIT ZACR Module";
$_ADDONLANG['description'] = "This module is to facilitate displaying of epp messages.";
$_ADDONLANG['documentation'] = "Pending..";
......
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