Merge branch 'master' into 'master'
Master
See merge request !124
1 files deleted
71 files modified
4 files added
New file |
| | |
| | | ALTER TABLE `dns_rr` CHANGE `data` `data` TEXT NOT NULL DEFAULT ''; |
| | |
| | | `zone` int(11) unsigned NOT NULL DEFAULT '0', |
| | | `name` varchar(255) NOT NULL DEFAULT '', |
| | | `type` enum('A','AAAA','ALIAS','CNAME','HINFO','MX','NAPTR','NS','PTR','RP','SRV','TXT') default NULL, |
| | | `data` varchar(255) NOT NULL DEFAULT '', |
| | | `data` TEXT NOT NULL DEFAULT '', |
| | | `aux` int(11) unsigned NOT NULL default '0', |
| | | `ttl` int(11) unsigned NOT NULL default '86400', |
| | | `active` enum('N','Y') NOT NULL default 'Y', |
| | |
| | | -o smtp_send_xforward_command=yes |
| | | -o milter_default_action=accept |
| | | -o milter_macro_daemon_name=ORIGINATING |
| | | -o smtpd_milters=inet:127.0.0.1:4445 |
| | | |
| | |
| | | maildir_path=/var/vmail/[domain]/[localpart] |
| | | homedir_path=/var/vmail |
| | | dkim_path=/var/lib/amavis/dkim |
| | | dkim_strength=1024 |
| | | pop3_imap_daemon=courier |
| | | mail_filter_syntax=maildrop |
| | | mailuser_uid=5000 |
| | |
| | | enable_custom_login=n |
| | | mailboxlist_webmail_link=y |
| | | webmail_url=/webmail |
| | | dkim_path=/var/lib/amavis/dkim |
| | | |
| | | [monitor] |
| | | |
| | |
| | | * |
| | | * @return boolean - true if $POST contains a real key-file |
| | | */ |
| | | function validate_post($key, $value) { |
| | | function validate_post($key, $value, $dkim_strength) { |
| | | $value=str_replace(array("\n", "-----BEGIN RSA PRIVATE KEY-----", "-----END RSA PRIVATE KEY-----", " "), "", $value); |
| | | switch ($key) { |
| | | case 'public': |
| | | if (preg_match("/(^-----BEGIN PUBLIC KEY-----)[a-zA-Z0-9\r\n\/\+=]{1,221}(-----END PUBLIC KEY-----(\n|\r)?$)/", $value) === 1) { return true; } else { return false; } |
| | | break; |
| | | case 'private': |
| | | if (preg_match("/(^-----BEGIN RSA PRIVATE KEY-----)[a-zA-Z0-9\r\n\/\+=]{1,850}(-----END RSA PRIVATE KEY-----(\n|\r)?$)/", $value) === 1) { return true; } else { return false; } |
| | | if ( $dkim_strength == 1024 ) $range = "{812,816}"; |
| | | if ( $dkim_strength == 2048 ) $range = "{1588,1592}"; |
| | | if ( $dkim_strength == 4096 ) $range = "{3132,3136}"; |
| | | if ( preg_match("/^[a-zA-Z0-9\/\+=]".$range."$/", $value ) === 1) return true; else return false; |
| | | break; |
| | | } |
| | | } |
| | |
| | | 'width' => '40', |
| | | 'maxlength' => '255' |
| | | ), |
| | | 'dkim_strength' => array( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '1024', |
| | | 'value' => array('1024' => 'normal (1024)', '2048' => 'strong (2048)', '4096' => 'very strong (4096)') |
| | | ), |
| | | 'relayhost_password' => array( |
| | | 'datatype' => 'VARCHAR', |
| | | 'formtype' => 'TEXT', |
| | |
| | | $wb["vhost_rewrite_v6_txt"] = 'Rewrite IPv6 on Mirror'; |
| | | $wb["v6_prefix_length"] = 'Prefix zu lang fuer angegebene IPv6-Adresse '; |
| | | $wb['monitor_system_updates_txt'] = 'Suche nach Linux updates'; |
| | | $wb['dkim_strength_txt'] = 'DKIM Stärke'; |
| | | ?> |
| | |
| | | $wb['monitor_system_updates_txt'] = 'Check for Linux updates'; |
| | | $wb['php_handler_txt'] = "PHP Handler"; |
| | | $wb['disabled_txt'] = 'Disabled'; |
| | | $wb['dkim_strength_txt'] = 'DKIM strength'; |
| | | ?> |
| | |
| | | $wb['backup_mode_userzip'] = 'Copiar archivos del usuario web en un zip'; |
| | | $wb['backup_mode_rootgz'] = 'Copiar todos los archivos como usuario root'; |
| | | $wb['realtime_blackhole_list_txt'] = 'Real-time Blackhole List'; |
| | | $wb['realtime_blackhole_list_note_txt'] = '(Separar RBL's con comas)'; |
| | | $wb['realtime_blackhole_list_note_txt'] = "(Separar RBL's con comas)"; |
| | | $wb['ssl_settings_txt'] = 'Configuración SSL'; |
| | | $wb['permissions_txt'] = 'Permisos'; |
| | | $wb['php_settings_txt'] = 'Configuración de PHP'; |
| | |
| | | $wb['use_combobox_txt'] = 'Usar Combobox de jQuery UI'; |
| | | $wb['use_loadindicator_txt'] = 'Usar indicador de carga'; |
| | | $wb['f5_to_reload_js_txt'] = 'Si cambias esto, podrías tener que pulsar F5 para que tu navegador recargue las librerías JavaScript o vacíar la caché del navegador.'; |
| | | $wb['client_username_web_check_disabled_txt'] = 'Desactivar comprobación de la palabra 'web' en el nombre de cliente.'; |
| | | $wb['client_username_web_check_disabled_txt'] = "Desactivar comprobación de la palabra 'web' en el nombre de cliente."; |
| | | $wb['mailbox_show_autoresponder_tab_txt'] = 'Mostrar pestaña autoresponder en los detalles de la cuenta de correo'; |
| | | $wb['mailbox_show_mail_filter_tab_txt'] = 'Mostrar pestaña filtro de correo en los detalles de la cuenta de correo'; |
| | | $wb['mailbox_show_custom_rules_tab_txt'] = 'Mostrar pestaña filtros personalizados en los detalles de la cuenta de correo'; |
| | |
| | | $wb['ip_address_txt'] = 'Adresse IP'; |
| | | $wb['netmask_txt'] = 'Masque de réau'; |
| | | $wb['gateway_txt'] = 'Passerelle'; |
| | | $wb['hostname_txt'] = 'Hô; |
| | | $wb['hostname_txt'] = 'Hô'; |
| | | $wb['nameservers_txt'] = 'Serveurs de nom'; |
| | | $wb['auto_network_configuration_txt'] = 'Configuration du réau'; |
| | | $wb['website_basedir_txt'] = 'Rértoire de base web'; |
| | |
| | | $wb['init_script_txt'] = 'Nom du script Cron de lancement'; |
| | | $wb['crontab_dir_txt'] = 'Chemin des difféntes tables Cron'; |
| | | $wb['wget_txt'] = 'Chemin du programme wget'; |
| | | $wb['security_level_txt'] = 'Niveau de sérité |
| | | $wb['security_level_txt'] = 'Niveau de sérité'; |
| | | $wb['web_user_txt'] = 'Utilisateur Apache'; |
| | | $wb['web_group_txt'] = 'Groupe Apache'; |
| | | $wb['loglevel_txt'] = 'Loglevel'; |
| | |
| | | $wb['php_ini_path_apache_txt'] = 'Chemin php.ini Apache'; |
| | | $wb['check_apache_config_txt'] = 'Tester la configuration Apache au redérrage'; |
| | | $wb['ufw_enable_txt'] = 'Enable'; |
| | | $wb['ufw_manage_builtins_txt'] = 'Gér les Rées Intéé; |
| | | $wb['ufw_manage_builtins_txt'] = 'Gér les Rées Intéé'; |
| | | $wb['ufw_ipv6_txt'] = 'Activer l\'IPv6'; |
| | | $wb['ufw_default_input_policy_txt'] = 'Politique Entrant (Input) par déult'; |
| | | $wb['ufw_default_output_policy_txt'] = 'Politique Sortant (Output) par déult'; |
| | | $wb['ufw_default_forward_policy_txt'] = 'Politique de Forward par déult'; |
| | | $wb['ufw_default_application_policy_txt'] = 'Politique Application par déult'; |
| | | $wb['ufw_log_level_txt'] = 'Niveau de Log'; |
| | | $wb['network_config_warning_txt'] = 'L\'option de configuration du réau n'est disponible QUE pour les serveurs Debian et Ubuntu. NE PAS activer cette option si votre carte réau n'est pas en eth0.'; |
| | | $wb['network_config_warning_txt'] = "L\'option de configuration du réau n'est disponible QUE pour les serveurs Debian et Ubuntu. NE PAS activer cette option si votre carte réau n'est pas en eth0."; |
| | | $wb['CA_path_txt'] = 'Chemin CA'; |
| | | $wb['CA_pass_txt'] = 'Mot de passe CA'; |
| | | $wb['fastcgi_config_syntax_txt'] = 'FastCGI config syntax'; |
| | | $wb['server_type_txt'] = 'Type de Serveur'; |
| | | $wb['nginx_vhost_conf_dir_txt'] = 'Repertoire Nginx Vhost config'; |
| | | $wb['nginx_vhost_conf_enabled_dir_txt'] = 'Repertoire Nginx Vhost config activé |
| | | $wb['nginx_vhost_conf_enabled_dir_txt'] = 'Repertoire Nginx Vhost config activé'; |
| | | $wb['nginx_user_txt'] = 'Utilisateur Nginx'; |
| | | $wb['nginx_group_txt'] = 'Gorupe Nginx'; |
| | | $wb['nginx_cgi_socket_txt'] = 'Nginx CGI Socket'; |
| | |
| | | $wb['try_rescue_txt'] = 'Activer le service de monitoring et redérrer sur éec'; |
| | | $wb['do_not_try_rescue_mysql_txt'] = 'Déctiver le monitoring MySQL'; |
| | | $wb['do_not_try_rescue_mail_txt'] = 'Déctiver le monitoring Email'; |
| | | $wb['rescue_description_txt'] = '<b>Information:</b> Si vous voulez arreter mysql vous devez selectionner la case Déctiver le monitoring MySQL puis attendre 2 à minutes.<br>Si vous n'attendez pas 2 à minutes, rescue va tenter de redérrer mysql!'; |
| | | $wb['rescue_description_txt'] = "<b>Information:</b> Si vous voulez arreter mysql vous devez selectionner la case Déctiver le monitoring MySQL puis attendre 2 à minutes.<br>Si vous n'attendez pas 2 à minutes, rescue va tenter de redérrer mysql!"; |
| | | $wb['enable_sni_txt'] = 'Activer SNI'; |
| | | $wb['do_not_try_rescue_httpd_txt'] = 'Déctiver le monitoring HTTPD '; |
| | | $wb['set_folder_permissions_on_update_txt'] = 'Regler les permissions des dossiers lors de mise a jour'; |
| | |
| | | $wb['website_autoalias_txt'] = 'Auto alias Site web'; |
| | | $wb['website_autoalias_note_txt'] = 'Placeholders:'; |
| | | $wb['backup_mode_txt'] = 'Mode Sauvegarde'; |
| | | $wb['backup_mode_userzip'] = 'Sauvegarder les fichiers web dont l'utilisateur est propriéire en tant que zip'; |
| | | $wb['backup_mode_userzip'] = "Sauvegarder les fichiers web dont l'utilisateur est propriéire en tant que zip"; |
| | | $wb['backup_mode_rootgz'] = 'Sauvegarder tous les fichiers dans le repertoire web en tant qu\'utilisateur root'; |
| | | $wb['realtime_blackhole_list_txt'] = 'Blackhole (trou noir) List en temps ré'; |
| | | $wb['realtime_blackhole_list_note_txt'] = '(Separer les RBL avec des virgules)'; |
| | |
| | | $wb['web_folder_protection_txt'] = 'Rendre les dossiers web immuables (attributs éndus)'; |
| | | $wb['overtraffic_notify_admin_txt'] = 'Envoyer notification d\'overtraffic à\'admin'; |
| | | $wb['overtraffic_notify_client_txt'] = 'Envoyer notification d\'overtraffic au client'; |
| | | $wb['rbl_error_regex'] = 'Merci de renseigner des noms d'hô RBL valides.'; |
| | | $wb['rbl_error_regex'] = "Merci de renseigner des noms d'hô RBL valides."; |
| | | $wb['overquota_notify_admin_txt'] = 'Envoyer alertes quota à\'admin'; |
| | | $wb['overquota_notify_client_txt'] = 'Envoyer alertes quota au client'; |
| | | $wb['overquota_notify_onok_txt'] = 'Envoyer message quota ok au client'; |
| | |
| | | $wb['munin_url_error_regex'] = 'URL Munin non valide '; |
| | | $wb['munin_url_note_txt'] = 'Placeholder:'; |
| | | $wb['backup_dir_is_mount_txt'] = 'Repertoir de Backup/sauvegarde est un mount?'; |
| | | $wb['backup_dir_mount_cmd_txt'] = 'Commande Mount, si le repertoire de sauvegarde/backup n'est pas monté |
| | | $wb['backup_dir_mount_cmd_txt'] = "Commande Mount, si le repertoire de sauvegarde/backup n'est pas monté"; |
| | | $wb['monitor_system_updates_txt'] = 'Verifier pour des mises àour Linux'; |
| | | $wb['dkim_path_txt'] = 'Chemin DKIM'; |
| | | $wb["v6_prefix_txt"] = 'Prefix IPv6'; |
| | | $wb["vhost_rewrite_v6_txt"] = 'Récrire IPv6 sur miroir'; |
| | | $wb["v6_prefix_length"] = 'D\'aprèl'IPv6 déni, le préx est trop long '; |
| | | $wb["overquota_db_notify_admin_txt"] = 'Envoyer avertissement DB quota à\'admin'; |
| | | $wb["vhost_rewrite_v6_txt"] = "Récrire IPv6 sur miroir"; |
| | | $wb["v6_prefix_length"] = "D\'aprèl'IPv6 déni, le préx est trop long"; |
| | | $wb["overquota_db_notify_admin_txt"] = "Envoyer avertissement DB quota à\'admin'"; |
| | | $wb["overquota_db_notify_client_txt"] = 'Envoyer avertissement DB quota au client'; |
| | | ?> |
| | | |
| | |
| | | <input name="dkim_path" id="dkim_path" value="{tmpl_var name='dkim_path'}" size="40" maxlength="255" type="text" class="textInput" /> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name='dkim_strength_txt'}</p> |
| | | <div class="multiField"> |
| | | <select name="dkim_strength" id="dkim_strength" class="selectInput"> |
| | | {tmpl_var name='dkim_strength'} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name='pop3_imap_daemon_txt'}</p> |
| | | <div class="multiField"> |
| | | <select name="pop3_imap_daemon" id="pop3_imap_daemon" class="selectInput"> |
| | |
| | | if($_SESSION["s"]["user"]["typ"] != 'admin' && isset($this->dataRecord["client_group_id"])) { |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT client.client_id FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $group = $app->db->queryOneRecord("SELECT sys_group.groupid FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." AND sys_group.groupid = ".$this->dataRecord["client_group_id"]." ORDER BY client.company_name, client.contact_name, sys_group.name"; |
| | | $group = $app->db->queryOneRecord("SELECT sys_group.groupid FROM sys_group, client WHERE sys_group.client_id = client.client_id AND client.parent_client_id = ".$client['client_id']." AND sys_group.groupid = ".$this->dataRecord["client_group_id"]." ORDER BY client.company_name, client.contact_name, sys_group.name"); |
| | | $this->dataRecord["client_group_id"] = $group["groupid"]; |
| | | } |
| | | |
old mode 100644
new mode 100755
| | |
| | | alert("Error creating XMLHTTP-instance"); |
| | | return false; |
| | | } else { |
| | | var domain=encodeURIComponent(document.getElementById("domain").value) |
| | | var selector=encodeURIComponent(document.getElementById("dkim_selector").value) |
| | | var publickey=encodeURIComponent(document.getElementById("dkim_public").value) |
| | | var privatekey=encodeURIComponent(document.getElementById("dkim_private").value) |
| | | request.open('POST', 'mail/mail_domain_dkim_create.php', true); |
| | | request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); |
| | | request.send('domain='+value+'&action='+action+'&pkey='+privatekey); |
| | | request.send('domain='+domain+'&action='+action+'&dkim_selector='+selector+'&dkim_public='+publickey+'&dkim_private='+privatekey); |
| | | request.onreadystatechange = interpretRequest; |
| | | } |
| | | } |
| | |
| | | case 4: |
| | | if (request.status != 200) {alert("Request done but NOK\nError:"+request.status);} |
| | | else { |
| | | document.getElementsByName('dkim_selector')[0].value = request.responseXML.getElementsByTagName('selector')[0].firstChild.nodeValue; |
| | | document.getElementsByName('dkim_private')[0].value = request.responseXML.getElementsByTagName('privatekey')[0].firstChild.nodeValue; |
| | | document.getElementsByName('dkim_public')[0].value = request.responseXML.getElementsByTagName('publickey')[0].firstChild.nodeValue; |
| | | document.getElementsByName('dns_record')[0].value = request.responseXML.getElementsByTagName('dns_record')[0].firstChild.nodeValue; |
| | | document.getElementsByName('dkim_public')[0].value = request.responseXML.getElementsByTagName('publickey')[0].firstChild.nodeValue; |
| | | document.getElementsByName('dns_record')[0].value = request.responseXML.getElementsByTagName('dns_record')[0].firstChild.nodeValue; |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | |
| | | var serverType = jQuery('#dkim_private').val(); |
| | | setRequest('show','{tmpl_var name="domain"}',serverType); |
| | |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', |
| | | 'keyfield'=> 'server_id', |
| | | 'valuefield'=> 'server_name' |
| | | ), |
| | |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', |
| | | 'keyfield'=> 'server_id', |
| | | 'valuefield'=> 'server_name' |
| | | ), |
| | |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', |
| | | 'keyfield'=> 'server_id', |
| | | 'valuefield'=> 'server_name' |
| | | ), |
| | |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND mirror_servr_id = 0 AND {AUTHSQL} ORDER BY server_name', |
| | | 'keyfield'=> 'server_id', |
| | | 'valuefield'=> 'server_name' |
| | | ), |
| | |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE {AUTHSQL} ORDER BY server_name', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', |
| | | 'keyfield'=> 'server_id', |
| | | 'valuefield'=> 'server_name' |
| | | ), |
| | |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', |
| | | 'keyfield'=> 'server_id', |
| | | 'valuefield'=> 'server_name' |
| | | ), |
| | |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', |
| | | 'keyfield'=> 'server_id', |
| | | 'valuefield'=> 'server_name' |
| | | ), |
| | |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', |
| | | 'querystring' => 'SELECT server_id,server_name FROM server WHERE mail_server = 1 AND mirror_server_id = 0 AND {AUTHSQL} ORDER BY server_name', |
| | | 'keyfield'=> 'server_id', |
| | | 'valuefield'=> 'server_name' |
| | | ), |
| | |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9) up to 63 chars'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | ?> |
| | |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9) up to 63 chars'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | $wb['policy_txt'] = 'Спамфилтър'; |
| | |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9) up to 63 chars'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | ?> |
| | |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9) up to 63 chars'; |
| | | $wb['policy_txt'] = 'Spamový filtr'; |
| | | $wb['no_policy'] = '- nepovoleno -'; |
| | | ?> |
| | |
| | | $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 (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'ungueltiger DKIM-Private key'; |
| | | $wb['domain_error_empty'] = 'Domain ist leer'; |
| | | $wb['domain_error_unique'] = 'Doppelte Domain.'; |
| | |
| | | $wb['policy_txt'] = 'Spamfilter'; |
| | | $wb['no_policy'] = '- nicht aktiviert -'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Ungültiger DKIM-Selector. Verwenden Sie nur alphanumerische Zeichen (a-z oder 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Ungültiger DKIM-Selector. Verwenden Sie nur max. 63 alphanumerische Zeichen (a-z oder 0-9)'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | ?> |
| | |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb["domain_error_empty"] = 'Domain is empty.'; |
| | | $wb["domain_error_unique"] = 'Duplicate Domain.'; |
| | |
| | | $wb["no_policy"] = '- not enabled -'; |
| | | $wb['error_not_allowed_server_id'] = 'Chosen server is not allowed for this account.'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9) up to 63 chars'; |
| | | ?> |
| | |
| | | $wb["dkim_private_txt"] = 'Clave privada DKIM'; |
| | | $wb["dkim_public_txt"] = 'Clave pública DKIM\nsólo para información'; |
| | | $wb["dkim_generate_txt"] = 'Generar clave privada DKIM'; |
| | | $wb["dkim_dns_txt"] = 'Registro DNS (TYPE TXT)<br><br>añade este registro a tus DNS'; |
| | | $wb["dkim_dns_txt"] = 'Registro DNS'; |
| | | $wb["dkim_private_key_error"] = 'Clave privada DKIM no válida'; |
| | | $wb['dkim_selector_txt'] = 'Selector DKIM'; |
| | | $wb['dkim_selector_error'] = 'Selector DKIM no válido. Usar sólo caracteres alfanuméricos en minúsculas (a-z o 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Selector DKIM no válido. Usar sólo caracteres alfanuméricos en minúsculas (a-z o 0-9) up to 63 chars'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | ?> |
| | |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9) up to 63 chars'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | ?> |
| | |
| | | $wb['dkim_private_txt'] = 'ClérivéDKIM'; |
| | | $wb['dkim_public_txt'] = 'Cléublique DKIM\npour information seulement'; |
| | | $wb['dkim_generate_txt'] = 'Gérer la clérivéDKIM'; |
| | | $wb['dkim_dns_txt'] = 'Enregistrement DNS (TYPE TXT)<br><br>Ajouter l\'enregistrement àotre DNS'; |
| | | $wb['dkim_dns_txt'] = 'Enregistrement DNS'; |
| | | $wb['dkim_private_key_error'] = 'ClérivéDKIM invalide'; |
| | | $wb['dkim_settings_txt'] = 'DomainKeys Identified Mail (DKIM)'; |
| | | $wb['domain_error_empty'] = 'Le domaine est vide.'; |
| | |
| | | $wb['no_policy'] = '- inactif -'; |
| | | $wb['error_not_allowed_server_id'] = 'Le serveur choisi n\'est pas autoriséour ce compte.'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Selecteur DKIM non valide. Utiliser que des caractès alphanuméques minuscules (a-z et/oo 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Selecteur DKIM non valide. Utiliser que des caractès alphanuméques minuscules (a-z et/oo 0-9) up to 63 chars'; |
| | | ?> |
| | | |
| | |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9) up to 63 chars'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | ?> |
| | |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9) up to 63 chars'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | ?> |
| | |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9) up to 63 chars'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | ?> |
| | |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9) up to 63 chars'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | ?> |
| | |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['no_policy'] = '使わない'; |
| | | ?> |
| | |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9) up to 63 chars'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | ?> |
| | |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9) up to 63 chars'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | ?> |
| | |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9) up to 63 chars'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | ?> |
| | |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9) up to 63 chars'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | ?> |
| | |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9) up to 63 chars'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | $wb['no_policy'] = '- ej aktiverat -'; |
| | | ?> |
| | |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9) up to 63 chars'; |
| | | |
| | | $wb['policy_txt'] = 'Spamfilter'; |
| | | $wb['no_policy'] = '- Nie je aktivovaný -'; |
| | |
| | | $wb["dkim_private_txt"] = 'DKIM Private-key'; |
| | | $wb["dkim_public_txt"] = 'DKIM Public-key\nfor information only'; |
| | | $wb["dkim_generate_txt"] = 'Generate DKIM Private-key'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record (TYPE TXT)<br><br>add this record to your DNS'; |
| | | $wb["dkim_dns_txt"] = 'DNS-Record'; |
| | | $wb["dkim_private_key_error"] = 'Invalid DKIM-Private key'; |
| | | $wb['dkim_selector_txt'] = 'DKIM-Selector'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9)'; |
| | | $wb['dkim_selector_error'] = 'Invalid DKIM-Selector. Use only lower-case alphanumeric characters (a-z or 0-9) up to 63 chars'; |
| | | $wb["dkim_settings_txt"] = 'DomainKeys Identified Mail (DKIM)'; |
| | | ?> |
| | |
| | | /** |
| | | * This script is invoked by interface/js/mail_domain_dkim.js |
| | | * to generate or show the DKIM Private-key and to show the Private-key. |
| | | * returns DKIM Private-Key and DKIM Public-Key |
| | | * returns DKIM keys, selector, and dns-record |
| | | */ |
| | | |
| | | |
| | |
| | | require_once '../../lib/app.inc.php'; |
| | | require_once '../../lib/classes/validate_dkim.inc.php'; |
| | | |
| | | $validate_dkim=new validate_dkim (); |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('mail'); |
| | | |
| | | header('Content-Type: text/xml; charset=utf-8'); |
| | | header('Cache-Control: must-revalidate, pre-check=0, no-store, no-cache, max-age=0, post-check=0'); |
| | | |
| | | function validate_domain($domain) { |
| | | $regex = '/^[\w\.\-]{2,255}\.[a-zA-Z0-9\-]{2,30}$/'; |
| | | if ( preg_match($regex, $domain) === 1 ) return true; else return false; |
| | | } |
| | | |
| | | function validate_selector($selector) { |
| | | $regex = '/^[a-z0-9]{0,63}$/'; |
| | | if ( preg_match($regex, $selector) === 1 ) return true; else return false; |
| | | } |
| | | |
| | | /** |
| | | * This function fix PHP's messing up POST input containing characters space, dot, |
| | |
| | | return $public_key; |
| | | } |
| | | |
| | | function get_public_key($private_key) { |
| | | require_once('../../lib/classes/validate_dkim.inc.php'); |
| | | function get_public_key($private_key, $dkim_strength) { |
| | | $validate_dkim=new validate_dkim (); |
| | | if($validate_dkim->validate_post('private',$private_key)) { /* validate the $_POST-value */ |
| | | if($validate_dkim->validate_post('private', $private_key, $dkim_strength)) { /* validate the $_POST-value */ |
| | | exec('echo '.escapeshellarg($private_key).'|openssl rsa -pubout -outform PEM 2> /dev/null',$pubkey,$result); |
| | | $public_key=pub_key($pubkey); |
| | | } else { |
| | |
| | | return $public_key; |
| | | } |
| | | |
| | | $_POST=getRealPOST(); |
| | | /** |
| | | * This function updates the selector if a new key-pair was created |
| | | * and the selector is already used in the dns-record |
| | | * @param string $old_selector |
| | | * @return string selector |
| | | */ |
| | | function new_selector ($old_selector, $domain) { |
| | | global $app; |
| | | //* validate post-values |
| | | if ( validate_domain($domain) && validate_selector($old_selector) ) { |
| | | //* get active selectors from dns |
| | | $soa_rec = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE active = 'Y' AND origin = ?", $domain.'.'); |
| | | if ( isset($soa_rec) && !empty($soa_rec) ) { |
| | | //* check for a dkim-record in the dns? |
| | | $dns_data = $app->db->queryOneRecord("SELECT name FROM dns_rr WHERE name = ? AND active = 'Y'", $old_selector.'._domainkey.'.$domain.'.'); |
| | | $selector = str_replace( '._domainkey.'.$domain.'.', '', $dns_data['name']); |
| | | if ( $old_selector == $selector) { |
| | | $selector = substr($old_selector, 0, 53) . time(); //* add unix-timestamp to delimiter to allow old and new key in the dns |
| | | } else { |
| | | $selector = $old_selector; |
| | | } |
| | | } |
| | | } else { |
| | | $selector = 'invalid domain or selector'; |
| | | } |
| | | return $selector; |
| | | } |
| | | |
| | | //* get dkim-strength for server_id |
| | | $mail_server_id = $app->functions->intval( $app->db->queryOneRecord("SELECT server_id from mail_domain WHERE domain = ?", $_POST['domain']) ); |
| | | $dkim_strength = $app->functions->intval( $app->getconf->get_server_config($mail_server_id, 'mail')['dkim_strength'] ); |
| | | if ( empty($dkim_strength) ) $dkim_strength = 1024; |
| | | |
| | | switch ($_POST['action']) { |
| | | case 'create': /* create DKIM Private-key */ |
| | | exec('openssl rand -out /usr/local/ispconfig/server/temp/random-data.bin 4096 2> /dev/null', $output, $result); |
| | | exec('openssl genrsa -rand /usr/local/ispconfig/server/temp/random-data.bin 1024 2> /dev/null', $privkey, $result); |
| | | unlink("/usr/local/ispconfig/server/temp/random-data.bin"); |
| | | $_POST=getRealPOST(); |
| | | $rnd_val = $dkim_strength * 10; |
| | | exec('openssl rand -out ../../temp/random-data.bin '.$rnd_val.' 2> /dev/null', $output, $result); |
| | | exec('openssl genrsa -rand ../../temp/random-data.bin '.$dkim_strength.' 2> /dev/null', $privkey, $result); |
| | | unlink('../../temp/random-data.bin'); |
| | | foreach($privkey as $values) $private_key=$private_key.$values."\n"; |
| | | //* check the selector for updated dkim-settings only |
| | | if ( isset($_POST['dkim_public']) && !empty($_POST['dkim_public']) ) $selector = new_selector($_POST['dkim_selector'], $_POST['domain']); |
| | | break; |
| | | |
| | | case 'show': /* show the DNS-Record onLoad */ |
| | | $private_key=$_POST['pkey']; |
| | | $_POST=getRealPOST(); |
| | | $private_key=$_POST['dkim_private']; |
| | | break; |
| | | } |
| | | |
| | | $public_key=get_public_key($private_key); |
| | | $public_key=get_public_key($private_key, $dkim_strength); |
| | | $dns_record=str_replace(array('-----BEGIN PUBLIC KEY-----','-----END PUBLIC KEY-----',"\r","\n"),'',$public_key); |
| | | |
| | | if ( !isset($selector) ) { |
| | | if ( validate_selector($_POST['dkim_selector']) ) $selector=$_POST['dkim_selector']; |
| | | } |
| | | echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; |
| | | echo "<formatname>\n"; |
| | | echo "<selector>".$selector."</selector>\n"; |
| | | echo "<privatekey>".$private_key."</privatekey>\n"; |
| | | echo "<publickey>".$public_key."</publickey>\n"; |
| | | echo "<dns_record>v=DKIM1; t=s; p=".$dns_record."</dns_record>\n"; |
| | | if ( validate_domain($_POST['domain']) ) { |
| | | echo '<dns_record>'.$selector.'_domainkey.'.$_POST['domain'].'. 3600 TXT "v=DKIM1; t=s; p='.$dns_record.'"</dns_record>'; |
| | | } |
| | | echo "</formatname>\n"; |
| | | ?> |
| | |
| | | //* create dns-record with dkim-values if the zone exists |
| | | if ( (isset($this->dataRecord['dkim']) && $this->dataRecord['dkim'] == 'y') && (isset($this->dataRecord['active']) && $this->dataRecord['active'] == 'y') ) { |
| | | $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'].'.'); |
| | | if ( isset($soa_rec) ) { |
| | | if ( isset($soa_rec) && !empty($soa_rec) ) { |
| | | //* check for a dkim-record in the dns |
| | | $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']); |
| | | if ( isset($dns_data) ) { |
| | | if ( isset($dns_data) && !empty($dns_data) ) { |
| | | $dns_data['data'] = 'v=DKIM1; t=s; p='.str_replace(array('-----BEGIN PUBLIC KEY-----','-----END PUBLIC KEY-----',"\r","\n"), '', $this->dataRecord['dkim_public']); |
| | | $dns_data['active'] = 'Y'; |
| | | $dns_data['stamp'] = date('Y-m-d H:i:s'); |
| | |
| | | //* get domain-data from the db |
| | | $mail_data = $app->db->queryOneRecord("SELECT * FROM mail_domain WHERE domain = ?", $this->dataRecord['domain']); |
| | | |
| | | if ( isset($mail_data) ) { |
| | | if ( isset($mail_data) && !empty($mail_data) ) { |
| | | $post_data = $mail_data; |
| | | $post_data['dkim_selector'] = $this->dataRecord['dkim_selector']; |
| | | $post_data['dkim_public'] = $this->dataRecord['dkim_public']; |
| | |
| | | //* dkim-value changed |
| | | if ( $mail_data != $post_data ) { |
| | | //* get the dns-record for the public from the db |
| | | $dns_data = $app->db->queryOneRecord("SELECT * FROM dns_rr WHERE name = ? AND sys_groupid = ?'", $mail_data['dkim_selector'].'._domainkey.'.$mail_data['domain'].'.', $mail_data['sys_groupid']); |
| | | $dns_data = $app->db->queryOneRecord("SELECT * FROM dns_rr WHERE name = ? AND sys_groupid = ?", $mail_data['dkim_selector'].'._domainkey.'.$mail_data['domain'].'.', $mail_data['sys_groupid']); |
| | | |
| | | //* we modify dkim dns-values for active mail-domains only |
| | | if ( $post_data['active'] == 'y' ) { |
| | |
| | | } |
| | | } else $new_dns_data['active'] = 'N'; |
| | | |
| | | if ( isset($dns_data) && isset($new_dns_data) ) { |
| | | if ( isset($dns_data) && !empty($dns_data) && isset($new_dns_data) ) { |
| | | //* update dns-record |
| | | $new_dns_data['serial'] = $app->validate_dns->increase_serial($dns_data['serial']); |
| | | $app->db->datalogUpdate('dns_rr', $new_dns_data, 'id', $dns_data['id']); |
| | |
| | | //* create a new dns-record |
| | | $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'].'.'); |
| | | //* create a new record only if the dns-zone exists |
| | | if ( isset($new_dns_data) && $post_data['dkim'] == 'y' ) { |
| | | if ( isset($new_dns_data) && !empty($new_dns_data) && $post_data['dkim'] == 'y' ) { |
| | | $new_dns_data['name'] = $post_data['dkim_selector'].'._domainkey.'.$post_data['domain'].'.'; |
| | | $new_dns_data['type'] = 'TXT'; |
| | | $new_dns_data['data'] = 'v=DKIM1; t=s; p='.str_replace(array('-----BEGIN PUBLIC KEY-----','-----END PUBLIC KEY-----',"\r","\n"), '', $post_data['dkim_public']); |
old mode 100644
new mode 100755
| | |
| | | <div class="ctrlHolder"> |
| | | <label for="dkim_private">{tmpl_var name='dkim_private_txt'}</label> |
| | | <textarea name="dkim_private" id="dkim_private" rows='10' cols='30'>{tmpl_var name='dkim_private'}</textarea> |
| | | <a href="javascript:setRequest('create','{tmpl_var name='domain'}')">{tmpl_var name='dkim_generate_txt'}</a> |
| | | <a href="javascript:setRequest('create','{tmpl_var name='domain'}','{tmpl_var name='dkim_selector'}')">{tmpl_var name='dkim_generate_txt'}</a> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <textarea name="dkim_public" style="display:none;" id="dkim_public" rows='5' cols='30' readonly>{tmpl_var name='dkim_public'}</textarea> |
| | |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </fieldset> |
| | | |
| | | <input type="hidden" name="id" value="{tmpl_var name='id'}"> |
| | |
| | | <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onclick="loadContent('mail/mail_domain_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <script language="JavaScript" type="text/javascript" src="js/mail_domain_dkim.js"></script> |
New file |
| | |
| | | <?php |
| | | $form["title"] = "Resync Tool"; |
| | | $form["description"] = ""; |
| | | $form["name"] = "resync"; |
| | | $form["action"] = "resync_do.php"; |
| | | $form["db_history"] = "no"; |
| | | $form["tab_default"] = "resync"; |
| | | $form["list_default"] = "resync_show.php"; |
| | | $form["auth"] = 'yes'; |
| | | |
| | | $form["auth_preset"]["userid"] = 0; // 0 = id of the user, > 0 id must match with id of current user |
| | | $form["auth_preset"]["groupid"] = 0; // 0 = default groupid of the user, > 0 id must match with groupid of current user |
| | | $form["auth_preset"]["perm_user"] = 'riud'; //r = read, i = insert, u = update, d = delete |
| | | $form["auth_preset"]["perm_group"] = 'riud'; //r = read, i = insert, u = update, d = delete |
| | | $form["auth_preset"]["perm_other"] = ''; //r = read, i = insert, u = update, d = delete |
| | | |
| | | $form["tabs"]['resync'] = array ( |
| | | 'title' => "Resync", |
| | | 'width' => 100, |
| | | 'template' => "templates/resync.htm", |
| | | 'fields' => array ( |
| | | 'mail_server_id' => array ( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id FROM server WHERE mail_server = 1 AND mirror_server_id = 0 AND {AUTHSQL}', |
| | | 'keyfield'=> 'server_id', |
| | | 'valuefield'=> 'server_name' |
| | | ), |
| | | 'value' => '' |
| | | ), |
| | | 'web_server_id' => array ( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id FROM server WHERE web_server = 1 AND mirror_server_id = 0 AND {AUTHSQL}', |
| | | 'keyfield'=> 'server_id', |
| | | 'valuefield'=> 'server_name' |
| | | ), |
| | | 'value' => '' |
| | | ), |
| | | 'dns_server_id' => array ( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id FROM server WHERE dns_server = 1 AND mirror_server_id = 0 AND {AUTHSQL}', |
| | | 'keyfield'=> 'server_id', |
| | | 'valuefield'=> 'server_name' |
| | | ), |
| | | 'value' => '' |
| | | ), |
| | | 'file_server_id' => array ( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id FROM server WHERE file_server = 1 AND mirror_server_id = 0 AND {AUTHSQL}', |
| | | 'keyfield'=> 'server_id', |
| | | 'valuefield'=> 'server_name' |
| | | ), |
| | | 'value' => '' |
| | | ), |
| | | 'db_server_id' => array ( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id FROM server WHERE db_server = 1 AND mirror_server_id = 0 AND {AUTHSQL}', |
| | | 'keyfield'=> 'server_id', |
| | | 'valuefield'=> 'server_name' |
| | | ), |
| | | 'value' => '' |
| | | ), |
| | | 'vserver_server_id' => array ( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id FROM server WHERE vserver_server = 1 AND mirror_server_id = 0 AND {AUTHSQL}', |
| | | 'keyfield'=> 'server_id', |
| | | 'valuefield'=> 'server_name' |
| | | ), |
| | | 'value' => '' |
| | | ), |
| | | 'proxy_server_id' => array ( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id FROM server WHERE proxy_server = 1 AND mirror_server_id = 0 AND {AUTHSQL}', |
| | | 'keyfield'=> 'server_id', |
| | | 'valuefield'=> 'server_name' |
| | | ), |
| | | 'value' => '' |
| | | ), |
| | | 'firewall_server_id' => array ( |
| | | 'datatype' => 'INTEGER', |
| | | 'formtype' => 'SELECT', |
| | | 'default' => '', |
| | | 'datasource' => array ( 'type' => 'SQL', |
| | | 'querystring' => 'SELECT server_id FROM server WHERE firewall_server = 1 AND mirror_server_id = 0 AND {AUTHSQL}', |
| | | 'keyfield'=> 'server_id', |
| | | 'valuefield'=> 'server_name' |
| | | ), |
| | | 'value' => '' |
| | | ), |
| | | ) |
| | | ); |
| | | |
| | | |
| | | ?> |
| | |
| | | $wb['head_txt'] = 'Resync Tool'; |
| | | $wb['legend_txt'] = 'Resync'; |
| | | $wb['resync_sites_txt'] = 'Resync Websites'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP users'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP-Accounts'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_shell_txt'] = 'Resync shell users'; |
| | | $wb['resync_cron_txt'] = 'Resync cronjobs'; |
| | | $wb['resync_db_txt'] = 'Resync clientdb config'; |
| | | $wb['resync_db_txt'] = 'Resync Client Database config'; |
| | | $wb['resync_mailbox_txt'] = 'Resync Mailboxes'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_dns_txt'] = 'Resync DNS records'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Cancel'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | ?> |
| | |
| | | $wb['btn_start_txt'] = 'Стартирай'; |
| | | $wb['btn_cancel_txt'] = 'Отказ'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | ?> |
| | |
| | | $wb['head_txt'] = 'Resync Tool'; |
| | | $wb['legend_txt'] = 'Resync'; |
| | | $wb['resync_sites_txt'] = 'Resync Websites'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP users'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP-Accounts'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_shell_txt'] = 'Resync shell users'; |
| | | $wb['resync_cron_txt'] = 'Resync cronjobs'; |
| | | $wb['resync_db_txt'] = 'Resync clientdb config'; |
| | | $wb['resync_db_txt'] = 'Resync Client Database config'; |
| | | $wb['resync_mailbox_txt'] = 'Resync Mailboxes'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_dns_txt'] = 'Resync DNS records'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Cancel'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | ?> |
| | |
| | | $wb['btn_start_txt'] = 'Zahájit'; |
| | | $wb['btn_cancel_txt'] = 'Zrušit'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | ?> |
| | |
| | | $wb['resync_client_txt'] = 'Kunden'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Zurück'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Benutzer'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'Kein aktiver Serfer gefunden'; |
| | | ?> |
| | |
| | | $wb['head_txt'] = 'Resync Tool'; |
| | | $wb['legend_txt'] = 'Resync'; |
| | | $wb['resync_sites_txt'] = 'Resync Websites'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP users'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP-Accounts'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_shell_txt'] = 'Resync shell users'; |
| | | $wb['resync_cron_txt'] = 'Resync cronjobs'; |
| | | $wb['resync_db_txt'] = 'Resync clientdb config'; |
| | | $wb['resync_db_txt'] = 'Resync Client Database config'; |
| | | $wb['resync_mailbox_txt'] = 'Resync Mailboxes'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_dns_txt'] = 'Resync DNS records'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Cancel'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | ?> |
| | |
| | | $wb['head_txt'] = 'Resync Tool'; |
| | | $wb['legend_txt'] = 'Resync'; |
| | | $wb['resync_sites_txt'] = 'Resync Websites'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP users'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP-Accounts'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_shell_txt'] = 'Resync shell users'; |
| | | $wb['resync_cron_txt'] = 'Resync cronjobs'; |
| | | $wb['resync_db_txt'] = 'Resync clientdb config'; |
| | | $wb['resync_db_txt'] = 'Resync Client Database config'; |
| | | $wb['resync_mailbox_txt'] = 'Resync Mailboxes'; |
| | | $wb['resync_dkim_txt'] = 'Resync DKIM-Keys'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_dns_txt'] = 'Resync DNS records'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Cancel'; |
| | | ?> |
| | |
| | | $wb['btn_start_txt'] = 'Inicio'; |
| | | $wb['btn_cancel_txt'] = 'Cancelar'; |
| | | $wb['resync_client_txt'] = 'Resincronizar Clientes'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | ?> |
| | |
| | | $wb['head_txt'] = 'Resync Tool'; |
| | | $wb['legend_txt'] = 'Resync'; |
| | | $wb['resync_sites_txt'] = 'Resync Websites'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP users'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP-Accounts'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_shell_txt'] = 'Resync shell users'; |
| | | $wb['resync_cron_txt'] = 'Resync cronjobs'; |
| | | $wb['resync_db_txt'] = 'Resync clientdb config'; |
| | | $wb['resync_db_txt'] = 'Resync Client Database config'; |
| | | $wb['resync_mailbox_txt'] = 'Resync Mailboxes'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_dns_txt'] = 'Resync DNS records'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Cancel'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | ?> |
| | |
| | | $wb['btn_start_txt'] = 'Dérrer'; |
| | | $wb['btn_cancel_txt'] = 'Annuler'; |
| | | $wb['Resynchroniser_client_txt'] = 'Resynchroniser Enregisitrements Client'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | ?> |
| | | |
| | |
| | | $wb['head_txt'] = 'Resync Tool'; |
| | | $wb['legend_txt'] = 'Resync'; |
| | | $wb['resync_sites_txt'] = 'Resync Websites'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP users'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP-Accounts'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_shell_txt'] = 'Resync shell users'; |
| | | $wb['resync_cron_txt'] = 'Resync cronjobs'; |
| | | $wb['resync_db_txt'] = 'Resync clientdb config'; |
| | | $wb['resync_db_txt'] = 'Resync Client Database config'; |
| | | $wb['resync_mailbox_txt'] = 'Resync Mailboxes'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_dns_txt'] = 'Resync DNS records'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Cancel'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | ?> |
| | |
| | | $wb['head_txt'] = 'Resync Tool'; |
| | | $wb['legend_txt'] = 'Resync'; |
| | | $wb['resync_sites_txt'] = 'Resync Websites'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP users'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP-Accounts'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_shell_txt'] = 'Resync shell users'; |
| | | $wb['resync_cron_txt'] = 'Resync cronjobs'; |
| | | $wb['resync_db_txt'] = 'Resync clientdb config'; |
| | | $wb['resync_db_txt'] = 'Resync Client Database config'; |
| | | $wb['resync_mailbox_txt'] = 'Resync Mailboxes'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_dns_txt'] = 'Resync DNS records'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Cancel'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | ?> |
| | |
| | | $wb['head_txt'] = 'Resync Tool'; |
| | | $wb['legend_txt'] = 'Resync'; |
| | | $wb['resync_sites_txt'] = 'Resync Websites'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP users'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP-Accounts'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_shell_txt'] = 'Resync shell users'; |
| | | $wb['resync_cron_txt'] = 'Resync cronjobs'; |
| | | $wb['resync_db_txt'] = 'Resync clientdb config'; |
| | | $wb['resync_db_txt'] = 'Resync Client Database config'; |
| | | $wb['resync_mailbox_txt'] = 'Resync Mailboxes'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_dns_txt'] = 'Resync DNS records'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Cancel'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | ?> |
| | |
| | | $wb['head_txt'] = 'Resync Tool'; |
| | | $wb['legend_txt'] = 'Resync'; |
| | | $wb['resync_sites_txt'] = 'Resync Websites'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP users'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP-Accounts'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_shell_txt'] = 'Resync shell users'; |
| | | $wb['resync_cron_txt'] = 'Resync cronjobs'; |
| | | $wb['resync_db_txt'] = 'Resync clientdb config'; |
| | | $wb['resync_db_txt'] = 'Resync Client Database config'; |
| | | $wb['resync_mailbox_txt'] = 'Resync Mailboxes'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_dns_txt'] = 'Resync DNS records'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Cancel'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | ?> |
| | |
| | | $wb['head_txt'] = 'Resync Tool'; |
| | | $wb['legend_txt'] = 'Resync'; |
| | | $wb['resync_sites_txt'] = 'Resync Websites'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP users'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP-Accounts'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_shell_txt'] = 'Resync shell users'; |
| | | $wb['resync_cron_txt'] = 'Resync cronjobs'; |
| | | $wb['resync_db_txt'] = 'Resync clientdb config'; |
| | | $wb['resync_db_txt'] = 'Resync Client Database config'; |
| | | $wb['resync_mailbox_txt'] = 'Resync Mailboxes'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_dns_txt'] = 'Resync DNS records'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Cancel'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | ?> |
| | |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Anuluj'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | ?> |
| | |
| | | $wb['head_txt'] = 'Resync Tool'; |
| | | $wb['legend_txt'] = 'Resync'; |
| | | $wb['resync_sites_txt'] = 'Resync Websites'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP users'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP-Accounts'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_shell_txt'] = 'Resync shell users'; |
| | | $wb['resync_cron_txt'] = 'Resync cronjobs'; |
| | | $wb['resync_db_txt'] = 'Resync clientdb config'; |
| | | $wb['resync_db_txt'] = 'Resync Client Database config'; |
| | | $wb['resync_mailbox_txt'] = 'Resync Mailboxes'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_dns_txt'] = 'Resync DNS records'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Cancel'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | ?> |
| | |
| | | $wb['head_txt'] = 'Resync Tool'; |
| | | $wb['legend_txt'] = 'Resync'; |
| | | $wb['resync_sites_txt'] = 'Resync Websites'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP users'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP-Accounts'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_shell_txt'] = 'Resync shell users'; |
| | | $wb['resync_cron_txt'] = 'Resync cronjobs'; |
| | | $wb['resync_db_txt'] = 'Resync clientdb config'; |
| | | $wb['resync_db_txt'] = 'Resync Client Database config'; |
| | | $wb['resync_mailbox_txt'] = 'Resync Mailboxes'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_dns_txt'] = 'Resync DNS records'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Cancel'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | ?> |
| | |
| | | $wb['head_txt'] = 'Resync Tool'; |
| | | $wb['legend_txt'] = 'Resync'; |
| | | $wb['resync_sites_txt'] = 'Resync Websites'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP users'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP-Accounts'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_shell_txt'] = 'Resync shell users'; |
| | | $wb['resync_cron_txt'] = 'Resync cronjobs'; |
| | | $wb['resync_db_txt'] = 'Resync clientdb config'; |
| | | $wb['resync_db_txt'] = 'Resync Client Database config'; |
| | | $wb['resync_mailbox_txt'] = 'Resync Mailboxes'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_dns_txt'] = 'Resync DNS records'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Cancel'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | ?> |
| | |
| | | $wb['head_txt'] = 'Resync Tool'; |
| | | $wb['legend_txt'] = 'Resync'; |
| | | $wb['resync_sites_txt'] = 'Resync Websites'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP users'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP-Accounts'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_shell_txt'] = 'Resync shell users'; |
| | | $wb['resync_cron_txt'] = 'Resync cronjobs'; |
| | | $wb['resync_db_txt'] = 'Resync clientdb config'; |
| | | $wb['resync_db_txt'] = 'Resync Client Database config'; |
| | | $wb['resync_mailbox_txt'] = 'Resync Mailboxes'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_dns_txt'] = 'Resync DNS records'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Cancel'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | ?> |
| | |
| | | $wb['head_txt'] = 'Resync Tool'; |
| | | $wb['legend_txt'] = 'Resync'; |
| | | $wb['resync_sites_txt'] = 'Resync Websites'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP users'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP-Accounts'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_shell_txt'] = 'Resync shell users'; |
| | | $wb['resync_cron_txt'] = 'Resync cronjobs'; |
| | | $wb['resync_db_txt'] = 'Resync clientdb config'; |
| | | $wb['resync_db_txt'] = 'Resync Client Database config'; |
| | | $wb['resync_mailbox_txt'] = 'Resync Mailboxes'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_dns_txt'] = 'Resync DNS records'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Cancel'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | ?> |
| | |
| | | $wb['head_txt'] = 'Resync Tool'; |
| | | $wb['legend_txt'] = 'Resync'; |
| | | $wb['resync_sites_txt'] = 'Resync Websites'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP users'; |
| | | $wb['resync_ftp_txt'] = 'Resync FTP-Accounts'; |
| | | $wb['resync_webdav_txt'] = 'Resync WebDAV-Users'; |
| | | $wb['resync_shell_txt'] = 'Resync shell users'; |
| | | $wb['resync_cron_txt'] = 'Resync cronjobs'; |
| | | $wb['resync_db_txt'] = 'Resync clientdb config'; |
| | | $wb['resync_db_txt'] = 'Resync Client Database config'; |
| | | $wb['resync_mailbox_txt'] = 'Resync Mailboxes'; |
| | | $wb['resync_mail_txt'] = 'Resync Maildomains'; |
| | | $wb['resync_dns_txt'] = 'Resync DNS records'; |
| | | $wb['resync_vserver_txt'] = 'Resync vServer'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | $wb['resync_firewall_txt'] = 'Resync Firewall'; |
| | | $wb['resync_no_server_txt'] = 'No active server found'; |
| | | $wb['btn_start_txt'] = 'Start'; |
| | | $wb['btn_cancel_txt'] = 'Cancel'; |
| | | $wb['resync_client_txt'] = 'Resync Client records'; |
| | | ?> |
| | |
| | | |
| | | $items[] = array( 'title' => 'Resync', |
| | | 'target' => 'content', |
| | | 'link' => 'tools/resync.php'); |
| | | 'link' => 'tools/resync_show.php'); |
| | | |
| | | |
| | | $module['nav'][] = array( 'title' => 'Sync Tools', |
New file |
| | |
| | | <?php |
| | | /* |
| | | Copyright (c) 2014, Florian Schaal, info@schaal-24.de |
| | | All rights reserved. |
| | | |
| | | Redistribution and use in source and binary forms, with or without modification, |
| | | are permitted provided that the following conditions are met: |
| | | |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright notice, |
| | | this list of conditions and the following disclaimer in the documentation |
| | | and/or other materials provided with the distribution. |
| | | * Neither the name of ISPConfig nor the names of its contributors |
| | | may be used to endorse or promote products derived from this software without |
| | | specific prior written permission. |
| | | |
| | | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| | | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| | | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| | | IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, |
| | | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| | | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| | | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| | | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| | | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
| | | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| | | */ |
| | | |
| | | |
| | | /****************************************** |
| | | * Begin Form configuration |
| | | ******************************************/ |
| | | |
| | | $tform_def_file = 'form/resync.tform.php'; |
| | | |
| | | /****************************************** |
| | | * End Form configuration |
| | | ******************************************/ |
| | | |
| | | require_once '../../lib/config.inc.php'; |
| | | require_once '../../lib/app.inc.php'; |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('admin'); |
| | | |
| | | // Loading classes |
| | | $app->uses('tpl,tform,tform_actions'); |
| | | $app->load('tform_actions'); |
| | | |
| | | class page_action extends tform_actions { |
| | | |
| | | function onSubmit() { |
| | | global $app, $conf, $interfaceConf; |
| | | |
| | | function query_server($table, $server_id, $server_type, $where = "WHERE active = 'y'", $active_only = true) { |
| | | global $app; |
| | | $server_name = array(); |
| | | if ( $server_id <= 0 ) { //* resync multiple server |
| | | if ($active_only) { |
| | | $tmp = $app->db->queryAllRecords("SELECT server_id, server_name FROM server WHERE ".$server_type."_server = 1 AND active = 1 AND mirror_server_id = 0"); |
| | | } else { |
| | | $tmp = $app->db->queryAllRecords("SELECT server_id, server_name FROM server WHERE ".$server_type."_server = 1 AND mirror_server_id = 0"); |
| | | } |
| | | foreach ($tmp as $server) { |
| | | $tmp_id .= $server['server_id'].','; |
| | | $server_name[$server['server_id']] = $server['server_name']; |
| | | } |
| | | } else { |
| | | $server_name[$server_id] = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = ".$server_id)['server_name']; |
| | | } |
| | | |
| | | if ( isset($tmp_id) ) $server_id = rtrim($tmp_id,','); |
| | | |
| | | if ($active_only) { |
| | | $sql = "SELECT * FROM ".$table." ".$where." AND server_id IN (".$server_id.")"; |
| | | } else { |
| | | $sql = "SELECT * FROM ".$table." ".$where; |
| | | } |
| | | $records = $app->db->queryAllRecords($sql); |
| | | |
| | | return array($records, $server_name); |
| | | } |
| | | |
| | | //* websites |
| | | if(isset($this->dataRecord['resync_sites']) && $this->dataRecord['resync_sites'] == 1) { |
| | | $db_table = 'web_domain'; |
| | | $index_field = 'domain_id'; |
| | | $server_type = 'web'; |
| | | $server_id = $app->functions->intval($this->dataRecord['web_server_id']); |
| | | if ($server_id == -1) $tmp = query_server($db_table, $server_id, $server_type, 'WHERE 1', false); else $tmp = query_server($db_table, $server_id, $server_type); |
| | | $records = $tmp[0]; |
| | | $server_name = $tmp[1]; |
| | | unset($tmp); |
| | | $msg = '<b>Resynced Website:</b><br>'; |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true); |
| | | $msg .= $rec['domain'].' on '.$server_name[$rec['server_id']].'<br>'; |
| | | } |
| | | } else { $msg .= 'no results<bg>'; } |
| | | $msg .= '<br>'; |
| | | } |
| | | |
| | | //* ftp |
| | | if(isset($this->dataRecord['resync_ftp']) && $this->dataRecord['resync_ftp'] == 1) { |
| | | $db_table = 'ftp_user'; |
| | | $index_field = 'ftp_user_id'; |
| | | $server_type = 'web'; |
| | | $server_id = $app->functions->intval($this->dataRecord['ftp_server_id']); |
| | | if ($server_id == -1) $tmp = query_server($db_table, $server_id, $server_type, 'WHERE 1', false); else $tmp = query_server($db_table, $server_id, $server_type); |
| | | $records = $tmp[0]; |
| | | $server_name = $tmp[1]; |
| | | unset($tmp); |
| | | $msg .= '<b>Resynced FTP user:</b><br>'; |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true); |
| | | $msg .= $rec['username'].' on '.$server_name[$rec['server_id']].'<br>'; |
| | | } |
| | | } else { $msg .= 'no results<bg>'; } |
| | | $msg .= '<br>'; |
| | | } |
| | | |
| | | //* webdav |
| | | if(isset($this->dataRecord['resync_webdav']) && $this->dataRecord['resync_webdav'] == 1) { |
| | | $db_table = 'webdav_user'; |
| | | $index_field = 'webdav_user_id'; |
| | | $server_type = 'file'; |
| | | $server_id = $app->functions->intval($this->dataRecord['webdav_server_id']); |
| | | if ($server_id == -1) $tmp = query_server($db_table, $server_id, $server_type, 'WHERE 1', false); else $tmp = query_server($db_table, $server_id, $server_type); |
| | | $records = $tmp[0]; |
| | | $server_name = $tmp[1]; |
| | | unset($tmp); |
| | | $msg .= '<b>Resynced WebDav-User</b><br>'; |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true); |
| | | $msg .= $rec['username'].' on '.$server_name[$rec['server_id']].'<br>'; |
| | | } |
| | | } else { $msg .= 'no results<bg>'; } |
| | | $msg .= '<br>'; |
| | | } |
| | | |
| | | //* shell |
| | | if(isset($this->dataRecord['resync_shell']) && $this->dataRecord['resync_shell'] == 1) { |
| | | $db_table = 'shell_user'; |
| | | $index_field = 'shell_user_id'; |
| | | $server_type = 'web'; |
| | | $server_id = $app->functions->intval($this->dataRecord['shell_server_id']); |
| | | if ($server_id == -1) $tmp = query_server($db_table, $server_id, $server_type, 'WHERE 1', false); else $tmp = query_server($db_table, $server_id, $server_type); |
| | | $records = $tmp[0]; |
| | | $server_name = $tmp[1]; |
| | | unset($tmp); |
| | | $msg .= '<b>Resynced Shell user:</b><br>'; |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true); |
| | | $msg .= $rec['username'].' on '.$server_name[$rec['server_id']].'<br>'; |
| | | } |
| | | } else { $msg .= 'no results<bg>'; } |
| | | $msg .= '<br>'; |
| | | } |
| | | |
| | | //* cron |
| | | if(isset($this->dataRecord['resync_cron']) && $this->dataRecord['resync_cron'] == 1) { |
| | | $db_table = 'cron'; |
| | | $index_field = 'id'; |
| | | $server_type = 'web'; |
| | | $server_id = $app->functions->intval($this->dataRecord['cron_server_id']); |
| | | if ($server_id == -1) $tmp = query_server($db_table, $server_id, $server_type, 'WHERE 1', false); else $tmp = query_server($db_table, $server_id, $server_type); |
| | | $records = $tmp[0]; |
| | | $server_name = $tmp[1]; |
| | | unset($tmp); |
| | | $msg .= '<b>Resynced Cronjob:</b><br>'; |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true); |
| | | $msg .= $rec['command'].' on '.$server_name[$rec['server_id']].'<br>'; |
| | | } |
| | | } else { $msg .= 'no results<bg>'; } |
| | | $msg .= '<br>'; |
| | | } |
| | | |
| | | //* database |
| | | if(isset($this->dataRecord['resync_db']) && $this->dataRecord['resync_db'] == 1) { |
| | | $db_table = 'web_database_user'; |
| | | $index_field = 'database_user_id'; |
| | | $server_type = 'db'; |
| | | $server_id = $app->functions->intval($this->dataRecord['db_server_id']); |
| | | if ($server_id == -1) $tmp = query_server($db_table, $server_id, $server_type, 'WHERE 1', false); else $tmp = query_server($db_table, $server_id, $server_type, 'WHERE 1'); |
| | | $records = $tmp[0]; |
| | | $server_name = $tmp[1]; |
| | | unset($tmp); |
| | | $msg .= '<b>Resynced Database User:</b><br>'; |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true); |
| | | $msg .= $rec['database_user'].' on '.$server_name[$rec['server_id']].'<br>'; |
| | | } |
| | | } else { $msg .= 'no results<bg>'; } |
| | | $msg .= '<br>'; |
| | | |
| | | $db_table = 'web_database'; |
| | | $index_field = 'database_id'; |
| | | if ($server_id == -1) $tmp = query_server($db_table, $server_id, $server_type, 'WHERE 1', false); else $tmp = query_server($db_table, $server_id, $server_type); |
| | | $records = $tmp[0]; |
| | | $msg .= '<b>Resynced Database:</b><br>'; |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true); |
| | | $msg .= $rec['database_name'].' on '.$server_name[$rec['server_id']].'<br>'; |
| | | } |
| | | } else { $msg .= 'no results<bg>'; } |
| | | $msg .= '<br>'; |
| | | |
| | | } |
| | | |
| | | //* maildomains |
| | | if(isset($this->dataRecord['resync_mail']) && $this->dataRecord['resync_mail'] == 1) { |
| | | $db_table = 'mail_domain'; |
| | | $index_field = 'domain_id'; |
| | | $server_type = 'mail'; |
| | | $server_id = $app->functions->intval($this->dataRecord['mail_server_id']); |
| | | if ($server_id == -1) $tmp = query_server($db_table, $server_id, $server_type, 'WHERE 1', false); else $tmp = query_server($db_table, $server_id, $server_type); |
| | | $records = $tmp[0]; |
| | | $server_name = $tmp[1]; |
| | | unset($tmp); |
| | | $msg .= '<b>Resynced Maildomain:</b><br>'; |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true); |
| | | $msg .= $rec['domain'].' on '.$server_name[$rec['server_id']].'<br>'; |
| | | } |
| | | } else { $msg .= 'no results<bg>'; } |
| | | $msg .= '<br>'; |
| | | } |
| | | |
| | | //* mailbox |
| | | if(isset($this->dataRecord['resync_mailbox']) && $this->dataRecord['resync_mailbox'] == 1) { |
| | | $db_table = 'mail_user'; |
| | | $index_field = 'mailuser_id'; |
| | | $server_type = 'mail'; |
| | | $server_id = $app->functions->intval($this->dataRecord['mailbox_server_id']); |
| | | if ($server_id == -1) $tmp = query_server($db_table, $server_id, $server_type, 'WHERE 1', false); else $tmp = query_server($db_table, $server_id, $server_type); |
| | | $records = $tmp[0]; |
| | | $server_name = $tmp[1]; |
| | | unset($tmp); |
| | | $msg .= '<b>Resynced Mailbox:</b><br>'; |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true); |
| | | $msg .= $rec['email'].' on '.$server_name[$rec['server_id']].'<br>'; |
| | | } |
| | | } else { $msg .= 'no results<bg>'; } |
| | | $msg .= '<br>'; |
| | | |
| | | $db_table = 'mail_forwarding'; |
| | | $index_field = 'forwarding_id'; |
| | | if ($server_id == -1) $tmp = query_server($db_table, $server_id, $server_type, 'WHERE 1', false); else $tmp = query_server($db_table, $server_id, $server_type); |
| | | $records = $tmp[0]; |
| | | $server_name = $tmp[1]; |
| | | unset($tmp); |
| | | $msg .= '<b>Resynced Alias</b><br>'; |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true); |
| | | } |
| | | } else { $msg .= 'no results<bg>'; } |
| | | $msg .= '<br>'; |
| | | } |
| | | |
| | | //* dns |
| | | if(isset($this->dataRecord['resync_dns']) && $this->dataRecord['resync_dns'] == 1) { |
| | | $db_table = 'dns_soa'; |
| | | $index_field = 'id'; |
| | | $server_type = 'dns'; |
| | | $server_id = $app->functions->intval($this->dataRecord['dns_server_id']); |
| | | if ($server_id == -1) $tmp = query_server($db_table, $server_id, $server_type, 'WHERE 1', false); else $tmp = query_server($db_table, $server_id, $server_type, "WHERE active = 'Y'"); |
| | | $zone_records = $tmp[0]; |
| | | $server_name = $tmp[1]; |
| | | unset($tmp); |
| | | $msg .= '<b>Resynced DNS zone</b><br>'; |
| | | if(is_array($zone_records) && !empty($zone_records)) { |
| | | foreach($zone_records as $zone_rec) { |
| | | if ($server_id == -1) $records = query_server('dns_rr', $server_id, $server_type, 'WHERE 1', false)[0]; else $records = query_server('dns_rr', $server_id, $server_type, "WHERE active = 'Y'")[0]; |
| | | $rr_count = 0; |
| | | if (is_array($records)) { |
| | | foreach($records as $rec) { |
| | | $new_serial = $app->validate_dns->increase_serial($rec['serial']); |
| | | $app->db->datalogUpdate('dns_rr', "serial = '".$new_serial."'", 'id', $rec['id']); |
| | | $rr_count++; |
| | | } |
| | | } else { $msg .= 'no dns recordsesults<br>'; } |
| | | $new_serial = $app->validate_dns->increase_serial($zone_rec['serial']); |
| | | $app->db->datalogUpdate('dns_soa', "serial = '".$new_serial."'", 'id', $zone_rec['id']); |
| | | $msg .= $zone_rec['origin'].' on '.$server_name[$zone_rec['server_id']].' with '.$rr_count.' records<br>'; |
| | | } |
| | | } else { $msg .= 'no results<br>'; } |
| | | $msg .= '<br>'; |
| | | } |
| | | |
| | | //* clients |
| | | if(isset($this->dataRecord['resync_client']) && $this->dataRecord['resync_client'] == 1) { |
| | | $db_table = 'client'; |
| | | $index_field = 'client_id'; |
| | | $records = $app->db->queryAllRecords("SELECT * FROM ".$db_table); |
| | | $msg .= '<b>Resynced clients</b><br>'; |
| | | if(is_array($records)) { |
| | | $tform_def_file = '../client/form/client.tform.php'; |
| | | $app->uses('tpl,tform,tform_actions'); |
| | | $app->load('tform_actions'); |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true); |
| | | $tmp = new tform_actions; |
| | | $tmp->id = $rec[$index_field]; |
| | | $tmp->dataRecord = $rec; |
| | | $tmp->oldDataRecord = $rec; |
| | | $app->plugin->raiseEvent('client:client:on_after_update', $tmp); |
| | | $msg .= $rec['contact_name'].'<br>'; |
| | | unset($tmp); |
| | | } |
| | | } else { $msg .= 'no results<bg>'; } |
| | | $msg .= '<br>'; |
| | | } |
| | | |
| | | //* vserver |
| | | if(isset($this->dataRecord['resync_vserver']) && $this->dataRecord['resync_vserver'] == 1) { |
| | | $db_table = 'openvz_vm'; |
| | | $index_field = 'vm_id'; |
| | | $server_type = 'vserver'; |
| | | $server_id = $app->functions->intval($this->dataRecord['vserver_server_id']); |
| | | if ($server_id == -1) $tmp = query_server($db_table, $server_id, $server_type, 'WHERE 1', false); else $tmp = query_server($db_table, $server_id, $server_type); |
| | | $records = $tmp[0]; |
| | | $server_name = $tmp[1]; |
| | | unset($tmp); |
| | | $msg .= '<b>Resynced vServer:</b><br>'; |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true); |
| | | $msg .= $rec['hostname'].' on '.$server_name[$rec['server_id']].'<br>'; |
| | | } |
| | | } else { $msg .= 'no results<bg>'; } |
| | | $msg .= '<br>'; |
| | | } |
| | | |
| | | //* firewall |
| | | if(isset($this->dataRecord['resync_firewall']) && $this->dataRecord['resync_firewall'] == 1) { |
| | | $db_table = 'iptables'; |
| | | $index_field = 'iptables_id'; |
| | | $server_type = 'firewall'; |
| | | $server_id = $app->functions->intval($this->dataRecord['firewall_server_id']); |
| | | if ($server_id == -1) $tmp = query_server($db_table, $server_id, $server_type, 'WHERE 1', false); else $tmp = query_server($db_table, $server_id, $server_type); |
| | | $records = $tmp[0]; |
| | | $server_name = $tmp[1]; |
| | | unset($tmp); |
| | | $msg .= '<b>Resynced Firewall</b><br>'; |
| | | if(is_array($records)) { |
| | | foreach($records as $rec) { |
| | | $app->db->datalogUpdate($db_table, $rec, $index_field, $rec[$index_field], true); |
| | | } |
| | | } else { $msg .= 'no results<bg>'; } |
| | | $msg .= '<br>'; |
| | | } |
| | | |
| | | echo $msg; |
| | | } |
| | | |
| | | } |
| | | |
| | | $page = new page_action; |
| | | $page->onLoad(); |
| | | ?> |
New file |
| | |
| | | <?php |
| | | /* |
| | | Copyright (c) 2014, Florian Schaal, info@schaal-24.de |
| | | All rights reserved. |
| | | |
| | | Redistribution and use in source and binary forms, with or without modification, |
| | | are permitted provided that the following conditions are met: |
| | | |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright notice, |
| | | this list of conditions and the following disclaimer in the documentation |
| | | and/or other materials provided with the distribution. |
| | | * Neither the name of ISPConfig nor the names of its contributors |
| | | may be used to endorse or promote products derived from this software without |
| | | specific prior written permission. |
| | | |
| | | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| | | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| | | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| | | IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, |
| | | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| | | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| | | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| | | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| | | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
| | | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| | | */ |
| | | |
| | | |
| | | /****************************************** |
| | | * Begin Form configuration |
| | | ******************************************/ |
| | | |
| | | $tform_def_file = 'form/resync.tform.php'; |
| | | |
| | | /****************************************** |
| | | * End Form configuration |
| | | ******************************************/ |
| | | |
| | | require_once '../../lib/config.inc.php'; |
| | | require_once '../../lib/app.inc.php'; |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('admin'); |
| | | |
| | | // Loading classes |
| | | $app->uses('tpl,tform,tform_actions'); |
| | | $app->load('tform_actions'); |
| | | |
| | | class page_action extends tform_actions { |
| | | |
| | | function get_servers($type) { |
| | | global $app; |
| | | |
| | | $inactive_server = false; |
| | | $tmp = $app->db->queryAllRecords("SELECT server_id, server_name, active FROM server WHERE ".$type."_server = 1 AND mirror_server_id = 0 ORDER BY active DESC, server_name"); |
| | | foreach ($tmp as $server) { |
| | | if ( $server['active'] == '0' ) { |
| | | $server['server_name'] .= ' [inactive]'; |
| | | $inactive_server = true; |
| | | } |
| | | $options_servers .= "<option value='$server[server_id]'>$server[server_name]</option>"; |
| | | } |
| | | if ( count ($tmp) > 1 ) { |
| | | $options_servers = "<option value='0'>all active $type-server</option>" . $options_servers; |
| | | if ($inactive_server) $options_servers .= "<option value='-1'>force all $type-server</option>"; |
| | | } |
| | | |
| | | return $options_servers; |
| | | |
| | | } |
| | | |
| | | function onShowEnd() { |
| | | global $app, $conf; |
| | | |
| | | $servers = $this->get_servers('mail'); |
| | | $app->tpl->setVar('mail_server_id', $servers); |
| | | if ( !empty($servers) ) $app->tpl->setVar('mail_server_found', 1); |
| | | |
| | | $servers = $this->get_servers('web'); |
| | | $app->tpl->setVar('web_server_id', $servers); |
| | | $app->tpl->setVar('ftp_server_id', $servers); |
| | | if ( !empty($servers) ) $app->tpl->setVar('web_server_found', 1); |
| | | |
| | | $servers = $this->get_servers('dns'); |
| | | $app->tpl->setVar('dns_server_id', $servers); |
| | | if ( !empty($servers) ) $app->tpl->setVar('dns_server_found', 1); |
| | | |
| | | $servers = $this->get_servers('file'); |
| | | $app->tpl->setVar('file_server_id', $servers); |
| | | if ( !empty($servers) ) $app->tpl->setVar('file_server_found', 1); |
| | | |
| | | $servers = $this->get_servers('db'); |
| | | $app->tpl->setVar('db_server_id', $servers); |
| | | if ( !empty($servers) ) $app->tpl->setVar('db_server_found', 1); |
| | | |
| | | $servers = $this->get_servers('vserver'); |
| | | $app->tpl->setVar('vserver_server_id', $servers); |
| | | if ( !empty($servers) ) $app->tpl->setVar('vserver_server_found', 1); |
| | | |
| | | $servers = $this->get_servers('firewall'); |
| | | $app->tpl->setVar('firewall_server_id', $servers); |
| | | if ( !empty($servers) ) $app->tpl->setVar('firewall_server_found', 1); |
| | | |
| | | parent::onShowEnd(); |
| | | } |
| | | |
| | | } |
| | | |
| | | $page = new page_action; |
| | | $page->onLoad(); |
| | | |
| | | ?> |
| | |
| | | <h2><tmpl_var name="head_txt"></h2> |
| | | <h2><tmpl_var name="list_head_txt"></h2> |
| | | <p><tmpl_var name="list_desc_txt"></p> |
| | | |
| | | <div class="panel panel_language_import"> |
| | | |
| | | <div class="pnl_formsarea"> |
| | | <fieldset class="inlineLabels"><legend>{tmpl_var name="legend_txt"}</legend> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name="resync_sites_txt"}</p> |
| | | <div class="multiField"> |
| | | <input id="resync_sites" type="checkbox" value="1" name="resync_sites" /> |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name="resync_ftp_txt"}</p> |
| | | <div class="multiField"> |
| | | <input id="resync_ftp" type="checkbox" value="1" name="resync_ftp" /> |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name="resync_shell_txt"}</p> |
| | | <div class="multiField"> |
| | | <input id="resync_shell" type="checkbox" value="1" name="resync_shell" /> |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name="resync_cron_txt"}</p> |
| | | <div class="multiField"> |
| | | <input id="resync_cron" type="checkbox" value="1" name="resync_cron" /> |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name="resync_db_txt"}</p> |
| | | <div class="multiField"> |
| | | <input id="resync_db" type="checkbox" value="1" name="resync_db" /> |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name="resync_mailbox_txt"}</p> |
| | | <div class="multiField"> |
| | | <input id="resync_mailbox" type="checkbox" value="1" name="resync_mailbox" /> |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name="resync_dkim_txt"}</p> |
| | | <div class="multiField"> |
| | | <input id="resync_dkim" type="checkbox" value="1" name="resync_dkim" /> |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name="resync_dns_txt"}</p> |
| | | <div class="multiField"> |
| | | <input id="resync_dns" type="checkbox" value="1" name="resync_dns" /> |
| | | </div> |
| | | </div> |
| | | <div class="ctrlHolder"> |
| | | <p class="label">{tmpl_var name="resync_client_txt"}</p> |
| | | <div class="multiField"> |
| | | <input id="resync_client" type="checkbox" value="1" name="resync_client" /> |
| | | </div> |
| | | </div> |
| | | </fieldset> |
| | | <div class="panel panel_mail_domain"> |
| | | <div class="pnl_formsarea"> |
| | | <fieldset class="inlineLabels"> |
| | | <div class="ctrlHolder"> |
| | | <tmpl_if name="web_server_found"> |
| | | <input id="resync_sites" type="checkbox" value="1" name="resync_sites"> |
| | | <label for="resync_sites">{tmpl_var name='resync_sites_txt'}</label> |
| | | <select name="web_server_id" id="web_server_id" class="selectInput"> |
| | | {tmpl_var name='web_server_id'} |
| | | </select> |
| | | <tmpl_else> |
| | | <label for="resync_sites">{tmpl_var name="resync_sites_txt"}</label> |
| | | <span style="color:red"> |
| | | <strong>{tmpl_var name="resync_no_server_txt"}</strong> |
| | | </span> |
| | | </tmpl_if> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <tmpl_if name="msg"> |
| | | <div id="OKMsg"><p><tmpl_var name="msg"></p></div> |
| | | </tmpl_if> |
| | | <tmpl_if name="error"> |
| | | <div id="errorMsg"><h3>ERROR</h3><ol><tmpl_var name="error"></ol></div> |
| | | </tmpl_if> |
| | | <fieldset class="inlineLabels"> |
| | | <div class="ctrlHolder"> |
| | | <tmpl_if name="web_server_found"> |
| | | <input id="resync_ftp" type="checkbox" value="1" name="resync_ftp"> |
| | | <label for="resync_ftp">{tmpl_var name="resync_ftp_txt"}</label> |
| | | <select name="ftp_server_id" id="ftp_server_id" class="selectInput"> |
| | | {tmpl_var name='ftp_server_id'} |
| | | </select> |
| | | <tmpl_else> |
| | | <label for="resync_ftp">{tmpl_var name="resync_ftp_txt"}</label> |
| | | <span style="color:red"> |
| | | <strong>{tmpl_var name="resync_no_server_txt"}</strong> |
| | | </span> |
| | | </tmpl_if> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <input type="hidden" name="id" value="{tmpl_var name='id'}"> |
| | | <fieldset class="inlineLabels"> |
| | | <div class="ctrlHolder"> |
| | | <tmpl_if name="file_server_found"> |
| | | <input id="resync_webdav" type="checkbox" value="1" name="resync_webdav"> |
| | | <label for="resync_webdav">{tmpl_var name="resync_webdav_txt"}</label> |
| | | <select name="webdav_server_id" id="webdav_server_id" class="selectInput"> |
| | | {tmpl_var name='file_server_id'} |
| | | </select> |
| | | <tmpl_else> |
| | | <label for="resync_webdav">{tmpl_var name="resync_webdav_txt"}</label> |
| | | <span style="color:red"> |
| | | <strong>{tmpl_var name="resync_no_server_txt"}</strong> |
| | | </span> |
| | | </tmpl_if> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <div class="buttonHolder buttons"> |
| | | <button class="positive iconstxt icoPositive" type="button" value="Import" onClick="submitForm('pageForm','tools/resync.php');"><span>{tmpl_var name="btn_start_txt"}</span></button> |
| | | <button class="negative iconstxt icoNegative" type="button" value="Cancel" onClick="loadContent('tools/index.php');"><span>{tmpl_var name="btn_cancel_txt"}</span></button> |
| | | </div> |
| | | </div> |
| | | |
| | | <fieldset class="inlineLabels"> |
| | | <div class="ctrlHolder"> |
| | | <tmpl_if name="web_server_found"> |
| | | <input id="resync_shell" type="checkbox" value="1" name="resync_shell"> |
| | | <label for="resync_shell">{tmpl_var name="resync_shell_txt"}</label> |
| | | <select name="shell_server_id" id="shell_server_id" class="selectInput"> |
| | | {tmpl_var name='web_server_id'} |
| | | </select> |
| | | <tmpl_else> |
| | | <label for="resync_shell">{tmpl_var name="resync_shell_txt"}</label> |
| | | <span style="color:red"> |
| | | <strong>{tmpl_var name="resync_no_server_txt"}</strong> |
| | | </span> |
| | | </tmpl_if> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <fieldset class="inlineLabels"> |
| | | <div class="ctrlHolder"> |
| | | <tmpl_if name="web_server_found"> |
| | | <input id="resync_cron" type="checkbox" value="1" name="resync_cron"> |
| | | <label for="resync_cron">{tmpl_var name="resync_cron_txt"}</label> |
| | | <select name="cron_server_id" id="cron_server_id" class="selectInput"> |
| | | {tmpl_var name='web_server_id'} |
| | | </select> |
| | | <tmpl_else> |
| | | <label for="resync_cron">{tmpl_var name="resync_cron_txt"}</label> |
| | | <span style="color:red"> |
| | | <strong>{tmpl_var name="resync_no_server_txt"}</strong> |
| | | </span> |
| | | </tmpl_if> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <fieldset class="inlineLabels"> |
| | | <div class="ctrlHolder"> |
| | | <tmpl_if name="db_server_found"> |
| | | <input id="resync_db" type="checkbox" value="1" name="resync_db"> |
| | | <label for="resync_db">{tmpl_var name="resync_db_txt"}</label> |
| | | <select name="db_server_id" id="db_server_id" class="selectInput"> |
| | | {tmpl_var name='db_server_id'} |
| | | </select> |
| | | <tmpl_else> |
| | | <label for="resync_db">{tmpl_var name="resync_db_txt"}</label> |
| | | <span style="color:red"> |
| | | <strong>{tmpl_var name="resync_no_server_txt"}</strong> |
| | | </span> |
| | | </tmpl_if> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <fieldset class="inlineLabels"> |
| | | <div class="ctrlHolder"> |
| | | <tmpl_if name="mail_server_found"> |
| | | <input id="resync_mail" type="checkbox" value="1" name="resync_mail"> |
| | | <label for="resync_mail">{tmpl_var name="resync_mail_txt"}</label> |
| | | <select name="mail_server_id" id="mail_server_id" class="selectInput"> |
| | | {tmpl_var name='mail_server_id'} |
| | | </select> |
| | | <tmpl_else> |
| | | <label for="resync_mail">{tmpl_var name="resync_mail_txt"}</label> |
| | | <span style="color:red"> |
| | | <strong>{tmpl_var name="resync_no_server_txt"}</strong> |
| | | </span> |
| | | </tmpl_if> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <fieldset class="inlineLabels"> |
| | | <div class="ctrlHolder"> |
| | | <tmpl_if name="mail_server_found"> |
| | | <input id="resync_mailbox" type="checkbox" value="1" name="resync_mailbox"> |
| | | <label for="resync_mailbox">{tmpl_var name="resync_mailbox_txt"}</label> |
| | | <select name="mailbox_server_id" id="mailbox_server_id" class="selectInput"> |
| | | {tmpl_var name='mail_server_id'} |
| | | </select> |
| | | <tmpl_else> |
| | | <label for="resync_mailbox">{tmpl_var name="resync_mailbox_txt"}</label> |
| | | <span style="color:red"> |
| | | <strong>{tmpl_var name="resync_no_server_txt"}</strong> |
| | | </span> |
| | | </tmpl_if> |
| | | </div> |
| | | |
| | | <fieldset class="inlineLabels"> |
| | | <div class="ctrlHolder"> |
| | | <tmpl_if name="dns_server_found"> |
| | | <input id="resync_dns" type="checkbox" value="1" name="resync_dns"> |
| | | <label for="resync_dns">{tmpl_var name="resync_dns_txt"}</label> |
| | | <select name="dns_server_id" id="dns_server_id" class="selectInput"> |
| | | {tmpl_var name='dns_server_id'} |
| | | </select> |
| | | <tmpl_else> |
| | | <label for="resync_dns">{tmpl_var name="resync_dns_txt"}</label> |
| | | <span style="color:red"> |
| | | <strong>{tmpl_var name="resync_no_server_txt"}</strong> |
| | | </span> |
| | | </tmpl_if> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <fieldset class="inlineLabels"> |
| | | <div class="ctrlHolder"> |
| | | <tmpl_if name="vserver_server_found"> |
| | | <input id="resync_vserver" type="checkbox" value="1" name="resync_vserver"> |
| | | <label for="resync_vserver">{tmpl_var name="resync_vserver_txt"}</label> |
| | | <select name="vserver_server_id" id="vserver_server_id" class="selectInput"> |
| | | {tmpl_var name='vserver_server_id'} |
| | | </select> |
| | | <tmpl_else> |
| | | <label for="resync_vserver">{tmpl_var name="resync_vserver_txt"}</label> |
| | | <span style="color:red"> |
| | | <strong>{tmpl_var name="resync_no_server_txt"}</strong> |
| | | </span> |
| | | </tmpl_if> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <fieldset class="inlineLabels"> |
| | | <div class="ctrlHolder"> |
| | | <tmpl_if name="firewall_server_found"> |
| | | <input id="resync_firewall" type="checkbox" value="1" name="resync_firewall"> |
| | | <label for="resync_firewall">{tmpl_var name="resync_firewall_txt"}</label> |
| | | <select name="firewall_server_id" id="firewall_server_id" class="selectInput"> |
| | | {tmpl_var name='firewall_server_id'} |
| | | </select> |
| | | <tmpl_else> |
| | | <label for="resync_firewall">{tmpl_var name="resync_firewall_txt"}</label> |
| | | <span style="color:red"> |
| | | <strong>{tmpl_var name="resync_no_server_txt"}</strong> |
| | | </span> |
| | | </tmpl_if> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <fieldset class="inlineLabels"> |
| | | <div class="ctrlHolder"> |
| | | <input id="resync_client" type="checkbox" value="1" name="resync_client"> |
| | | <label for="resync_client">{tmpl_var name="resync_client_txt"}</label> |
| | | </div> |
| | | </fieldset> |
| | | |
| | | <input type="hidden" name="id" value="{tmpl_var name='id'}"> |
| | | |
| | | <div class="buttonHolder buttons"> |
| | | <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onclick="submitForm('pageForm','tools/resync_do.php');"> |
| | | <span>{tmpl_var name='btn_save_txt'}</span> |
| | | </button> |
| | | <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onclick="loadContent('tools/resync.php');"> |
| | | <span>{tmpl_var name='btn_cancel_txt'}</span> |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | |
| | | //* When we can use 60-dkim for the dkim-keys create the file if it does not exists. |
| | | if (substr_compare($amavis_configfile, '60-dkim', -7) === 0 && !file_exists($amavis_configfile)) |
| | | $app->system->file_put_contents($amavis_configfile, ''); |
| | | $app->system->touch($amavis_configfile); |
| | | |
| | | if ( $amavis_configfile == '' || !is_writeable($amavis_configfile) ) { |
| | | $app->log('Amavis-config not found or not writeable.', LOGLEVEL_ERROR); |
| | |
| | | $app->system->chown($mail_config['dkim_path'], $amavis_user); |
| | | } else { |
| | | mkdir($mail_config['dkim_path'], 0755, true); |
| | | $app->log('No user amavis or vscan found - using root for '.$mail_config['dkim_path'] |
| | | , LOGLEVEL_WARNING); |
| | | $app->log('No user amavis or vscan found - using root for '.$mail_config['dkim_path'], LOGLEVEL_WARNING); |
| | | } |
| | | } |
| | | |
| | |
| | | //* If we are using seperate config-files with amavis remove existing keys from 50-user to avoid duplicate keys |
| | | if (substr_compare($amavis_configfile, '60-dkim', -7) === 0) { |
| | | $temp_configfile = str_replace('60-dkim', '50-user', $amavis_configfile); |
| | | $temp_config = $app->system->file_get_contents($temp_configfile); |
| | | $temp_config = $app->system->file_get_contents($temp_configfile, true); |
| | | if (preg_match($search_regex, $temp_config)) { |
| | | $temp_config = preg_replace($search_regex, '', $temp_config)."\n"; |
| | | $app->system->file_put_contents($temp_configfile, $temp_config); |
| | | $app->system->file_put_contents($temp_configfile, $temp_config, true); |
| | | } |
| | | unset($temp_configfile); |
| | | unset($temp_config); |
| | | } |
| | | |
| | | $key_value="dkim_key('".$key_domain."', '".$selector."', '".$mail_config['dkim_path']."/".$key_domain.".private');\n"; |
| | | $amavis_config = $app->system->file_get_contents($amavis_configfile); |
| | | $amavis_config = $app->system->file_get_contents($amavis_configfile, true); |
| | | $amavis_config = preg_replace($search_regex, '', $amavis_config).$key_value; |
| | | |
| | | if ( $app->system->file_put_contents($amavis_configfile, $amavis_config) ) { |
| | | if ( $app->system->file_put_contents($amavis_configfile, $amavis_config, true) ) { |
| | | $app->log('Adding DKIM Private-key to amavis-config.', LOGLEVEL_DEBUG); |
| | | $restart = true; |
| | | } else { |
| | |
| | | |
| | | $restart = false; |
| | | $amavis_configfile = $this->get_amavis_config(); |
| | | $amavis_config = $app->system->file_get_contents($amavis_configfile); |
| | | $amavis_config = $app->system->file_get_contents($amavis_configfile, true); |
| | | |
| | | $search_regex = "/(\n|\r)?dkim_key.*".$key_domain.".*(\n|\r)?/"; |
| | | |
| | | if (preg_match($search_regex, $amavis_config)) { |
| | | $amavis_config = preg_replace($search_regex, '', $amavis_config); |
| | | $app->system->file_put_contents($amavis_configfile, $amavis_config); |
| | | $app->system->file_put_contents($amavis_configfile, $amavis_config, true); |
| | | $app->log('Deleted the DKIM settings from amavis-config for '.$key_domain.'.', LOGLEVEL_DEBUG); |
| | | $restart = true; |
| | | } |
| | |
| | | //* If we are using seperate config-files with amavis remove existing keys from 50-user, too |
| | | if (substr_compare($amavis_configfile, '60-dkim', -7) === 0) { |
| | | $temp_configfile = str_replace('60-dkim', '50-user', $amavis_configfile); |
| | | $temp_config = $app->system->file_get_contents($temp_configfile); |
| | | $temp_config = $app->system->file_get_contents($temp_configfile, true); |
| | | if (preg_match($search_regex, $temp_config)) { |
| | | $temp_config = preg_replace($search_regex, '', $temp_config); |
| | | $app->system->file_put_contents($temp_configfile, $temp_config); |
| | | $app->system->file_put_contents($temp_configfile, $temp_config, true); |
| | | $restart = true; |
| | | } |
| | | unset($temp_configfile); |