From 412fc7ff686fb0294fbf207373b1792260e8b1db Mon Sep 17 00:00:00 2001
From: Charl Mert <cmert@lbsd.net>
Date: Wed, 2 Apr 2014 12:40:26 +0200
Subject: [PATCH] checking DomainSyncEnabled config option before running sync
 closes issue #6

---
 modules/registrars/cozaepp/cozaeppsync.php | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/registrars/cozaepp/cozaeppsync.php b/modules/registrars/cozaepp/cozaeppsync.php
index c276435..42f25f1 100644
--- a/modules/registrars/cozaepp/cozaeppsync.php
+++ b/modules/registrars/cozaepp/cozaeppsync.php
@@ -52,6 +52,16 @@ require_once ROOTDIR . '/includes/registrarfunctions.php';
 # Grab module parameters
 $params = getregistrarconfigoptions('cozaepp');
 
+# Grab the configuration setting for DomainSyncEnabled
+$query = "select value from tblconfiguration where setting = 'DomainSyncEnabled'";
+$res = mysql_query($query);
+$row = mysql_fetch_array($res);
+
+if (!empty($row) && !$row['value'] == 'on') {
+	echo("COZAEPP domain sync disabled due to system setting");
+	exit(0);
+}
+
 echo("COZA-EPP Domain Sync Report\n");
 echo("---------------------------------------------------\n");
 
-- 
GitLab