Bernd Wurst commited on 2018-02-20 11:35:39
Zeige 3 geänderte Dateien mit 32 Einfügungen und 9 Löschungen.
| ... | ... |
@@ -158,9 +158,12 @@ function maybe_null($value) |
| 158 | 158 |
|
| 159 | 159 |
function logger($severity, $scriptname, $scope, $message) |
| 160 | 160 |
{
|
| 161 |
- if (config('logging') <= $severity)
|
|
| 161 |
+ if (config('logging') < $severity) {
|
|
| 162 |
+ DEBUG("NOT LOGGING $scriptname:$scope:$message");
|
|
| 162 | 163 |
return; |
| 164 |
+ } |
|
| 163 | 165 |
|
| 166 |
+ DEBUG("LOGGING $scriptname:$scope:$message");
|
|
| 164 | 167 |
$user = NULL; |
| 165 | 168 |
if ($_SESSION['role'] & ROLE_SYSTEMUSER) |
| 166 | 169 |
$user = $_SESSION['userinfo']['username']; |
| ... | ... |
@@ -97,8 +97,13 @@ function api_upload_domain($fqdn) |
| 97 | 97 |
} |
| 98 | 98 |
$args = array("domain" => $apidomain);
|
| 99 | 99 |
logger(LOG_INFO, "modules/domains/include/domainapi", "domains", "uploading domain »{$fqdn}«");
|
| 100 |
- api_request('domainUpdate', $args);
|
|
| 101 |
- |
|
| 100 |
+ $result = api_request('domainUpdate', $args);
|
|
| 101 |
+ if ($result['status'] == 'error') {
|
|
| 102 |
+ $msg = $result['errors'][0]['text']; |
|
| 103 |
+ logger(LOG_ERR, "modules/domains/include/domainapi", "domains", "ERROR uploading domain »{$fqdn}«: {$msg}");
|
|
| 104 |
+ system_failure("Es trat ein interner Fehler auf. Bitte dem Support Bescheid geben!");
|
|
| 105 |
+ } |
|
| 106 |
+ return $result; |
|
| 102 | 107 |
} |
| 103 | 108 |
|
| 104 | 109 |
|
| ... | ... |
@@ -155,7 +160,7 @@ function api_register_domain($domainname, $authinfo=NULL) |
| 155 | 160 |
} |
| 156 | 161 |
if ($result['status'] == 'error') {
|
| 157 | 162 |
$errstr = $result['errors'][0]['text']; |
| 158 |
- logger(LOG_ERR, "modules/domains/include/domainapi", "domains", "error registering domain: {$errstr}");
|
|
| 163 |
+ logger(LOG_ERR, "modules/domains/include/domainapi", "domains", "error registering domain $domainname: {$errstr}");
|
|
| 159 | 164 |
system_failure("Es trat ein interner Fehler auf. Bitte dem Support Bescheid geben!");
|
| 160 | 165 |
} |
| 161 | 166 |
return $result; |
| ... | ... |
@@ -185,8 +190,11 @@ function api_cancel_domain($domainname) |
| 185 | 190 |
logger(LOG_WARNING, "modules/domains/include/domainapi", "domains", "cancel domain »{$newdomainname}« at time {$apidomain['latestDeletionDateWithoutRenew']}");
|
| 186 | 191 |
$result = api_request('domainDelete', $args);
|
| 187 | 192 |
if ($result['status'] == 'error') {
|
| 188 |
- //system_failure(print_r($result['errors'], true)); |
|
| 193 |
+ $errstr = $result['errors'][0]['text']; |
|
| 194 |
+ logger(LOG_ERR, "modules/domains/include/domainapi", "domains", "error canceling domain $domainname: {$errstr}");
|
|
| 195 |
+ system_failure("Es trat ein interner Fehler auf. Bitte dem Support Bescheid geben!");
|
|
| 189 | 196 |
} |
| 197 |
+ return $result; |
|
| 190 | 198 |
} |
| 191 | 199 |
|
| 192 | 200 |
|
| ... | ... |
@@ -201,7 +209,13 @@ function api_unlock_domain($domainname) |
| 201 | 209 |
$apidomain['transferLockEnabled'] = false; |
| 202 | 210 |
$args = array("domain" => $apidomain);
|
| 203 | 211 |
logger(LOG_WARNING, "modules/domains/include/domainapi", "domains", "allow transfer for domain »{$domainname}«");
|
| 204 |
- api_request('domainUpdate', $args);
|
|
| 212 |
+ $result = api_request('domainUpdate', $args);
|
|
| 213 |
+ if ($result['status'] == 'error') {
|
|
| 214 |
+ $errstr = $result['errors'][0]['text']; |
|
| 215 |
+ logger(LOG_ERR, "modules/domains/include/domainapi", "domains", "error unlocking domain $domainname: {$errstr}");
|
|
| 216 |
+ system_failure("Es trat ein interner Fehler auf. Bitte dem Support Bescheid geben!");
|
|
| 217 |
+ } |
|
| 218 |
+ return $result; |
|
| 205 | 219 |
} |
| 206 | 220 |
|
| 207 | 221 |
|
| ... | ... |
@@ -88,10 +88,12 @@ function web_in_use($domain) |
| 88 | 88 |
function domain_ownerchange($fqdn, $owner, $admin_c) |
| 89 | 89 |
{
|
| 90 | 90 |
$cid = (int) $_SESSION['customerinfo']['customerno']; |
| 91 |
- db_query("UPDATE kundendaten.domains SET owner=?, admin_c=? WHERE CONCAT_WS('.', domainname, tld)=? AND kunde=?", array($owner, $admin_c, $fqdn, $cid));
|
|
| 92 |
- if (update_possible($fqdn)) {
|
|
| 91 |
+ $dom = new Domain( $fqdn ); |
|
| 92 |
+ db_query("UPDATE kundendaten.domains SET owner=?, admin_c=? WHERE id=? AND kunde=?", array($owner, $admin_c, $dom->id, $cid));
|
|
| 93 |
+ if (update_possible($dom->id)) {
|
|
| 93 | 94 |
require_once('domainapi.php');
|
| 94 |
- api_upload_domain($fqdn); |
|
| 95 |
+ DEBUG("Rufe Domain-API auf!");
|
|
| 96 |
+ api_upload_domain($dom->fqdn); |
|
| 95 | 97 |
} |
| 96 | 98 |
} |
| 97 | 99 |
|
| ... | ... |
@@ -100,18 +102,22 @@ function update_possible($domain) {
|
| 100 | 102 |
$dom = new Domain((int) $domain); |
| 101 | 103 |
if ($dom->provider != 'terions' || $dom->billing=='external') {
|
| 102 | 104 |
// Domain nicht über uns verwaltet |
| 105 |
+ DEBUG("Domain nicht über uns verwaltet!");
|
|
| 103 | 106 |
return false; |
| 104 | 107 |
} |
| 105 | 108 |
$result = db_query("SELECT aenderung_eigentuemer, ruecksprache FROM misc.domainpreise WHERE tld=?", array($dom->tld));
|
| 106 | 109 |
if ($result->rowCount() < 1) {
|
| 107 | 110 |
// Endung nicht bei uns in der Liste erfasst |
| 111 |
+ DEBUG("Endung nicht in der Preisliste!");
|
|
| 108 | 112 |
return false; |
| 109 | 113 |
} |
| 110 | 114 |
$data = $result->fetch(); |
| 111 | 115 |
if ($data['aenderung_eigentuemer'] != NULL || $data['ruecksprache'] == 'Y') {
|
| 116 |
+ DEBUG("Endung hat Eigenheiten (ruecksprache=Y)");
|
|
| 112 | 117 |
// Endung mit speziellen Eigenheiten |
| 113 | 118 |
return false; |
| 114 | 119 |
} |
| 120 |
+ DEBUG("Änderungen sollten möglich sein: {$dom->fqdn}");
|
|
| 115 | 121 |
return true; |
| 116 | 122 |
} |
| 117 | 123 |
|
| 118 | 124 |