Commit 5a990b1d authored by Florian Schaal's avatar Florian Schaal

resync-tool - better performance for dns-resync

parent 14f5a343
<?php
$wb["public_key_txt"] = 'Public-Key';
$wb["public_key_txt"] = 'öffentlicher Schlüssel';
$wb["ttl_txt"] = 'TTL';
$wb["active_txt"] = 'Aktiv';
$wb["record_exists_txt"] = 'DNS-Eintrag bereits vorhanden';
$wb["dkim_disabled_txt"] = 'DKIM st fuer diese Domain nicht aktiv.';
$wb["limit_dns_record_txt"] = 'Die max. Anzahl von DNS Eintraegen fuer den Account ist erreicht.';
$wb["dkim_disabled_txt"] = 'DKIM ist für diese Domain nicht aktiv.';
$wb["limit_dns_record_txt"] = 'Die max. Anzahl von DNS Eintraegen für den Account ist erreicht.';
$wb["no_zone_perm"] = 'Fehlende Berechtigung zum Hinzufuegen eines Eintrags zur DNS-Zone.';
$wb['ttl_range_error'] = 'Min. TTL time ist 60 Sekunden.';
$wb['selector_txt'] = 'DKIM-Selector';
......
<?php
$wb['data_txt'] = 'DMARC Record';
$wb['domain_txt'] = 'Domain';
$wb['dmarc_policy_txt'] = 'Mail Receiver Policy';
$wb['dmarc_policy_note_txt'] = 'How ISPs should handle messages that failed SPF or DKIM (DMARC).';
$wb['dmarc_policy_txt'] = 'Mail Empfänger Policy';
$wb['dmarc_policy_note_txt'] = 'Wie der empfangen Server Mails behandeln soll, bei denen SPF oder DKIM (DMARC) fehlschlägt.';
$wb['dmarc_policy_none_txt'] = 'none';
$wb['dmarc_policy_quarantine_txt'] = 'quarantine';
$wb['dmarc_policy_reject_txt'] = 'reject';
$wb['dmarc_rua_txt'] = 'Aggregate Data Reporting Address';
$wb['dmarc_rua_note_txt'] = 'Email to receive reports from ISPs aboute messages which failed DMARC checks for the domain (separated by whitespaces).';
$wb['dmarc_ruf_txt'] = 'Forensic Data Reporting Address';
$wb['dmarc_ruf_note_txt'] = 'Email to receive sample messages that are failing DMARC checks for the domain (separated by whitespaces).';
$wb['dmarc_fo_txt'] = 'Forensic reporting options';
$wb['dmarc_fo0_txt'] = "Generate reports if all underlying authentication mechanisms fail to produce a DMARC 'pass' result.";
$wb['dmarc_fo1_txt'] = 'Generate reports if any mechanisms fail.';
$wb['dmarc_fod_txt'] = 'Generate report if DKIM signature failed to verify.';
$wb['dmarc_fos_txt'] = 'Generate report if SPF failed.';
$wb['dmarc_rua_txt'] = "'Aggregate Data Reporting' Adresse";
$wb['dmarc_rua_note_txt'] = 'Email für Berichte ISPs für Mails mit fehlgeschlagenen DMARC-Checks (mehrere mit Leerzeichen trennen).';
$wb['dmarc_ruf_txt'] = "'Forensic Data Reporting' Adresse";
$wb['dmarc_ruf_note_txt'] = 'Email für Mails bei einem fehlgeschlagenen DMARC-Check (mehrere mit Leerzeichen trennen).';
$wb['dmarc_fo_txt'] = 'Forensic Report Optionen';
$wb['dmarc_fo0_txt'] = "Reports, wenn alle Authentifizierungen für DMARC fehlschlagen";
$wb['dmarc_fo1_txt'] = 'Reports, wenn eine Authentifizierung fehlschlägt.';
$wb['dmarc_fod_txt'] = 'Reports, wenn die DKIM-Überprüfung fehlschlägt.';
$wb['dmarc_fos_txt'] = 'Reports, wenn die SPF-Überprüfung fehlschlägt.';
$wb['dmarc_adkim_txt'] = 'DKIM identifier alignment';
$wb['dmarc_adkim_note_txt'] = "'strict' requires exact matching between DKIM domain and email's from";
$wb['dmarc_adkim_note_txt'] = "'strict' erfordert exakte Übereinstimmung zwischen DKIM der Domain und dem From-Header der Email";
$wb['dmarc_adkim_r_txt'] = 'relaxed';
$wb['dmarc_adkim_s_txt'] = 'strict';
$wb['dmarc_aspf_txt'] = 'SPF identifier alignment';
$wb['dmarc_aspf_note_txt'] = "'strict' requires exact matching between SPF domain and email's from";
$wb['dmarc_aspf_note_txt'] = "'strict' erfordert exakte Übereinstimmung zwischen dem SPF der Domain und dem From-Header der Email";
$wb['dmarc_aspf_r_txt'] = 'relaxed';
$wb['dmarc_aspf_s_txt'] = 'strict';
$wb['dmarc_rf_txt'] = 'Report Format';
......@@ -37,12 +37,12 @@ $wb['dmarc_sp_quarantine_txt'] = 'quarantine';
$wb['dmarc_sp_reject_txt'] = 'reject';
$wb['ttl_txt'] = 'TTL';
$wb['active_txt'] = 'Active';
$wb['dmarc_policy_error_txt'] = "Only policy 'none' is allowed without DKIM-signed emails.";
$wb['dmarc_no_dkim_txt'] = 'No active DKIM Record.';
$wb['dmarc_no_spf_txt'] = 'No active SPF Record.';
$wb['dmarc_more_spf_txt'] = 'More than one active SPF Record';
$wb['dmarc_invalid_email_txt'] = 'Invalid Email';
$wb['dmarc_empty_txt'] = 'DMARC Record empty - specify at least one option';
$wb['dmarc_policy_error_txt'] = "Nur die Policy 'none' ist ohne DKIM möglich.";
$wb['dmarc_no_dkim_txt'] = 'Kein aktiver DKIM Eintrag.';
$wb['dmarc_no_spf_txt'] = 'Kein aktiver SPF Eintrag.';
$wb['dmarc_more_spf_txt'] = 'Mehr als ein aktiver SPF-Eintrag.';
$wb['dmarc_invalid_email_txt'] = 'ungültige Email-Adresse';
$wb['dmarc_empty_txt'] = 'DMARC Record leer - mindestens eine Option auswählen';
$wb['record_exists_txt'] = 'DNS-Record already exists';
$wb['limit_dns_record_txt'] = 'The max. number of DNS records for your account is reached.';
$wb['no_zone_perm'] = 'You do not have the permission to add a record to this DNS zone.';
......
......@@ -4,10 +4,10 @@ $wb['domain_txt'] = 'Domain';
$wb['type_txt'] = 'Typ';
$wb['active_txt'] = 'Aktiv';
$wb["dkim_txt"] = 'DKIM aktivieren';
$wb["dkim_private_txt"] = 'DKIM Private-key';
$wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only';
$wb["dkim_generate_txt"] = 'erstelle DKIM Private-key';
$wb["dkim_dns_txt"] = 'DNS-Record';
$wb["dkim_private_txt"] = 'DKIM privater Schlüssel';
$wb["dkim_public_txt"] = 'DKIM öffentlicher Schlüssel';
$wb["dkim_generate_txt"] = 'erstelle DKIM Schlüssel';
$wb["dkim_dns_txt"] = 'DNS Eintrag';
$wb["dkim_private_key_error"] = 'ungueltiger DKIM-Private key';
$wb['domain_error_empty'] = 'Domain ist leer';
$wb['domain_error_unique'] = 'Doppelte Domain.';
......
......@@ -87,14 +87,17 @@ class page_action extends tform_actions {
'mail_domain' => array (
'index_field' => 'domain_id',
'server_type' => 'mail',
'server_id' => $server_id,
),
'mail_mailinglist' => array (
'index_field' => 'mailinglist_id',
'server_type' => 'mail',
'server_id' => $server_id,
),
'mail_user' => array (
'index_field' => 'mailuser_id',
'server_type' => 'mail',
'server_id' => $server_id,
),
);
}
......@@ -103,6 +106,7 @@ class page_action extends tform_actions {
'mail_access' => array (
'index_field' => 'access_id',
'server_type' => 'mail',
'server_id' => $server_id,
),
'mail_content_filter' => array (
'index_field' => 'content_filter_id',
......@@ -119,18 +123,22 @@ class page_action extends tform_actions {
'web_domain' => array (
'index_field' => 'domain_id',
'server_type' => 'web',
'server_id' => $server_id,
),
'shell_user' => array (
'index_field' => 'shell_user_id',
'server_type' => 'web',
'server_id' => $server_id,
),
'cron' => array (
'index_field' => 'id',
'server_type' => 'cron',
'server_id' => $server_id,
),
'ftp_user' => array (
'index_field' => 'ftp_user_id',
'server_type' => 'web',
'server_id' => $server_id,
),
);
}
......@@ -139,6 +147,7 @@ class page_action extends tform_actions {
'dns_soa' => array (
'index_field' => 'id',
'server_type' => 'dns',
'server_id' => $server_id,
),
);
}
......@@ -147,6 +156,7 @@ class page_action extends tform_actions {
'webdav_user' => array (
'index_field' => 'webdav_user_id',
'server_type' => 'file',
'server_id' => $server_id,
),
);
}
......@@ -155,6 +165,7 @@ class page_action extends tform_actions {
'web_database' => array (
'index_field' => 'web_database_id',
'server_type' => 'db',
'server_id' => $server_id,
),
);
}
......@@ -163,6 +174,7 @@ class page_action extends tform_actions {
'openvz_vm' => array (
'index_field' => 'vm_id',
'server_type' => 'vserver',
'server_id' => $server_id,
),
);
}
......@@ -170,7 +182,8 @@ class page_action extends tform_actions {
//* firewall
$array_out = array();
foreach($server_data as $db_table => $data) {
$records = $app->db->queryAllRecords("SELECT * FROM $db_table WHERE server_id = ?", $server_id);
$sql = @(isset($data['server_id']))?"SELECT * FROM $db_table WHERE server_id = $server_id":"SELECT * FROM $db_table";;
$records = $app->db->queryAllRecords($sql);
if (!empty($records)) array_push($array_out, $db_table);
}
......@@ -359,7 +372,7 @@ class page_action extends tform_actions {
}
//* fetch values during do_resync
private function query_server($db_table, $server_id, $server_type, $active=true) {
private function query_server($db_table, $server_id, $server_type, $active=true, $opt='') {
global $app;
$server_name = array();
......@@ -376,7 +389,7 @@ class page_action extends tform_actions {
unset($temp);
if ( isset($temp_id) ) $server_id = rtrim($temp_id,',');
$sql = "SELECT * FROM $db_table WHERE server_id IN (".$server_id.")";
$sql = "SELECT * FROM $db_table WHERE server_id IN (".$server_id.") ".$opt;
if ($active) $sql .= " AND active = 'y'";
$records = $app->db->queryAllRecords($sql);
......@@ -491,7 +504,7 @@ class page_action extends tform_actions {
$msg .= '<b>'.$app->tform->wordbook['do_dns_txt'].'</b><br>';
if(is_array($soa_records) && !empty($soa_records))
foreach($soa_records as $soa_rec) {
$temp = $this->query_server('dns_rr', $soa_rec['server_id'], $server_type);
$temp = $this->query_server('dns_rr', $soa_rec['server_id'], 'dns', true, "AND zone = ".$app->functions->intval($soa_rec['id']));
$rr_records = $temp[0];
if(!empty($rr_records)) {
foreach($rr_records as $rec) {
......@@ -503,7 +516,7 @@ class page_action extends tform_actions {
}
$new_serial = $app->validate_dns->increase_serial($soa_rec['serial']);
$app->db->datalogUpdate('dns_soa', "serial = '".$new_serial."'", 'id', $soa_rec['id']);
$msg .= '['.$server_name[$soa_rec['server_id']].'] '.$soa_rec['origin'].'<br>';
$msg .= '['.$server_name[$soa_rec['server_id']].'] '.$soa_rec['origin'].' ('.count($rr_records).')<br>';
}
else $msg .= $app->tform->wordbook['no_results_txt'].'<br>';
......
File mode changed from 100755 to 100644
Markdown is supported
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