You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$soa_rec = $app->db->queryOneRecord("SELECT id AS zone, sys_userid, sys_groupid, sys_perm_user, sys_perm_group, sys_perm_other, server_id, ttl, serial FROM dns_soa WHERE active = 'Y' AND origin = ?", $this->dataRecord['domain'].'.');
289
-
if ( isset($soa_rec) ) {
289
+
if ( isset($soa_rec) && !empty($soa_rec) ) {
290
290
//* check for a dkim-record in the dns
291
291
$dns_data = $app->db->queryOneRecord("SELECT * FROM dns_rr WHERE name = ? AND sys_groupid = ?", $this->dataRecord['dkim_selector'].'._domainkey.'.$this->dataRecord['domain'].'.', $_SESSION["s"]["user"]['sys_groupid']);
292
-
if ( isset($dns_data) ) {
292
+
if ( isset($dns_data) && !empty($dns_data) ) {
293
293
$dns_data['data'] = 'v=DKIM1; t=s; p='.str_replace(array('-----BEGIN PUBLIC KEY-----','-----END PUBLIC KEY-----',"\r","\n"), '', $this->dataRecord['dkim_public']);
294
294
$dns_data['active'] = 'Y';
295
295
$dns_data['stamp'] = date('Y-m-d H:i:s');
@@ -346,7 +346,7 @@ function onBeforeUpdate() {
346
346
//* get domain-data from the db
347
347
$mail_data = $app->db->queryOneRecord("SELECT * FROM mail_domain WHERE domain = ?", $this->dataRecord['domain']);
$new_dns_data = $app->db->queryOneRecord("SELECT id AS zone, sys_userid, sys_groupid, sys_perm_user, sys_perm_group, sys_perm_other, server_id, ttl, serial FROM dns_soa WHERE active = 'Y' AND origin = ?", $mail_data['domain'].'.');
389
389
//* create a new record only if the dns-zone exists
390
-
if ( isset($new_dns_data) && $post_data['dkim'] == 'y' ) {
0 commit comments