Logging eingebaut
Bernd Wurst

Bernd Wurst commited on 2018-02-20 11:35:39
Zeige 1 geänderte Dateien mit 7 Einfügungen und 0 Löschungen.

... ...
@@ -96,6 +96,7 @@ function api_upload_domain($fqdn)
96 96
         }
97 97
     }
98 98
     $args = array("domain" => $apidomain);
99
+    logger(LOG_INFO, "modules/domains/include/domainapi", "domains", "uploading domain »{$fqdn}«");
99 100
     api_request('domainUpdate', $args);
100 101
 
101 102
 }
... ...
@@ -145,12 +146,16 @@ function api_register_domain($domainname, $authinfo=NULL)
145 146
     $result = NULL;
146 147
     if ($dom['status'] == 'prereg') {
147 148
         $args = array("domain" => $newdomain);
149
+        logger(LOG_WARNING, "modules/domains/include/domainapi", "domains", "register new domain »{$newdomain['name']}«");
148 150
         $result = api_request('domainCreate', $args);
149 151
     } else {
150 152
         $args = array("domain" => $newdomain, "transferData" => array("authInfo" => $authinfo));
153
+        logger(LOG_WARNING, "modules/domains/include/domainapi", "domains", "transfer-in domain »{$newdomain['name']}« with authinfo »{$authinfo}«");
151 154
         $result = api_request('domainTransfer', $args);
152 155
     }
153 156
     if ($result['status'] == 'error') {
157
+        $errstr = $result['errors'][0]['text'];
158
+        logger(LOG_ERR, "modules/domains/include/domainapi", "domains", "error registering domain: {$errstr}");
154 159
         system_failure("Es trat ein interner Fehler auf. Bitte dem Support Bescheid geben!");
155 160
     }
156 161
     return $result;    
... ...
@@ -177,6 +182,7 @@ function api_cancel_domain($domainname)
177 182
         system_failure("Konnte Vertragsende nicht herausfinden.");
178 183
     }
179 184
     $args = array("domainName" => $domainname, "execDate" => $apidomain['latestDeletionDateWithoutRenew']);
185
+    logger(LOG_WARNING, "modules/domains/include/domainapi", "domains", "cancel domain »{$newdomainname}« at time {$apidomain['latestDeletionDateWithoutRenew']}");
180 186
     $result = api_request('domainDelete', $args);
181 187
     if ($result['status'] == 'error') {
182 188
         //system_failure(print_r($result['errors'], true));
... ...
@@ -194,6 +200,7 @@ function api_unlock_domain($domainname)
194 200
     $apidomain = $result['response'];
195 201
     $apidomain['transferLockEnabled'] = false;
196 202
     $args = array("domain" => $apidomain);
203
+    logger(LOG_WARNING, "modules/domains/include/domainapi", "domains", "allow transfer for domain »{$domainname}«");
197 204
     api_request('domainUpdate', $args);
198 205
 }
199 206
 
200 207