diff --git a/LICENSE b/LICENSE
index 139b12fc1fcc916a8a9a604e292c6238cca759ef..0624f7491f52d731c03efcf59e1ddfc01ead0ed3 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2007-2016, Till Brehm, ISPConfig UG
+Copyright (c) 2007-2017, Till Brehm, ISPConfig UG
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
diff --git a/install/dist/conf/centos52.conf.php b/install/dist/conf/centos52.conf.php
index 12044d3ce07d36d42e166c961c4939b4d82ba01f..77462bd7f4a1cb8392832853a8af10308205a30b 100644
--- a/install/dist/conf/centos52.conf.php
+++ b/install/dist/conf/centos52.conf.php
@@ -118,6 +118,10 @@ $conf['mailman']['installed'] = false; // will be detected automatically during
$conf['mailman']['config_dir'] = '/etc/mailman';
$conf['mailman']['init_script'] = 'mailman';
+//* mlmmj
+$conf['mlmmj']['installed'] = false; // will be detected automatically during installation
+$conf['mlmmj']['config_dir'] = '/etc/mlmmj';
+
//* Getmail
$conf['getmail']['installed'] = false; // will be detected automatically during installation
$conf['getmail']['config_dir'] = '/etc/getmail';
diff --git a/install/dist/conf/centos53.conf.php b/install/dist/conf/centos53.conf.php
index 12044d3ce07d36d42e166c961c4939b4d82ba01f..77462bd7f4a1cb8392832853a8af10308205a30b 100644
--- a/install/dist/conf/centos53.conf.php
+++ b/install/dist/conf/centos53.conf.php
@@ -118,6 +118,10 @@ $conf['mailman']['installed'] = false; // will be detected automatically during
$conf['mailman']['config_dir'] = '/etc/mailman';
$conf['mailman']['init_script'] = 'mailman';
+//* mlmmj
+$conf['mlmmj']['installed'] = false; // will be detected automatically during installation
+$conf['mlmmj']['config_dir'] = '/etc/mlmmj';
+
//* Getmail
$conf['getmail']['installed'] = false; // will be detected automatically during installation
$conf['getmail']['config_dir'] = '/etc/getmail';
diff --git a/install/dist/conf/centos70.conf.php b/install/dist/conf/centos70.conf.php
index a40e88ed70e50d7d0bdffaa6a4235b1b96d0fe48..c3076c4aab5c8fb531bbe898d683aff0341d1dac 100644
--- a/install/dist/conf/centos70.conf.php
+++ b/install/dist/conf/centos70.conf.php
@@ -118,6 +118,10 @@ $conf['mailman']['installed'] = false; // will be detected automatically during
$conf['mailman']['config_dir'] = '/etc/mailman';
$conf['mailman']['init_script'] = 'mailman';
+//* mlmmj
+$conf['mlmmj']['installed'] = false; // will be detected automatically during installation
+$conf['mlmmj']['config_dir'] = '/etc/mlmmj';
+
//* Getmail
$conf['getmail']['installed'] = false; // will be detected automatically during installation
$conf['getmail']['config_dir'] = '/etc/getmail';
diff --git a/install/dist/conf/centos72.conf.php b/install/dist/conf/centos72.conf.php
index e7ab6030b7210051697de71425724ceaac4a1119..b6cbcabe216328f736d22ef4b0b12f24b5ef0c6b 100644
--- a/install/dist/conf/centos72.conf.php
+++ b/install/dist/conf/centos72.conf.php
@@ -118,6 +118,10 @@ $conf['mailman']['installed'] = false; // will be detected automatically during
$conf['mailman']['config_dir'] = '/etc/mailman';
$conf['mailman']['init_script'] = 'mailman';
+//* mlmmj
+$conf['mlmmj']['installed'] = false; // will be detected automatically during installation
+$conf['mlmmj']['config_dir'] = '/etc/mlmmj';
+
//* Getmail
$conf['getmail']['installed'] = false; // will be detected automatically during installation
$conf['getmail']['config_dir'] = '/etc/getmail';
diff --git a/install/dist/conf/debian40.conf.php b/install/dist/conf/debian40.conf.php
index 613c828d14906474fbda3a3b475508e5b8b2f997..a85841e4ff6c6d40b53cd70880313f0c2a867245 100644
--- a/install/dist/conf/debian40.conf.php
+++ b/install/dist/conf/debian40.conf.php
@@ -120,6 +120,10 @@ $conf['mailman']['installed'] = false; // will be detected automatically during
$conf['mailman']['config_dir'] = '/etc/mailman';
$conf['mailman']['init_script'] = 'mailman';
+//* mlmmj
+$conf['mlmmj']['installed'] = false; // will be detected automatically during installation
+$conf['mlmmj']['config_dir'] = '/etc/mlmmj';
+
//* Getmail
$conf['getmail']['installed'] = false; // will be detected automatically during installation
$conf['getmail']['config_dir'] = '/etc/getmail';
diff --git a/install/dist/conf/debian60.conf.php b/install/dist/conf/debian60.conf.php
index 2c26dcb9cbb26ae89f1126ce15440471485b028a..a7ea1364563909c56a86fd3d305fd92a00667d98 100644
--- a/install/dist/conf/debian60.conf.php
+++ b/install/dist/conf/debian60.conf.php
@@ -120,6 +120,10 @@ $conf['mailman']['installed'] = false; // will be detected automatically during
$conf['mailman']['config_dir'] = '/etc/mailman';
$conf['mailman']['init_script'] = 'mailman';
+//* mlmmj
+$conf['mlmmj']['installed'] = false; // will be detected automatically during installation
+$conf['mlmmj']['config_dir'] = '/etc/mlmmj';
+
//* Getmail
$conf['getmail']['installed'] = false; // will be detected automatically during installation
$conf['getmail']['config_dir'] = '/etc/getmail';
diff --git a/install/dist/conf/debian90.conf.php b/install/dist/conf/debian90.conf.php
index cdaf7aa9a0f1bba39ea7d0ec367e0c0f36d9a4f0..d7c70de8706139ff4497138f5076163460882ba5 100644
--- a/install/dist/conf/debian90.conf.php
+++ b/install/dist/conf/debian90.conf.php
@@ -1,7 +1,7 @@
diff --git a/install/dist/conf/debiantesting.conf.php b/install/dist/conf/debiantesting.conf.php
index 92787bf428c441fdfae359ce967b6a813e42cd53..fdf83109180774a634922c994a92938f60484f5d 100644
--- a/install/dist/conf/debiantesting.conf.php
+++ b/install/dist/conf/debiantesting.conf.php
@@ -120,6 +120,10 @@ $conf['mailman']['installed'] = false; // will be detected automatically during
$conf['mailman']['config_dir'] = '/etc/mailman';
$conf['mailman']['init_script'] = 'mailman';
+//* mlmmj
+$conf['mlmmj']['installed'] = false; // will be detected automatically during installation
+$conf['mlmmj']['config_dir'] = '/etc/mlmmj';
+
//* Getmail
$conf['getmail']['installed'] = false; // will be detected automatically during installation
$conf['getmail']['config_dir'] = '/etc/getmail';
diff --git a/install/dist/conf/fedora9.conf.php b/install/dist/conf/fedora9.conf.php
index 80539a78593827e76bb7828ee684833f557b9dd7..85121e7c841658e39935ba6548ada4c8a105f2dc 100644
--- a/install/dist/conf/fedora9.conf.php
+++ b/install/dist/conf/fedora9.conf.php
@@ -118,6 +118,10 @@ $conf['mailman']['installed'] = false; // will be detected automatically during
$conf['mailman']['config_dir'] = '/etc/mailman';
$conf['mailman']['init_script'] = 'mailman';
+//* mlmmj
+$conf['mlmmj']['installed'] = false; // will be detected automatically during installation
+$conf['mlmmj']['config_dir'] = '/etc/mlmmj';
+
//* Getmail
$conf['getmail']['installed'] = false; // will be detected automatically during installation
$conf['getmail']['config_dir'] = '/etc/getmail';
diff --git a/install/dist/conf/gentoo.conf.php b/install/dist/conf/gentoo.conf.php
index 2955cfa71dd391743f705449ea6849428005a367..83a487f29097df9d68cbfea369d63ccbcac72fd4 100644
--- a/install/dist/conf/gentoo.conf.php
+++ b/install/dist/conf/gentoo.conf.php
@@ -131,6 +131,10 @@ $conf['mailman']['installed'] = false; // will be detected automatically during
$conf['mailman']['config_dir'] = '/etc/mailman';
$conf['mailman']['init_script'] = 'mailman';
+//* mlmmj
+$conf['mlmmj']['installed'] = false; // will be detected automatically during installation
+$conf['mlmmj']['config_dir'] = '/etc/mlmmj';
+
//* Getmail
$conf['getmail']['installed'] = false; // will be detected automatically during installation
$conf['getmail']['user'] = 'getmail';
diff --git a/install/dist/conf/opensuse110.conf.php b/install/dist/conf/opensuse110.conf.php
index e389c3b2a0ea727d619b453c477ef0a8f0964122..909a53aba0ecf727e4da0004b148fdae8b0bb5f6 100644
--- a/install/dist/conf/opensuse110.conf.php
+++ b/install/dist/conf/opensuse110.conf.php
@@ -118,6 +118,10 @@ $conf['mailman']['installed'] = false; // will be detected automatically during
$conf['mailman']['config_dir'] = '/etc/mailman';
$conf['mailman']['init_script'] = 'mailman';
+//* mlmmj
+$conf['mlmmj']['installed'] = false; // will be detected automatically during installation
+$conf['mlmmj']['config_dir'] = '/etc/mlmmj';
+
//* Getmail
$conf['getmail']['installed'] = false; // will be detected automatically during installation
$conf['getmail']['config_dir'] = '/etc/getmail';
diff --git a/install/dist/conf/opensuse112.conf.php b/install/dist/conf/opensuse112.conf.php
index fa0504652e9e75d908186507a6c69c67c271f4b9..648a9222e4c092c1ac4b091569a0b141d9c2aeb2 100644
--- a/install/dist/conf/opensuse112.conf.php
+++ b/install/dist/conf/opensuse112.conf.php
@@ -118,6 +118,10 @@ $conf['mailman']['installed'] = false; // will be detected automatically during
$conf['mailman']['config_dir'] = '/etc/mailman';
$conf['mailman']['init_script'] = 'mailman';
+//* mlmmj
+$conf['mlmmj']['installed'] = false; // will be detected automatically during installation
+$conf['mlmmj']['config_dir'] = '/etc/mlmmj';
+
//* Getmail
$conf['getmail']['installed'] = false; // will be detected automatically during installation
$conf['getmail']['config_dir'] = '/etc/getmail';
diff --git a/install/dist/conf/ubuntu1604.conf.php b/install/dist/conf/ubuntu1604.conf.php
index 92787bf428c441fdfae359ce967b6a813e42cd53..fdf83109180774a634922c994a92938f60484f5d 100644
--- a/install/dist/conf/ubuntu1604.conf.php
+++ b/install/dist/conf/ubuntu1604.conf.php
@@ -120,6 +120,10 @@ $conf['mailman']['installed'] = false; // will be detected automatically during
$conf['mailman']['config_dir'] = '/etc/mailman';
$conf['mailman']['init_script'] = 'mailman';
+//* mlmmj
+$conf['mlmmj']['installed'] = false; // will be detected automatically during installation
+$conf['mlmmj']['config_dir'] = '/etc/mlmmj';
+
//* Getmail
$conf['getmail']['installed'] = false; // will be detected automatically during installation
$conf['getmail']['config_dir'] = '/etc/getmail';
diff --git a/install/install.php b/install/install.php
index b9d2f0641eb01b2a0226f3e5f53026e3be2e1684..1371bcbb17ac541b81e07962e79b7936d0dabc6d 100644
--- a/install/install.php
+++ b/install/install.php
@@ -178,6 +178,8 @@ $conf['language_file_import_enabled'] = true;
//** Select installation mode
$install_mode = $inst->simple_query('Installation mode', array('standard', 'expert'), 'standard','install_mode');
+//** tRNG dependencies
+$conf['tRNG']='';
//** Get the hostname
$tmp_out = array();
@@ -282,7 +284,7 @@ if($install_mode == 'expert' && strtolower($inst->simple_query('Shall this serve
// initialize the connection to the master database
$inst->dbmaster = new db();
if($inst->dbmaster->linkId) $inst->dbmaster->closeConn();
- $inst->dbmaster->setDBData($conf['mysql']["master_host"], $conf['mysql']["master_admin_user"], $conf['mysql']["master_admin_password"]);
+ $inst->dbmaster->setDBData($conf['mysql']["master_host"], $conf['mysql']["master_port"], $conf['mysql']["master_admin_user"], $conf['mysql']["master_admin_password"]);
$inst->dbmaster->setDBName($conf['mysql']["master_database"]);
} else {
@@ -339,6 +341,12 @@ if($install_mode == 'standard' || strtolower($inst->simple_query('Configure Mail
$inst->configure_mailman();
}
+ //* Configure mlmmj
+ if($conf['mlmmj']['installed'] == true) {
+ swriteln('Configuring Mlmmj');
+ $inst->configure_mlmmj(/*install*/);
+ }
+
//* Check for Dovecot and Courier
if(!$conf['dovecot']['installed'] && !$conf['courier']['installed']) {
$conf['dovecot']['installed'] = $inst->force_configure_app('Dovecot', ($install_mode == 'expert'));
@@ -426,9 +434,7 @@ if($install_mode == 'standard' || strtolower($inst->simple_query('Configure DNS
swriteln('Configuring BIND');
$inst->configure_bind();
$conf['services']['dns'] = true;
- if(!is_installed('haveged')) {
- swriteln("[INFO] haveged not detected - DNSSEC can fail");
- }
+ $conf['tRNG'] .= 'DNSSEC with BIND, ';
}
//* Configure MyDNS
if($conf['mydns']['installed']) {
@@ -552,7 +558,7 @@ if($install_mode == 'standard' || strtolower($inst->simple_query('Install ISPCon
//** Customise the port ISPConfig runs on
$ispconfig_vhost_port = $inst->free_query('ISPConfig Port', '8080','ispconfig_port');
$conf['interface_password'] = $inst->free_query('Admin password', 'admin','ispconfig_admin_password');
- if($conf['interface_password'] != 'admin') {
+ if(!AUTOINSTALL && $conf['interface_password'] != 'admin') {
$check = false;
do {
unset($temp_password);
@@ -622,6 +628,8 @@ if($conf['nginx']['installed'] == true && $conf['nginx']['init_script'] != '') s
if($conf['ufw']['installed'] == true && $conf['ufw']['init_script'] != '') system($inst->getinitcommand($conf['ufw']['init_script'], 'restart').' &> /dev/null');
if($conf['xmpp']['installed'] == true && $conf['xmpp']['init_script'] != '') system($inst->getinitcommand($conf['xmpp']['init_script'], 'restart').' &> /dev/null');
+//* test tRNG
+if($conf['tRNG']) tRNG();
$inst->create_mount_script();
diff --git a/install/lib/install.lib.php b/install/lib/install.lib.php
index 3466d0b50c3110882edaae54cda916dff6167e27..476ac8fca1dfe4c5e2185e063d193ab3282bf213 100644
--- a/install/lib/install.lib.php
+++ b/install/lib/install.lib.php
@@ -218,7 +218,7 @@ function get_distname() {
} elseif(strstr(trim(file_get_contents('/etc/debian_version')), '/sid')) {
$distname = 'Debian';
$distver = 'Testing';
- $distid = 'debian60';
+ $distid = 'debian90';
$distconfid = 'debiantesting';
$distbaseid = 'debian';
swriteln("Operating System: Debian Testing\n");
@@ -231,6 +231,23 @@ function get_distname() {
}
}
+ //** Devuan
+ elseif(file_exists('/etc/devuan_version')) {
+ if(false !== strpos(trim(file_get_contents('/etc/devuan_version')), 'jessie')) {
+ $distname = 'Devuan';
+ $distver = 'Jessie';
+ $distid = 'debian60';
+ $distbaseid = 'debian';
+ swriteln("Operating System: Devuan 1.0 (Jessie) or compatible\n");
+ } elseif(false !== strpos(trim(file_get_contents('/etc/devuan_version')), 'ceres')) {
+ $distname = 'Devuan';
+ $distver = 'Ceres';
+ $distid = 'debiantesting';
+ $distbaseid = 'debian';
+ swriteln("Operating System: Devuan Unstable (Ceres) or compatible\n");
+ }
+ }
+
//** OpenSuSE
elseif(file_exists('/etc/SuSE-release')) {
if(stristr(file_get_contents('/etc/SuSE-release'), '11.0')) {
@@ -959,4 +976,14 @@ function getapachemodules() {
return $modules;
}
+function tRNG(){
+ global $conf;
+ $path='/dev/random';$test='/tmp/ispconfig.tRNG';$time=2;$warn=8192;
+ echo "Testing $time seconds throughput of $path ... ";
+ exec("cat $path > $test & PID=\$!; sleep $time; kill \$PID");
+ if(($result=filesize($test)) < $warn) {
+ echo "$result bytes\n[WARN] these services may fail: {$conf['tRNG']}minimum recommended: $warn\n";
+ }else echo "$result bytes OK\n";
+ unlink($test);
+}
?>
diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index 51361c3c690dbe56d8c218d4f44d7313839c9497..90124ff10cfb63d372dc3333562e837225c15baf 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -157,6 +157,7 @@ class installer_base {
if(is_installed('postfix')) $conf['postfix']['installed'] = true;
if(is_installed('postgrey')) $conf['postgrey']['installed'] = true;
if(is_installed('mailman') || is_installed('mmsitepass')) $conf['mailman']['installed'] = true;
+ if(is_installed('mlmmj') || is_installed('mlmmj-make-ml')) $conf['mlmmj']['installed'] = true;
if(is_installed('apache') || is_installed('apache2') || is_installed('httpd') || is_installed('httpd2')) $conf['apache']['installed'] = true;
if(is_installed('getmail')) $conf['getmail']['installed'] = true;
if(is_installed('courierlogger')) $conf['courier']['installed'] = true;
@@ -223,15 +224,8 @@ class installer_base {
public function configure_database() {
global $conf;
- //* check sql-mode
- $check_sql_mode = $this->db->queryOneRecord("SELECT @@sql_mode");
-
- if ($check_sql_mode['@@sql_mode'] != '' && $check_sql_mode['@@sql_mode'] != 'NO_ENGINE_SUBSTITUTION') {
- echo "Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION. Add\n\n";
- echo " sql-mode=\"NO_ENGINE_SUBSTITUTION\"\n\n";
- echo"to the mysqld-section in your mysql-config on this server and restart mysqld afterwards\n";
- die();
- }
+ //* ensure no modes with errors for ENGINE=MyISAM
+ $this->db->query("SET sql_mode = ''");
//** Create the database
if(!$this->db->query('CREATE DATABASE IF NOT EXISTS ?? DEFAULT CHARACTER SET ?', $conf['mysql']['database'], $conf['mysql']['charset'])) {
@@ -313,6 +307,7 @@ class installer_base {
$tpl_ini_array['web']['php_ini_path_cgi'] = $conf['apache']['php_ini_path_cgi'];
$tpl_ini_array['mail']['pop3_imap_daemon'] = ($conf['dovecot']['installed'] == true)?'dovecot':'courier';
$tpl_ini_array['mail']['mail_filter_syntax'] = ($conf['dovecot']['installed'] == true)?'sieve':'maildrop';
+ $tpl_ini_array['mail']['mailinglist_manager'] = ($conf['mlmmj']['installed'] == true)?'mlmmj':'mailman';
$tpl_ini_array['dns']['bind_user'] = $conf['bind']['bind_user'];
$tpl_ini_array['dns']['bind_group'] = $conf['bind']['bind_group'];
$tpl_ini_array['dns']['bind_zonefiles_dir'] = $conf['bind']['bind_zonefiles_dir'];
@@ -817,6 +812,90 @@ class installer_base {
exec('/usr/sbin/postmap /var/lib/mailman/data/transport-mailman');
}
+ public function configure_mlmmj() {
+ global $conf;
+
+ $configDir = $conf['mlmmj']['config_dir'];
+ @mkdir($configDir, 0755, true);
+
+ $configFile = 'mlmmj.conf';
+
+ //* Backup exiting file
+ if(is_file("$configDir/$configFile")) {
+ copy("$configDir/$configFile", "$configDir/$configFile~");
+ }
+
+ // load files
+ if(is_file($conf['ispconfig_install_dir']."/server/conf-custom/install/$configFile.master")) {
+ copy($conf['ispconfig_install_dir']."/server/conf-custom/install/$configFile.master", "$configDir/$configFile");
+ } else {
+ copy("tpl/$configFile.master", "$configDir/$configFile");
+ }
+
+ $mlConfig = @parse_ini_file("$configDir/$configFile");
+ // Force PHP7 to use # to mark comments
+ if(PHP_MAJOR_VERSION >= 7)
+ $mlConfig = array_filter($mlConfig, function($v){return(substr($v,0,1)!=='#');}, ARRAY_FILTER_USE_KEY);
+
+ $command = 'useradd --system mlmmj --home '.$mlConfig['spool_dir'].' --shell /usr/false';
+ if(!is_user('mlmmj')) caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
+
+ @mkdir($mlConfig['spool_dir'], 0755, true);
+ chown($mlConfig['spool_dir'], 'mlmmj');
+ chgrp($mlConfig['spool_dir'], 'mlmmj');
+
+ // Make a backup copy of master.cf and main.cf files
+ copy($conf['postfix']['config_dir'].'/main.cf', $conf['postfix']['config_dir'].'/main.cf~mlmmj');
+
+ //* Update postfix main.cf
+ $content = rf($conf['postfix']['config_dir'].'/main.cf');
+
+ if(!preg_match("/^alias_maps = .*hash:\/etc\/mlmmj\/aliases.*/m", $content)) {
+ $content = preg_replace("/^alias_maps = (.*)/m", "$0, hash:$configDir/aliases", $content);
+ }
+
+ if(!preg_match("/^alias_database = .*hash:\/etc\/mlmmj\/aliases.*/m", $content)) {
+ $content = preg_replace("/^alias_database = (.*)/m", "$0, hash:$configDir/aliases", $content);
+ }
+
+ if(!preg_match("/^virtual_alias_maps = .*hash:\/etc\/mlmmj\/virtual.*/m", $content)) {
+ $content = preg_replace("/^virtual_alias_maps = (.*)/m", "$0, hash:$configDir/virtual", $content);
+ }
+
+ if(!preg_match("/^transport_maps = .*hash:\/etc\/mlmmj\/transport.*/m", $content)) {
+ $content = preg_replace("/transport_maps = (.*)/m", "$0, hash:$configDir/transport", $content);
+ }
+
+ if(!preg_match("/^mlmmj_destination_recipient_limit.*/m", $content)) {
+ $content .= "\n# Only deliver one message to Mlmmj at a time\nmlmmj_destination_recipient_limit = 1\n";
+ }
+
+ wf($conf['postfix']['config_dir'].'/main.cf', $content);
+
+ //* Update postfix master.cf
+ $content = rf($conf['postfix']['config_dir'].'/master.cf');
+ if(!preg_match('/^mlmmj\s+unix\s+-\s+n\s+n\s+-\s+-\s+pipe\s*$/m', $content)) {
+ copy($conf['postfix']['config_dir'].'/master.cf', $conf['postfix']['config_dir'].'/master.cf~mlmmj');
+ $content .= "\n# mlmmj mailing lists\n";
+ $content .= "mlmmj unix - n n - - pipe\n";
+ $content .= " flags=ORhu user=mlmmj argv=/usr/bin/mlmmj-receive -F -L ";
+ $content .= $mlConfig['spool_dir']."/\$nexthop\n\n";
+ wf($conf['postfix']['config_dir'].'/master.cf', $content);
+ }
+
+ //* Create aliasaes
+ touch("$configDir/aliases");
+ exec("nohup /usr/sbin/postalias $configDir/aliases >/dev/null 2>&1");
+ touch("$configDir/virtual");
+ exec("nohup /usr/sbin/postmap $configDir/virtual >/dev/null 2>&1");
+ touch("$configDir/transport");
+ exec("nohup /usr/sbin/postmap $configDir/transport >/dev/null 2>&1");
+
+ //* Create/update cron entry
+ $cronEntry = '0 */2 * * * find /var'.$mlConfig['spool_dir'].'/ -mindepth 1 -maxdepth 1 -type d -exec /usr/bin/mlmmj-maintd -F -d {} \;';
+ file_put_contents('/etc/cron.d/mlmmj', $cronEntry);
+ }
+
public function get_postfix_service($service, $type) {
global $conf;
@@ -1410,7 +1489,7 @@ class installer_base {
public function configure_spamassassin() {
global $conf;
- //* Enable spamasasssin on debian and ubuntu
+ //* Enable spamasasssin on debian, devuan and ubuntu
$configfile = '/etc/default/spamassassin';
if(is_file($configfile)) {
copy($configfile, $configfile.'~');
@@ -1461,11 +1540,6 @@ class installer_base {
chmod($config_dir.'/'.$configfile, 0600);
chown($config_dir.'/'.$configfile, 'root');
chgrp($config_dir.'/'.$configfile, 'root');
- // **enable chrooting
- //exec('mkdir -p '.$config_dir.'/conf/ChrootEveryone');
- exec('echo "yes" > '.$config_dir.'/conf/ChrootEveryone');
- exec('echo "yes" > '.$config_dir.'/conf/BrokenClientsCompatibility');
- exec('echo "yes" > '.$config_dir.'/conf/DisplayDotFiles');
if(is_file('/etc/default/pure-ftpd-common')) {
replaceLine('/etc/default/pure-ftpd-common', 'STANDALONE_OR_INETD=inetd', 'STANDALONE_OR_INETD=standalone', 1, 0);
@@ -1478,7 +1552,38 @@ class installer_base {
//if(is_file($conf['init_scripts'].'/'.'openbsd-inetd')) exec($conf['init_scripts'].'/'.'openbsd-inetd restart');
}
- if(!is_file('/etc/pure-ftpd/conf/DontResolve')) exec('echo "yes" > /etc/pure-ftpd/conf/DontResolve');
+ if(!$this->is_update) {
+ //* backup old settings
+ exec("for i in $config_dir/conf/*; do printf \$i\ ; cat \$i; printf '\n'; done 2>&1 >$config_dir/conf/.backup~");
+ //* clean common unused settings
+ exec("rm $config_dir/conf/MinUID $config_dir/conf/PAMAuthentication $config_dir/conf/PureDB $config_dir/conf/UnixAuthentication 2> /dev/null");
+ //* required for ftp traffic stats
+ file_put_contents("$config_dir/conf/AltLog","clf:/var/log/pure-ftpd/transfer.log");
+ //* improves client compatibility
+ file_put_contents("$config_dir/conf/BrokenClientsCompatibility","yes");
+ //* needed for ispconfig implementation
+ file_put_contents("$config_dir/conf/ChrootEveryone","yes");
+ //* improves client compatibility
+ file_put_contents("$config_dir/conf/DisplayDotFiles","yes");
+ //* improves performance
+ file_put_contents("$config_dir/conf/DontResolve","yes");
+ //* complies with RFC2640
+ file_put_contents("$config_dir/conf/FSCharset","UTF-8");
+ //* provides welcome message
+ file_put_contents("$config_dir/conf/FortunesFile","$config_dir/welcome.msg");
+ //* increases the clients limit from 50 (default) to 1024
+ file_put_contents("$config_dir/conf/MaxClientsNumber","1024");
+ //* prevents DoS attack from the same IP address
+ file_put_contents("$config_dir/conf/MaxClientsPerIP","64");
+ //* needed for ispconfig implementation
+ file_put_contents("$config_dir/conf/MySQLConfigFile","$config_dir/db/mysql.conf");
+ //* recommended for ispconfig implementation
+ file_put_contents("$config_dir/conf/NoAnonymous","yes");
+ //* grade A encryption
+ file_put_contents("$config_dir/conf/TLSCipherSuite","ECDHE:AES256-SHA:AES128-SHA:DES-CBC3-SHA:!RC4");
+ //* hides implementation details
+ file_put_contents("$config_dir/welcome.msg","Welcome");
+ }
}
public function configure_mydns() {
diff --git a/install/lib/mysql.lib.php b/install/lib/mysql.lib.php
index 7cf06ee044a24aa279bed471210b5224fad490f6..c4943d4facedab11ae8dfc4eea4d42794c141bd8 100644
--- a/install/lib/mysql.lib.php
+++ b/install/lib/mysql.lib.php
@@ -96,15 +96,16 @@ class db extends mysqli
$this->_setCharset();
}
- public function setDBData($host, $user, $password) {
+ public function setDBData($host, $port, $user, $password) {
$this->dbHost = $host;
+ $this->dbPort = $port;
$this->dbUser = $user;
$this->dbPass = $password;
}
public function setDBName($name) {
$this->dbName = $name;
- $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass);
+ $this->_iConnId = mysqli_connect($this->dbHost, $this->dbUser, $this->dbPass, '', $this->dbPort);
if(!((bool)mysqli_query( $this->_iConnId, 'USE `' . $this->dbName . '`'))) {
$this->close();
$this->_sqlerror('Datenbank nicht gefunden / Database not found');
diff --git a/install/lib/update.lib.php b/install/lib/update.lib.php
index 7c30bc676793abb95162791b64c7ba5150b0fb01..603548ffd4c7a2ea89e48aa16988771875815bb9 100644
--- a/install/lib/update.lib.php
+++ b/install/lib/update.lib.php
@@ -123,14 +123,8 @@ function checkDbHealth() {
function updateDbAndIni() {
global $inst, $conf;
- //* check sql-mode
- $check_sql_mode = $inst->db->queryOneRecord("SELECT @@sql_mode");
- if ($check_sql_mode['@@sql_mode'] != '' && $check_sql_mode['@@sql_mode'] != 'NO_ENGINE_SUBSTITUTION') {
- echo "Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION. Add\n\n";
- echo " sql-mode=\"NO_ENGINE_SUBSTITUTION\"\n\n";
- echo"to the mysqld-section in your mysql-config on this server and restart mysqld afterwards\n";
- die();
- }
+ //* ensure no modes with errors for ENGINE=MyISAM
+ $inst->db->query("SET sql_mode = ''");
//* Update $conf array with values from the server.ini that shall be preserved
$tmp = $inst->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . '.server', $conf['server_id']);
diff --git a/install/sql/incremental/upd_dev_collection.sql b/install/sql/incremental/upd_dev_collection.sql
index 0c91f1a724b8298da674210346cf8d6430532ac6..0e0ba294f4535e65bc4fb85152d7f312426d3ace 100644
--- a/install/sql/incremental/upd_dev_collection.sql
+++ b/install/sql/incremental/upd_dev_collection.sql
@@ -1,3 +1,17 @@
+ALTER TABLE `mail_mailinglist` ADD `list_type` enum('open','closed') NOT NULL DEFAULT 'open';
+ALTER TABLE `mail_mailinglist` ADD `subject_prefix` varchar(50) NOT NULL DEFAULT '';
+ALTER TABLE `mail_mailinglist` ADD `admins` mediumtext;
+ALTER TABLE `mail_mailinglist` ADD `digestinterval` int(11) NOT NULL DEFAULT '7';
+ALTER TABLE `mail_mailinglist` ADD `digestmaxmails` int(11) NOT NULL DEFAULT '50';
+ALTER TABLE `mail_mailinglist` ADD `archive` enum('n','y') NOT NULL DEFAULT 'n';
+ALTER TABLE `mail_mailinglist` ADD `digesttext` ENUM('n','y') NOT NULL DEFAULT 'n';
+ALTER TABLE `mail_mailinglist` ADD `digestsub` ENUM('n','y') NOT NULL DEFAULT 'n';
+ALTER TABLE `mail_mailinglist` ADD `mail_footer` mediumtext;
+ALTER TABLE `mail_mailinglist` ADD `subscribe_policy` enum('disabled','confirm','approval','both','none') NOT NULL DEFAULT 'confirm';
+ALTER TABLE `mail_mailinglist` ADD `posting_policy` enum('closed','moderated','free') NOT NULL DEFAULT 'free';
+ALTER TABLE `sys_user` ADD `last_login_ip` VARCHAR(50) NULL AFTER `lost_password_reqtime`;
+ALTER TABLE `sys_user` ADD `last_login_at` BIGINT(20) NULL AFTER `last_login_ip`;
+ALTER TABLE `sys_remoteaction` CHANGE `action_state` `action_state` ENUM('pending','processing','ok','warning','error') NOT NULL DEFAULT 'pending';
ALTER TABLE `web_domain` CHANGE `folder_directive_snippets` `folder_directive_snippets` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL;
ALTER TABLE `web_domain` ADD `log_retention` INT NOT NULL DEFAULT '30' AFTER `https_port`;
ALTER TABLE `web_domain` CHANGE `stats_type` `stats_type` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'awstats';
@@ -14,7 +28,36 @@ CHANGE `spam_modifies_subj` `spam_modifies_subj` ENUM('N','Y') CHARACTER SET utf
CHANGE `warnvirusrecip` `warnvirusrecip` ENUM('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
CHANGE `warnbannedrecip` `warnbannedrecip` ENUM('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N',
CHANGE `warnbadhrecip` `warnbadhrecip` ENUM('N','Y') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'N';
+
+CREATE TABLE IF NOT EXISTS `dns_ssl_ca` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `sys_userid` int(11) unsigned NOT NULL DEFAULT '0',
+ `sys_groupid` int(11) unsigned NOT NULL DEFAULT '0',
+ `sys_perm_user` varchar(5) NOT NULL DEFAULT '',
+ `sys_perm_group` varchar(5) NOT NULL DEFAULT '',
+ `sys_perm_other` varchar(5) NOT NULL DEFAULT '',
+ `active` enum('N','Y') NOT NULL DEFAULT 'N',
+ `ca_name` varchar(255) NOT NULL DEFAULT '',
+ `ca_issue` varchar(255) NOT NULL DEFAULT '',
+ `ca_wildcard` enum('Y','N') NOT NULL DEFAULT 'N',
+ `ca_iodef` text NOT NULL,
+ `ca_critical` tinyint(1) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+
+INSERT INTO `dns_ssl_ca` (`id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `active`, `ca_name`, `ca_issue`, `ca_wildcard`, `ca_iodef`, `ca_critical`) VALUES
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'Comodo', 'comodoca.com', 'Y', '', 0),
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'DigiCert', 'digicert.com', 'Y', '', 0),
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'Entrust', 'entrust.net', 'Y', '', 0),
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'GeoTrust (Symantec)', 'geotrust.com', 'Y', '', 0),
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'Izenpe', 'izenpe.com', 'Y', '', 0),
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'Let''s Encrypt', 'letsencrypt.org', 'N', '', 0),
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'Symantec', 'symantec.com', 'Y', '', 0),
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'Thawte (Symantec)', 'thawte.com', 'Y', '', 0),
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'WoSign', 'wosign.com', 'Y', '', 0);
+
+ALTER TABLE `dns_rr` CHANGE `type` `type` ENUM('A','AAAA','ALIAS','CAA','CNAME','DS','HINFO','LOC','MX','NAPTR','NS','PTR','RP','SRV','TXT','TLSA','DNSKEY') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;
ALTER TABLE `dns_rr` CHANGE `data` `data` TEXT NOT NULL;
ALTER TABLE `web_database` CHANGE `database_quota` `database_quota` INT(11) NULL DEFAULT NULL;
ALTER TABLE `web_domain` ADD `log_retention` INT NOT NULL DEFAULT '30' ;
-ALTER TABLE spamfilter_policy CHANGE spam_tag_level spam_tag_level DECIMAL(5,2) NULL DEFAULT NULL, CHANGE spam_tag2_level spam_tag2_level DECIMAL(5,2) NULL DEFAULT NULL, CHANGE spam_kill_level spam_kill_level DECIMAL(5,2) NULL DEFAULT NULL, CHANGE spam_dsn_cutoff_level spam_dsn_cutoff_level DECIMAL(5,2) NULL DEFAULT NULL, CHANGE spam_quarantine_cutoff_level spam_quarantine_cutoff_level DECIMAL(5,2) NULL DEFAULT NULL;
\ No newline at end of file
+ALTER TABLE spamfilter_policy CHANGE spam_tag_level spam_tag_level DECIMAL(5,2) NULL DEFAULT NULL, CHANGE spam_tag2_level spam_tag2_level DECIMAL(5,2) NULL DEFAULT NULL, CHANGE spam_kill_level spam_kill_level DECIMAL(5,2) NULL DEFAULT NULL, CHANGE spam_dsn_cutoff_level spam_dsn_cutoff_level DECIMAL(5,2) NULL DEFAULT NULL, CHANGE spam_quarantine_cutoff_level spam_quarantine_cutoff_level DECIMAL(5,2) NULL DEFAULT NULL;
diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql
index 43cbc367bd5c6edb4f655ae4f21937da33d688ae..94961035ccac7b97b623ef9dea3861fc99488425 100644
--- a/install/sql/ispconfig3.sql
+++ b/install/sql/ispconfig3.sql
@@ -489,7 +489,7 @@ CREATE TABLE `dns_rr` (
`server_id` int(11) NOT NULL default '1',
`zone` int(11) unsigned NOT NULL DEFAULT '0',
`name` varchar(255) NOT NULL DEFAULT '',
- `type` enum('A','AAAA','ALIAS','CNAME','DS','HINFO','LOC','MX','NAPTR','NS','PTR','RP','SRV','TXT','TLSA','DNSKEY') default NULL,
+ `type` enum('A','AAAA','ALIAS','CAA','CNAME','DS','HINFO','LOC','MX','NAPTR','NS','PTR','RP','SRV','TXT','TLSA','DNSKEY') default NULL,
`data` TEXT NOT NULL,
`aux` int(11) unsigned NOT NULL default '0',
`ttl` int(11) unsigned NOT NULL default '3600',
@@ -500,6 +500,40 @@ CREATE TABLE `dns_rr` (
KEY `rr` (`zone`,`type`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `dns_ssl_ca`
+--
+
+CREATE TABLE IF NOT EXISTS `dns_ssl_ca` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `sys_userid` int(11) unsigned NOT NULL DEFAULT '0',
+ `sys_groupid` int(11) unsigned NOT NULL DEFAULT '0',
+ `sys_perm_user` varchar(5) NOT NULL DEFAULT '',
+ `sys_perm_group` varchar(5) NOT NULL DEFAULT '',
+ `sys_perm_other` varchar(5) NOT NULL DEFAULT '',
+ `active` enum('N','Y') NOT NULL DEFAULT 'N',
+ `ca_name` varchar(255) NOT NULL DEFAULT '',
+ `ca_issue` varchar(255) NOT NULL DEFAULT '',
+ `ca_wildcard` enum('Y','N') NOT NULL DEFAULT 'N',
+ `ca_iodef` text NOT NULL,
+ `ca_critical` tinyint(1) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+
+INSERT INTO `dns_ssl_ca` (`id`, `sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `active`, `ca_name`, `ca_issue`, `ca_wildcard`, `ca_iodef`, `ca_critical`) VALUES
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'Comodo', 'comodoca.com', 'Y', '', 0),
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'DigiCert', 'digicert.com', 'Y', '', 0),
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'Entrust', 'entrust.net', 'Y', '', 0),
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'GeoTrust (Symantec)', 'geotrust.com', 'Y', '', 0),
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'Izenpe', 'izenpe.com', 'Y', '', 0),
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'Let''s Encrypt', 'letsencrypt.org', 'N', '', 0),
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'Symantec', 'symantec.com', 'Y', '', 0),
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'Thawte (Symantec)', 'thawte.com', 'Y', '', 0),
+(NULL, 1, 1, 'riud', 'riud', '', 'Y', 'WoSign', 'wosign.com', 'Y', '', 0);
+
+
-- --------------------------------------------------------
--
@@ -879,8 +913,19 @@ CREATE TABLE `mail_mailinglist` (
`server_id` int(11) unsigned NOT NULL default '0',
`domain` varchar(255) NOT NULL DEFAULT '',
`listname` varchar(255) NOT NULL DEFAULT '',
+ `list_type` enum('open','closed') NOT NULL DEFAULT 'open',
`email` varchar(255) NOT NULL DEFAULT '',
`password` varchar(255) NOT NULL DEFAULT '',
+ `subject_prefix` varchar(50) NOT NULL DEFAULT '',
+ `admins` mediumtext,
+ `digestinterval` int(11) NOT NULL DEFAULT '7',
+ `digestmaxmails` int(11) NOT NULL DEFAULT '50',
+ `archive` enum('n','y') NOT NULL DEFAULT 'n',
+ `digesttext` enum('n','y') NOT NULL DEFAULT 'n',
+ `digestsub` enum('n','y') NOT NULL DEFAULT 'n',
+ `mail_footer` mediumtext,
+ `subscribe_policy` enum('disabled','confirm','approval','both','none') NOT NULL DEFAULT 'confirm',
+ `posting_policy` enum('closed','moderated','free') NOT NULL DEFAULT 'free',
PRIMARY KEY (`mailinglist_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -1732,7 +1777,7 @@ CREATE TABLE `sys_remoteaction` (
`tstamp` int(11) NOT NULL DEFAULT '0',
`action_type` varchar(20) NOT NULL DEFAULT '',
`action_param` mediumtext,
- `action_state` enum('pending','ok','warning','error') NOT NULL DEFAULT 'pending',
+ `action_state` enum('pending','processing','ok','warning','error') NOT NULL DEFAULT 'pending',
`response` mediumtext,
PRIMARY KEY (`action_id`),
KEY `server_id` (`server_id`)
@@ -1802,6 +1847,8 @@ CREATE TABLE `sys_user` (
`lost_password_function` tinyint(1) NOT NULL default '1',
`lost_password_hash` VARCHAR(50) NOT NULL default '',
`lost_password_reqtime` DATETIME NULL default NULL,
+ `last_login_ip` varchar(50) DEFAULT NULL,
+ `last_login_at` bigint(20) DEFAULT NULL,
PRIMARY KEY (`userid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
diff --git a/install/tpl/apache_ispconfig.conf.master b/install/tpl/apache_ispconfig.conf.master
index 1b750c8724cb84dc75e776a4d4c49ea559d018d4..f206b94582b6819eb2619d55f8868f3e406a8d3a 100644
--- a/install/tpl/apache_ispconfig.conf.master
+++ b/install/tpl/apache_ispconfig.conf.master
@@ -1,12 +1,25 @@
+################################################
+# ISPConfig General Apache Options
+################################################
+ServerTokens ProductOnly
+ServerSignature Off
+
+ ')
+ {
+ $markup = $trimmedMarkup;
+ $markup = substr($markup, 3);
+
+ $position = strpos($markup, "
\n", $text);
+ }
+ else
+ {
+ $text = preg_replace('/(?:[ ][ ]+|[ ]*\\\\)\n/', "
\n", $text);
+ $text = str_replace(" \n", "\n", $text);
+ }
+
+ return $text;
+ }
+
+ #
+ # Handlers
+ #
+
+ protected function element(array $Element)
+ {
+ $markup = '<'.$Element['name'];
+
+ if (isset($Element['attributes']))
+ {
+ foreach ($Element['attributes'] as $name => $value)
+ {
+ if ($value === null)
+ {
+ continue;
+ }
+
+ $markup .= ' '.$name.'="'.$value.'"';
+ }
+ }
+
+ if (isset($Element['text']))
+ {
+ $markup .= '>';
+
+ if (isset($Element['handler']))
+ {
+ $markup .= $this->{$Element['handler']}($Element['text']);
+ }
+ else
+ {
+ $markup .= $Element['text'];
+ }
+
+ $markup .= ''.$Element['name'].'>';
+ }
+ else
+ {
+ $markup .= ' />';
+ }
+
+ return $markup;
+ }
+
+ protected function elements(array $Elements)
+ {
+ $markup = '';
+
+ foreach ($Elements as $Element)
+ {
+ $markup .= "\n" . $this->element($Element);
+ }
+
+ $markup .= "\n";
+
+ return $markup;
+ }
+
+ # ~
+
+ protected function li($lines)
+ {
+ $markup = $this->lines($lines);
+
+ $trimmedMarkup = trim($markup);
+
+ if ( ! in_array('', $lines) and substr($trimmedMarkup, 0, 3) === '\s+/', '', $markup);
+
+ # add footnotes
+
+ if (isset($this->DefinitionData['Footnote']))
+ {
+ $Element = $this->buildFootnoteElement();
+
+ $markup .= "\n" . $this->element($Element);
+ }
+
+ return $markup;
+ }
+
+ #
+ # Blocks
+ #
+
+ #
+ # Abbreviation
+
+ protected function blockAbbreviation($Line)
+ {
+ if (preg_match('/^\*\[(.+?)\]:[ ]*(.+?)[ ]*$/', $Line['text'], $matches))
+ {
+ $this->DefinitionData['Abbreviation'][$matches[1]] = $matches[2];
+
+ $Block = array(
+ 'hidden' => true,
+ );
+
+ return $Block;
+ }
+ }
+
+ #
+ # Footnote
+
+ protected function blockFootnote($Line)
+ {
+ if (preg_match('/^\[\^(.+?)\]:[ ]?(.*)$/', $Line['text'], $matches))
+ {
+ $Block = array(
+ 'label' => $matches[1],
+ 'text' => $matches[2],
+ 'hidden' => true,
+ );
+
+ return $Block;
+ }
+ }
+
+ protected function blockFootnoteContinue($Line, $Block)
+ {
+ if ($Line['text'][0] === '[' and preg_match('/^\[\^(.+?)\]:/', $Line['text']))
+ {
+ return;
+ }
+
+ if (isset($Block['interrupted']))
+ {
+ if ($Line['indent'] >= 4)
+ {
+ $Block['text'] .= "\n\n" . $Line['text'];
+
+ return $Block;
+ }
+ }
+ else
+ {
+ $Block['text'] .= "\n" . $Line['text'];
+
+ return $Block;
+ }
+ }
+
+ protected function blockFootnoteComplete($Block)
+ {
+ $this->DefinitionData['Footnote'][$Block['label']] = array(
+ 'text' => $Block['text'],
+ 'count' => null,
+ 'number' => null,
+ );
+
+ return $Block;
+ }
+
+ #
+ # Definition List
+
+ protected function blockDefinitionList($Line, $Block)
+ {
+ if ( ! isset($Block) or isset($Block['type']))
+ {
+ return;
+ }
+
+ $Element = array(
+ 'name' => 'dl',
+ 'handler' => 'elements',
+ 'text' => array(),
+ );
+
+ $terms = explode("\n", $Block['element']['text']);
+
+ foreach ($terms as $term)
+ {
+ $Element['text'] []= array(
+ 'name' => 'dt',
+ 'handler' => 'line',
+ 'text' => $term,
+ );
+ }
+
+ $Block['element'] = $Element;
+
+ $Block = $this->addDdElement($Line, $Block);
+
+ return $Block;
+ }
+
+ protected function blockDefinitionListContinue($Line, array $Block)
+ {
+ if ($Line['text'][0] === ':')
+ {
+ $Block = $this->addDdElement($Line, $Block);
+
+ return $Block;
+ }
+ else
+ {
+ if (isset($Block['interrupted']) and $Line['indent'] === 0)
+ {
+ return;
+ }
+
+ if (isset($Block['interrupted']))
+ {
+ $Block['dd']['handler'] = 'text';
+ $Block['dd']['text'] .= "\n\n";
+
+ unset($Block['interrupted']);
+ }
+
+ $text = substr($Line['body'], min($Line['indent'], 4));
+
+ $Block['dd']['text'] .= "\n" . $text;
+
+ return $Block;
+ }
+ }
+
+ #
+ # Header
+
+ protected function blockHeader($Line)
+ {
+ $Block = parent::blockHeader($Line);
+
+ if (preg_match('/[ #]*{('.$this->regexAttribute.'+)}[ ]*$/', $Block['element']['text'], $matches, PREG_OFFSET_CAPTURE))
+ {
+ $attributeString = $matches[1][0];
+
+ $Block['element']['attributes'] = $this->parseAttributeData($attributeString);
+
+ $Block['element']['text'] = substr($Block['element']['text'], 0, $matches[0][1]);
+ }
+
+ return $Block;
+ }
+
+ #
+ # Markup
+
+ protected function blockMarkupComplete($Block)
+ {
+ if ( ! isset($Block['void']))
+ {
+ $Block['markup'] = $this->processTag($Block['markup']);
+ }
+
+ return $Block;
+ }
+
+ #
+ # Setext
+
+ protected function blockSetextHeader($Line, array $Block = null)
+ {
+ $Block = parent::blockSetextHeader($Line, $Block);
+
+ if (preg_match('/[ ]*{('.$this->regexAttribute.'+)}[ ]*$/', $Block['element']['text'], $matches, PREG_OFFSET_CAPTURE))
+ {
+ $attributeString = $matches[1][0];
+
+ $Block['element']['attributes'] = $this->parseAttributeData($attributeString);
+
+ $Block['element']['text'] = substr($Block['element']['text'], 0, $matches[0][1]);
+ }
+
+ return $Block;
+ }
+
+ #
+ # Inline Elements
+ #
+
+ #
+ # Footnote Marker
+
+ protected function inlineFootnoteMarker($Excerpt)
+ {
+ if (preg_match('/^\[\^(.+?)\]/', $Excerpt['text'], $matches))
+ {
+ $name = $matches[1];
+
+ if ( ! isset($this->DefinitionData['Footnote'][$name]))
+ {
+ return;
+ }
+
+ $this->DefinitionData['Footnote'][$name]['count'] ++;
+
+ if ( ! isset($this->DefinitionData['Footnote'][$name]['number']))
+ {
+ $this->DefinitionData['Footnote'][$name]['number'] = ++ $this->footnoteCount; # » &
+ }
+
+ $Element = array(
+ 'name' => 'sup',
+ 'attributes' => array('id' => 'fnref'.$this->DefinitionData['Footnote'][$name]['count'].':'.$name),
+ 'handler' => 'element',
+ 'text' => array(
+ 'name' => 'a',
+ 'attributes' => array('href' => '#fn:'.$name, 'class' => 'footnote-ref'),
+ 'text' => $this->DefinitionData['Footnote'][$name]['number'],
+ ),
+ );
+
+ return array(
+ 'extent' => strlen($matches[0]),
+ 'element' => $Element,
+ );
+ }
+ }
+
+ private $footnoteCount = 0;
+
+ #
+ # Link
+
+ protected function inlineLink($Excerpt)
+ {
+ $Link = parent::inlineLink($Excerpt);
+
+ $remainder = substr($Excerpt['text'], $Link['extent']);
+
+ if (preg_match('/^[ ]*{('.$this->regexAttribute.'+)}/', $remainder, $matches))
+ {
+ $Link['element']['attributes'] += $this->parseAttributeData($matches[1]);
+
+ $Link['extent'] += strlen($matches[0]);
+ }
+
+ return $Link;
+ }
+
+ #
+ # ~
+ #
+
+ protected function unmarkedText($text)
+ {
+ $text = parent::unmarkedText($text);
+
+ if (isset($this->DefinitionData['Abbreviation']))
+ {
+ foreach ($this->DefinitionData['Abbreviation'] as $abbreviation => $meaning)
+ {
+ $pattern = '/\b'.preg_quote($abbreviation, '/').'\b/';
+
+ $text = preg_replace($pattern, ''.$abbreviation.'', $text);
+ }
+ }
+
+ return $text;
+ }
+
+ #
+ # Util Methods
+ #
+
+ protected function addDdElement(array $Line, array $Block)
+ {
+ $text = substr($Line['text'], 1);
+ $text = trim($text);
+
+ unset($Block['dd']);
+
+ $Block['dd'] = array(
+ 'name' => 'dd',
+ 'handler' => 'line',
+ 'text' => $text,
+ );
+
+ if (isset($Block['interrupted']))
+ {
+ $Block['dd']['handler'] = 'text';
+
+ unset($Block['interrupted']);
+ }
+
+ $Block['element']['text'] []= & $Block['dd'];
+
+ return $Block;
+ }
+
+ protected function buildFootnoteElement()
+ {
+ $Element = array(
+ 'name' => 'div',
+ 'attributes' => array('class' => 'footnotes'),
+ 'handler' => 'elements',
+ 'text' => array(
+ array(
+ 'name' => 'hr',
+ ),
+ array(
+ 'name' => 'ol',
+ 'handler' => 'elements',
+ 'text' => array(),
+ ),
+ ),
+ );
+
+ uasort($this->DefinitionData['Footnote'], 'self::sortFootnotes');
+
+ foreach ($this->DefinitionData['Footnote'] as $definitionId => $DefinitionData)
+ {
+ if ( ! isset($DefinitionData['number']))
+ {
+ continue;
+ }
+
+ $text = $DefinitionData['text'];
+
+ $text = parent::text($text);
+
+ $numbers = range(1, $DefinitionData['count']);
+
+ $backLinksMarkup = '';
+
+ foreach ($numbers as $number)
+ {
+ $backLinksMarkup .= ' ↩';
+ }
+
+ $backLinksMarkup = substr($backLinksMarkup, 1);
+
+ if (substr($text, - 4) === '
'.$backLinksMarkup.'
'; + } + + $Element['text'][1]['text'] []= array( + 'name' => 'li', + 'attributes' => array('id' => 'fn:'.$definitionId), + 'text' => "\n".$text."\n", + ); + } + + return $Element; + } + + # ~ + + protected function parseAttributeData($attributeString) + { + $Data = array(); + + $attributes = preg_split('/[ ]+/', $attributeString, - 1, PREG_SPLIT_NO_EMPTY); + + foreach ($attributes as $attribute) + { + if ($attribute[0] === '#') + { + $Data['id'] = substr($attribute, 1); + } + else # "." + { + $classes []= substr($attribute, 1); + } + } + + if (isset($classes)) + { + $Data['class'] = implode(' ', $classes); + } + + return $Data; + } + + # ~ + + protected function processTag($elementMarkup) # recursive + { + # http://stackoverflow.com/q/1148928/200145 + libxml_use_internal_errors(true); + + $DOMDocument = new DOMDocument; + + # http://stackoverflow.com/q/11309194/200145 + $elementMarkup = mb_convert_encoding($elementMarkup, 'HTML-ENTITIES', 'UTF-8'); + + # http://stackoverflow.com/q/4879946/200145 + $DOMDocument->loadHTML($elementMarkup); + $DOMDocument->removeChild($DOMDocument->doctype); + $DOMDocument->replaceChild($DOMDocument->firstChild->firstChild->firstChild, $DOMDocument->firstChild); + + $elementText = ''; + + if ($DOMDocument->documentElement->getAttribute('markdown') === '1') + { + foreach ($DOMDocument->documentElement->childNodes as $Node) + { + $elementText .= $DOMDocument->saveHTML($Node); + } + + $DOMDocument->documentElement->removeAttribute('markdown'); + + $elementText = "\n".$this->text($elementText)."\n"; + } + else + { + foreach ($DOMDocument->documentElement->childNodes as $Node) + { + $nodeMarkup = $DOMDocument->saveHTML($Node); + + if ($Node instanceof DOMElement and ! in_array($Node->nodeName, $this->textLevelElements)) + { + $elementText .= $this->processTag($nodeMarkup); + } + else + { + $elementText .= $nodeMarkup; + } + } + } + + # because we don't want for markup to get encoded + $DOMDocument->documentElement->nodeValue = 'placeholder\x1A'; + + $markup = $DOMDocument->saveHTML($DOMDocument->documentElement); + $markup = str_replace('placeholder\x1A', $elementText, $markup); + + return $markup; + } + + # ~ + + protected function sortFootnotes($A, $B) # callback + { + return $A['number'] - $B['number']; + } + + # + # Fields + # + + protected $regexAttribute = '(?:[#.][-\w]+[ ]*)'; +} \ No newline at end of file diff --git a/interface/lib/classes/plugin_system_config_dns_ca.inc.php b/interface/lib/classes/plugin_system_config_dns_ca.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..6144a7349a174d11c0204dae0d3ecfbcd6227892 --- /dev/null +++ b/interface/lib/classes/plugin_system_config_dns_ca.inc.php @@ -0,0 +1,92 @@ +newTemplate('templates/system_config_dns_ca_edit.htm'); + include 'lib/lang/'.$_SESSION['s']['language'].'_system_config.lng'; + $pluginTpl->setVar($wb); + if(isset($_GET['action']) && ($_GET['action'] == 'edit') && $_GET['id'] > 0) { + $pluginTpl->setVar('edit_record', 1); + $ca_id = intval($_GET['id']); + $rec = $app->db->queryOneRecord("SELECT * FROM dns_ssl_ca WHERE id = ?", $ca_id); + $pluginTpl->setVar('id', $rec['id']); + $pluginTpl->setVar('ca_name', $rec['ca_name']); + $pluginTpl->setVar('ca_issue', $rec['ca_issue']); + $pluginTpl->setVar('ca_wildcard', $rec['ca_wildcard']); + $pluginTpl->setVar('ca_critical', $rec['ca_critical']); + $pluginTpl->setVar('ca_iodef', $rec['ca_iodef']); + $pluginTpl->setVar('active', $rec['active']); + } elseif(isset($_GET['action']) && ($_GET['action'] == 'save') && $_GET['id'] > 0) { + $pluginTpl->setVar('edit_record', 0); + $ca_id = intval($_GET['id']); + $pluginTpl->setVar('id', $ca_id); + $pluginTpl->setVar('ca_name', $_POST['ca_name']); + $pluginTpl->setVar('ca_issue', $_POST['ca_issue']); + $pluginTpl->setVar('ca_wildcard', $_POST['ca_wildcard']); + $pluginTpl->setVar('ca_critical', $_POST['ca_critical']); + $pluginTpl->setVar('ca_iodef', $_POST['ca_iodef']); + $pluginTpl->setVar('active', $_POST['active']); + } else { + $pluginTpl->setVar('edit_record', 0); + } + + return $pluginTpl->grab(); + + } + + function onUpdate() { + global $app; + + $id = intval($_GET['id']); + if(isset($_GET['action']) && $_GET['action'] == 'save') { + if($id > 0) { + $app->db->query("UPDATE dns_ssl_ca SET ca_name = ?, ca_issue = ?, ca_wildcard = ?, ca_iodef = ?, active = ? WHERE id = ?", $_POST['ca_name'], $_POST['ca_issue'], $_POST['ca_wildcard'], $_POST['ca_iodef'], $_POST['active'], $_GET['id']); + } else { + $app->db->query("INSERT INTO (sys_userid, sys_groupid, sys_perm_user, sys_perm_group, sys_perm_other, ca_name, ca_issue, ca_wildcard, ca_iodef, active) VALUES(1, 1, 'riud', 'riud', '', ?, ?, ?, ?, ?", $_POST['ca_name'], $_POST['ca_issue'], $_POST['ca_wildcard'], $_POST['ca_iodef'], $_POST['active']); + } + } + } + +} + +?> diff --git a/interface/lib/classes/plugin_system_config_dns_ca_list.inc.php b/interface/lib/classes/plugin_system_config_dns_ca_list.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..eb5882bd3b5bf68ed2b42dbc6577df79d927eaa6 --- /dev/null +++ b/interface/lib/classes/plugin_system_config_dns_ca_list.inc.php @@ -0,0 +1,81 @@ +newTemplate('templates/system_config_dns_ca_list.htm'); + + //* Loading language file + $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_system_config.lng'; + include $lng_file; + $listTpl->setVar($wb); + if($_SESSION['s']['user']['typ'] == 'admin') { + if(isset($_GET['action'])) { + $ca_id = $app->functions->intval($_GET['id']); + if($_GET['action'] == 'delete' && $ca_id > 0) { + $app->db->query("DELETE FROM dns_ssl_ca WHERE id = ?", $ca_id); + } + } + } + + if(isset($_GET['action']) && $_GET['action'] == 'edit' && $_GET['id'] > 0) $listTpl->setVar('edit_record', 1); + + // Getting Datasets from DB + $ca_records = $app->db->queryAllRecords("SELECT * FROM dns_ssl_ca ORDER BY ca_name ASC"); + $records=array(); + if(is_array($ca_records) && count($ca_records) > 0) { + foreach($ca_records as $ca) { + $rec['ca_id'] = $ca['id']; + $rec['name'] = $ca['ca_name']; + $rec['active'] = $ca['active']; + $records[] = $rec; + unset($rec); + } + $listTpl->setLoop('ca_records', @$records); + } + $listTpl->setVar('parent_id', $this->form->id); + + return $listTpl->grab(); + } + +} + +?> diff --git a/interface/lib/classes/remote.d/dns.inc.php b/interface/lib/classes/remote.d/dns.inc.php index 0cc7bc77add2e11d540df99b4d57d05ac98d4c17..a4e9fca013315294ad2275fea3b5bb853ce70498 100644 --- a/interface/lib/classes/remote.d/dns.inc.php +++ b/interface/lib/classes/remote.d/dns.inc.php @@ -71,6 +71,7 @@ class remoting_dns extends remoting { $tpl_rows = explode("\n", $tpl_content); $section = ''; $vars = array(); + $vars['xfer']=''; $dns_rr = array(); foreach($tpl_rows as $row) { $row = trim($row); @@ -176,6 +177,7 @@ class remoting_dns extends remoting { $dns_rr_id = $app->db->datalogInsert('dns_rr', $insert_data, 'id'); } } + return $dns_soa_id; exit; } else { throw new SoapFault('permission_denied', $error); @@ -198,15 +200,15 @@ class remoting_dns extends remoting { } //* Add a slave zone - public function dns_slave_add($session_id, $client_id, $params) - { + public function dns_slave_add($session_id, $client_id, $params) + { if(!$this->checkPerm($session_id, 'dns_zone_add')) { throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); return false; } return $this->insertQuery('../dns/form/dns_slave.tform.php', $client_id, $params); - } - + } + //* Update a slave zone public function dns_slave_update($session_id, $client_id, $primary_id, $params) { diff --git a/interface/lib/classes/remote.d/mail.inc.php b/interface/lib/classes/remote.d/mail.inc.php index bda7e861ed429f1c9c985c3dcf6d180aef843281..25bc1e8f3f64441f9700f14497fab5137a39d3d9 100644 --- a/interface/lib/classes/remote.d/mail.inc.php +++ b/interface/lib/classes/remote.d/mail.inc.php @@ -1105,6 +1105,172 @@ class remoting_mail extends remoting { return $app->quota_lib->get_mailquota_data($client_id, false); } -} + //** xmpp functions ----------------------------------------------------------------------------------- + + public function xmpp_domain_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'xmpp_domain_get')) { + throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../mail/form/xmpp_domain.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + public function xmpp_domain_add($session_id, $client_id, $params) + { + if(!$this->checkPerm($session_id, 'xmpp_domain_add')) { + throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $primary_id = $this->insertQuery('../mail/form/xmpp_domain.tform.php', $client_id, $params); + return $primary_id; + } + + public function xmpp_domain_update($session_id, $client_id, $primary_id, $params) + { + if(!$this->checkPerm($session_id, 'xmpp_domain_update')) { + throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->updateQuery('../mail/form/xmpp_domain.tform.php', $client_id, $primary_id, $params); + return $affected_rows; + } + + public function xmpp_domain_delete($session_id, $primary_id) + { + if(!$this->checkPerm($session_id, 'xmpp_domain_delete')) { + throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../mail/form/xmpp_domain.tform.php', $primary_id); + return $affected_rows; + } + + public function xmpp_user_get($session_id, $primary_id) + { + global $app; + + if(!$this->checkPerm($session_id, 'xmpp_user_get')) { + throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $app->uses('remoting_lib'); + $app->remoting_lib->loadFormDef('../mail/form/xmpp_user.tform.php'); + return $app->remoting_lib->getDataRecord($primary_id); + } + + public function xmpp_user_add($session_id, $client_id, $params){ + global $app; + + if (!$this->checkPerm($session_id, 'xmpp_user_add')){ + throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + + $jid_parts = explode('@', $params['jid']); + $tmp = $app->db->queryOneRecord("SELECT domain FROM xmpp_domain WHERE domain = ?", $jid_parts[1]); + if($tmp['domain'] != $jid_parts[1]) { + throw new SoapFault('xmpp_domain_does_not_exist', 'XMPP domain - '.$jid_parts[1].' - does not exist.'); + return false; + } + + $affected_rows = $this->insertQuery('../mail/form/xmpp_user.tform.php', $client_id, $params); + return $affected_rows; + } + + public function xmpp_user_update($session_id, $client_id, $primary_id, $params) + { + global $app; + + if (!$this->checkPerm($session_id, 'xmpp_user_update')) + { + throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + + $jid_parts = explode('@', $jid_parts['jid']); + $tmp = $app->db->queryOneRecord("SELECT domain FROM xmpp_domain WHERE domain = ?", $jid_parts[1]); + if($tmp['domain'] != $jid_parts[1]) { + throw new SoapFault('xmpp_domain_does_not_exist', 'Mail domain - '.$jid_parts[1].' - does not exist.'); + return false; + } + + $affected_rows = $this->updateQuery('../mail/form/xmpp_user.tform.php', $client_id, $primary_id, $params); + return $affected_rows; + } + + public function xmpp_user_delete($session_id, $primary_id) + { + if (!$this->checkPerm($session_id, 'xmpp_user_delete')) + { + throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + $affected_rows = $this->deleteQuery('../mail/form/xmpp_user.tform.php', $primary_id); + return $affected_rows; + } + + public function xmpp_domain_get_by_domain($session_id, $domain) { + global $app; + if(!$this->checkPerm($session_id, 'xmpp_domain_get_by_domain')) { + throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + if (!empty($domain)) { + $sql = "SELECT * FROM xmpp_domain WHERE domain = ?"; + $result = $app->db->queryAllRecords($sql, $domain); + return $result; + } + return false; + } + public function xmpp_domain_set_status($session_id, $primary_id, $status) { + global $app; + if(!$this->checkPerm($session_id, 'xmpp_domain_set_status')) { + throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + if(in_array($status, array('active', 'inactive'))) { + if ($status == 'active') { + $status = 'y'; + } else { + $status = 'n'; + } + $sql = "UPDATE xmpp_domain SET active = ? WHERE domain_id = ?"; + $app->db->query($sql, $status, $primary_id); + $result = $app->db->affectedRows(); + return $result; + } else { + throw new SoapFault('status_undefined', 'The status is not available'); + return false; + } + } + + public function xmpp_user_set_status($session_id, $primary_id, $status) { + global $app; + if(!$this->checkPerm($session_id, 'xmpp_user_set_status')) { + throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); + return false; + } + if(in_array($status, array('active', 'inactive'))) { + if ($status == 'active') { + $status = 'y'; + } else { + $status = 'n'; + } + $sql = "UPDATE xmpp_user SET active = ? WHERE xmppuser_id = ?"; + $app->db->query($sql, $status, $primary_id); + $result = $app->db->affectedRows(); + return $result; + } else { + throw new SoapFault('status_undefined', 'The status is not available'); + return false; + } + } + +} ?> diff --git a/interface/lib/classes/remoting.inc.php b/interface/lib/classes/remoting.inc.php index 69ebac2e4c3bc628aee969470974861ba22cbe7b..24577b3b26141965a69594962b515bcfedf5c417 100644 --- a/interface/lib/classes/remoting.inc.php +++ b/interface/lib/classes/remoting.inc.php @@ -71,6 +71,8 @@ class remoting { { global $app, $conf; + $error = array(); + // Maintenance mode $app->uses('ini_parser,getconf'); $server_config_array = $app->getconf->get_global_config('misc'); @@ -80,70 +82,60 @@ class remoting { } if(empty($username)) { - throw new SoapFault('login_username_empty', 'The login username is empty.'); - return false; + $error = array('faultcode' => 'login_username_empty', 'faultstring' => 'The login username is empty.'); } if(empty($password)) { - throw new SoapFault('login_password_empty', 'The login password is empty.'); - return false; + $error = array('faultcode' => 'login_password_empty', 'faultstring' => 'The login password is empty.'); } //* Delete old remoting sessions $sql = "DELETE FROM remote_session WHERE tstamp < UNIX_TIMESTAMP()"; $app->db->query($sql); - if($client_login == true) { - $sql = "SELECT * FROM sys_user WHERE USERNAME = ?"; - $user = $app->db->queryOneRecord($sql, $username); - if($user) { - $saved_password = stripslashes($user['passwort']); + $ip = md5($_SERVER['REMOTE_ADDR']); + $sql = "SELECT * FROM `attempts_login` WHERE `ip`= ? AND `login_time` > (NOW() - INTERVAL 1 MINUTE) LIMIT 1"; + $alreadyfailed = $app->db->queryOneRecord($sql, $ip); - if(substr($saved_password, 0, 3) == '$1$') { - //* The password is crypt-md5 encrypted - $salt = '$1$'.substr($saved_password, 3, 8).'$'; + if($alreadyfailed['times'] > 5) { + throw new SoapFault('error_user_too_many_logins', 'Too many failed logins'); + return false; + } - if(crypt(stripslashes($password), $salt) != $saved_password) { - throw new SoapFault('client_login_failed', 'The login failed. Username or password wrong.'); - return false; + if (empty($error)) { + + if($client_login == true) { + $sql = "SELECT * FROM sys_user WHERE USERNAME = ?"; + $user = $app->db->queryOneRecord($sql, $username); + if($user) { + $saved_password = stripslashes($user['passwort']); + + if(substr($saved_password, 0, 3) == '$1$') { + //* The password is crypt-md5 encrypted + $salt = '$1$'.substr($saved_password, 3, 8).'$'; + + if(crypt(stripslashes($password), $salt) != $saved_password) { + $error = array('faultcode' => 'client_login_failed', 'faultstring' => 'The login failed. Username or password wrong.'); + } + } else { + //* The password is md5 encrypted + if(md5($password) != $saved_password) { + $error = array('faultcode' => 'client_login_failed', 'faultstring' => 'The login failed. Username or password wrong.'); + } } } else { - //* The password is md5 encrypted - if(md5($password) != $saved_password) { - throw new SoapFault('client_login_failed', 'The login failed. Username or password wrong.'); - return false; - } + $error = array('faultcode' => 'client_login_failed', 'faultstring' => 'The login failed. Username or password wrong.'); + } + if($user['active'] != 1) { + $error = array('faultcode' => 'client_login_failed', 'faultstring' => 'The login failed. User is blocked.'); } - } else { - throw new SoapFault('client_login_failed', 'The login failed. Username or password wrong.'); - return false; - } - if($user['active'] != 1) { - throw new SoapFault('client_login_failed', 'The login failed. User is blocked.'); - return false; - } - // now we need the client data - $client = $app->db->queryOneRecord("SELECT client.can_use_api FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $user['default_group']); - if(!$client || $client['can_use_api'] != 'y') { - throw new SoapFault('client_login_failed', 'The login failed. Client may not use api.'); - return false; - } + // now we need the client data + $client = $app->db->queryOneRecord("SELECT client.can_use_api FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $user['default_group']); + if(!$client || $client['can_use_api'] != 'y') { + $error = array('faultcode' => 'client_login_failed', 'faultstring' => 'The login failed. Client may not use api.'); + } - //* Create a remote user session - //srand ((double)microtime()*1000000); - $remote_session = md5(mt_rand().uniqid('ispco')); - $remote_userid = $user['userid']; - $remote_functions = ''; - $tstamp = time() + $this->session_timeout; - $sql = 'INSERT INTO remote_session (remote_session,remote_userid,remote_functions,client_login,tstamp' - .') VALUES (?, ?, ?, 1, $tstamp)'; - $app->db->query($sql, $remote_session,$remote_userid,$remote_functions,$tstamp); - return $remote_session; - } else { - $sql = "SELECT * FROM remote_user WHERE remote_username = ? and remote_password = md5(?)"; - $remote_user = $app->db->queryOneRecord($sql, $username, $password); - if($remote_user['remote_userid'] > 0) { //* Create a remote user session //srand ((double)microtime()*1000000); $remote_session = md5(mt_rand().uniqid('ispco')); @@ -153,11 +145,57 @@ class remoting { $sql = 'INSERT INTO remote_session (remote_session,remote_userid,remote_functions,tstamp' .') VALUES (?, ?, ?, ?)'; $app->db->query($sql, $remote_session,$remote_userid,$remote_functions,$tstamp); - return $remote_session; } else { - throw new SoapFault('login_failed', 'The login failed. Username or password wrong.'); + $sql = "SELECT * FROM remote_user WHERE remote_username = ? and remote_password = md5(?)"; + $remote_user = $app->db->queryOneRecord($sql, $username, $password); + if($remote_user['remote_userid'] > 0) { + //* Create a remote user session + //srand ((double)microtime()*1000000); + $remote_session = md5(mt_rand().uniqid('ispco')); + $remote_userid = $remote_user['remote_userid']; + $remote_functions = $remote_user['remote_functions']; + $tstamp = time() + $this->session_timeout; + $sql = 'INSERT INTO remote_session (remote_session,remote_userid,remote_functions,tstamp' + .') VALUES (?, ?, ?, ?)'; + $app->db->query($sql, $remote_session,$remote_userid,$remote_functions,$tstamp); + } else { + $error = array('faultcode' => 'login_failed', 'faultstring' => 'The login failed. Username or password wrong.'); + } + } + + } + + if (! empty($error)) { + if(! $alreadyfailed['times']) { + //* user login the first time wrong + $sql = "INSERT INTO `attempts_login` (`ip`, `times`, `login_time`) VALUES (?, 1, NOW())"; + $app->db->query($sql, $ip); + } elseif($alreadyfailed['times'] >= 1) { + //* update times wrong + $sql = "UPDATE `attempts_login` SET `times`=`times`+1, `login_time`=NOW() WHERE `ip` = ? AND `login_time` < NOW() ORDER BY `login_time` DESC LIMIT 1"; + $app->db->query($sql, $ip); + } + + $authlog = 'Failed login for user \''. $username .'\' from '. $_SERVER['REMOTE_ADDR'] .' at '. date('Y-m-d H:i:s') . ' (api)'; + $authlog_handle = fopen($conf['ispconfig_log_dir'].'/auth.log', 'a'); + fwrite($authlog_handle, $authlog ."\n"); + fclose($authlog_handle); + + throw new SoapFault($error['faultcode'], $error['faultstring']); return false; + } else { + // User login right, so attempts can be deleted + $sql = "DELETE FROM `attempts_login` WHERE `ip`=?"; + $app->db->query($sql, $ip); + + $authlog = 'Successful login for user \''. $username .'\' from '. $_SERVER['REMOTE_ADDR'] .' at '. date('Y-m-d H:i:s') . ' (api)'; + $authlog_handle = fopen($conf['ispconfig_log_dir'].'/auth.log', 'a'); + fwrite($authlog_handle, $authlog ."\n"); + fclose($authlog_handle); } + + if (isset($remote_session)) { + return $remote_session; } } @@ -552,4 +590,4 @@ class remoting { } -?> +?> \ No newline at end of file diff --git a/interface/lib/classes/tform_base.inc.php b/interface/lib/classes/tform_base.inc.php index 923953adcdc4e3ab2b7b647711e577fb29437e80..1c96afb72857a4a5d9768ee2d4016269e10e99a4 100644 --- a/interface/lib/classes/tform_base.inc.php +++ b/interface/lib/classes/tform_base.inc.php @@ -541,7 +541,7 @@ class tform_base { foreach($field['value'] as $k => $v) { $checked = ($k == $val)?' CHECKED':''; //$out .= "\r\n"; - $out .= "\r\n"; + $out .= "\r\n"; $elementNo++; } } @@ -671,7 +671,7 @@ class tform_base { foreach($field['value'] as $k => $v) { $checked = ($k == $field["default"])?' CHECKED':''; //$out .= "\r\n"; - $out .= "\r\n"; + $out .= "\r\n"; $elementNo++; } } @@ -1022,13 +1022,22 @@ class tform_base { //* Do nothing } else { if(function_exists('filter_var')) { - if(filter_var($field_value, FILTER_VALIDATE_EMAIL) === false) { - $error = true; - } else { - if (!preg_match("/^[^\\+]+$/", $field_value)) { // * disallow + in local-part + + //* When the field may contain several email addresses, split them by the char defined as separator + if(isset($validator['separator']) && $validator['separator'] != '') + $field_value_array = explode($validator['separator'], $field_value); + else $field_value_array[] = $field_value; + + foreach($field_value_array AS $field_value) { + //* FIXME: Maybe it it's no good to alter the field value, but with multiline field we get adresses with carriege-return at the end + $field_value = trim($field_value); + if(filter_var($field_value, FILTER_VALIDATE_EMAIL) === false) { + $error = true; + } elseif (!preg_match("/^[^\\+]+$/", $field_value)) { // * disallow + in local-part $error = true; } } + if ($error) { $errmsg = $validator['errmsg']; if(isset($this->wordbook[$errmsg])) { diff --git a/interface/lib/lang/ar.lng b/interface/lib/lang/ar.lng index 25dd92083138df99e34cf3d1f6cb5057af80c3b1..749cff070736c52a37b679037ce3db95c197eeca 100644 --- a/interface/lib/lang/ar.lng +++ b/interface/lib/lang/ar.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/bg.lng b/interface/lib/lang/bg.lng index ff1e39fe34d9ba526550d6276e425f8d12d9a3a4..9e7c24c93fd2b7fef0a322d877d6294400307bee 100644 --- a/interface/lib/lang/bg.lng +++ b/interface/lib/lang/bg.lng @@ -29,14 +29,14 @@ $wb['toolsarea_head_txt'] = 'Настройки'; $wb['page_and_txt'] = 'и'; $wb['top_menu_system'] = 'Система'; $wb['top_menu_client'] = 'Клиент'; -$wb['top_menu_email'] = 'Email'; +$wb['top_menu_email'] = 'Имейл'; $wb['top_menu_monitor'] = 'Монитор'; $wb['top_menu_sites'] = 'Сайтове'; $wb['top_menu_dns'] = 'DNS'; $wb['top_menu_tools'] = 'Инструменти'; $wb['top_menu_help'] = 'Помощ'; $wb['top_menu_billing'] = 'Фактуриране'; -$wb['top_menu_domain'] = 'Domains'; +$wb['top_menu_domain'] = 'Домейни'; $wb['top_menu_dashboard'] = 'Начало'; $wb['latest_news_txt'] = 'Последни новини'; $wb['top_menu_vm'] = 'VСървър'; @@ -69,93 +69,94 @@ $wb['monthnamesshort_oct'] = 'Окт'; $wb['monthnamesshort_nov'] = 'Ное'; $wb['monthnamesshort_dec'] = 'Дек'; $wb['logout_txt'] = 'Изход'; -$wb['conf_format_dateshort_human_readable'] = 'yyyy-mm-dd'; +$wb['conf_format_dateshort_human_readable'] = 'гггг-мм-дд'; $wb['submit_confirmation'] = 'Наистина ли си съгласен с това действие?'; -$wb['top_menu_mailuser'] = 'Mailuser'; -$wb['globalsearch_resultslimit_of_txt'] = 'of'; -$wb['globalsearch_resultslimit_results_txt'] = 'results'; -$wb['globalsearch_noresults_text_txt'] = 'No results.'; -$wb['globalsearch_noresults_limit_txt'] = '0 results'; -$wb['globalsearch_searchfield_watermark_txt'] = 'Search'; -$wb['globalsearch_suggestions_text_txt'] = 'Suggestions'; -$wb['global_tabchange_warning_txt'] = 'Changed data in this tab will be changed if you press OK. On cancel they will be discarded.'; -$wb['global_tabchange_discard_txt'] = 'You have unsaved changes in this tab. Changes will be discarded if you continue.'; -$wb['datalog_changes_txt'] = 'The following changes are not yet populated to all servers:'; -$wb['datalog_changes_end_txt'] = 'Storing updates can take up to one minute. Please be patient.'; -$wb['datalog_status_i_web_database'] = 'Create new database'; -$wb['datalog_status_u_web_database'] = 'Update database'; -$wb['datalog_status_d_web_database'] = 'Delete database'; -$wb['datalog_status_i_web_database_user'] = 'Create database user for database'; -$wb['datalog_status_u_web_database_user'] = 'Update database user'; -$wb['datalog_status_d_web_database_user'] = 'Delete database user'; -$wb['datalog_status_i_web_domain'] = 'Create new website'; -$wb['datalog_status_u_web_domain'] = 'Update website settings'; -$wb['datalog_status_d_web_domain'] = 'Delete website'; -$wb['datalog_status_i_ftp_user'] = 'Create FTP user'; -$wb['datalog_status_u_ftp_user'] = 'Update FTP user'; -$wb['datalog_status_d_ftp_user'] = 'Delete FTP user'; -$wb['datalog_status_i_mail_domain'] = 'Create email domain'; -$wb['datalog_status_u_mail_domain'] = 'Update email domain'; -$wb['datalog_status_d_mail_domain'] = 'Delete email domain'; -$wb['datalog_status_i_mail_user'] = 'Create email user'; -$wb['datalog_status_u_mail_user'] = 'Update email user'; -$wb['datalog_status_d_mail_user'] = 'Delete email user'; -$wb['datalog_status_i_mail_forwarding'] = 'Create email address'; -$wb['datalog_status_u_mail_forwarding'] = 'Update email address'; -$wb['datalog_status_d_mail_forwarding'] = 'Delete email address'; -$wb['datalog_status_i_dns_rr'] = 'Create DNS record'; -$wb['datalog_status_u_dns_rr'] = 'Update DNS record'; -$wb['datalog_status_d_dns_rr'] = 'Delete DNS record'; -$wb['datalog_status_i_dns_soa'] = 'Create DNS zone'; -$wb['datalog_status_u_dns_soa'] = 'Update DNS zone'; -$wb['datalog_status_d_dns_soa'] = 'Delete DNS zone'; -$wb['datalog_status_i_cron'] = 'Create cron job'; -$wb['datalog_status_u_cron'] = 'Update cron job'; -$wb['datalog_status_d_cron'] = 'Delete cron job'; -$wb['datalog_status_i_mail_get'] = 'Create mail fetcher account'; -$wb['datalog_status_u_mail_get'] = 'Update mail fetcher account'; -$wb['datalog_status_d_mail_get'] = 'Delete mail fetcher account'; -$wb['datalog_status_i_mail_mailinglist'] = 'Create mailing list'; -$wb['datalog_status_u_mail_mailinglist'] = 'Update mailing list'; -$wb['datalog_status_d_mail_mailinglist'] = 'Delete mailing list'; -$wb['datalog_status_i_shell_user'] = 'Create shell user'; -$wb['datalog_status_u_shell_user'] = 'Update shell user'; -$wb['datalog_status_d_shell_user'] = 'Delete shell user'; -$wb['datalog_status_i_web_folder'] = 'Create folder protection'; -$wb['datalog_status_u_web_folder'] = 'Update folder protection'; -$wb['datalog_status_d_web_folder'] = 'Delete folder protection'; -$wb['datalog_status_i_web_folder_user'] = 'Create folder protection user'; -$wb['datalog_status_u_web_folder_user'] = 'Update folder protection user'; -$wb['datalog_status_d_web_folder_user'] = 'Delete folder protection user'; -$wb['datalog_status_i_spamfilter_users'] = 'Create spam filter settings'; -$wb['datalog_status_u_spamfilter_users'] = 'Update spam filter settings'; -$wb['datalog_status_d_spamfilter_users'] = 'Delete spam filter settings'; -$wb['login_as_txt'] = 'Log in as'; -$wb['no_domain_perm'] = 'You have no permission for this domain.'; -$wb['no_destination_perm'] = 'You have no permission for this destination.'; -$wb['client_you_are_locked'] = 'You have no permission to change any settings.'; -$wb['gender_m_txt'] = 'Mr.'; -$wb['gender_f_txt'] = 'Ms.'; -$wb['client_cannot_be_deleted_because_of_billing_module_txt'] = 'This client has records in the billing module, therefore he cannot be deleted.'; -$wb['yes_txt'] = 'Yes'; -$wb['no_txt'] = 'No'; -$wb['None'] = 'None'; -$wb['strength_1'] = 'Weak'; -$wb['strength_2'] = 'Fair'; -$wb['strength_3'] = 'Good'; -$wb['strength_4'] = 'Strong'; -$wb['strength_5'] = 'Very Strong'; -$wb['weak_password_txt'] = 'The chosen password does not match the security guidelines. It has to be at least {chars} chars in length and have a strength of \\"{strength}\\".'; -$wb['weak_password_length_txt'] = 'The chosen password does not match the security guidelines. It has to be at least {chars} chars in length.'; -$wb['security_check1_txt'] = 'Check for security permission:'; -$wb['security_check2_txt'] = 'failed.'; -$wb['err_csrf_attempt_blocked'] = 'CSRF attempt blocked.'; -$wb['select_directive_snippet_txt'] = 'Directive Snippets'; -$wb['select_master_directive_snippet_txt'] = 'Master Directive Snippets'; -$wb['datalog_status_i_xmpp_domain'] = 'Create XMPP domain'; -$wb['datalog_status_u_xmpp_domain'] = 'Update XMPP domain'; -$wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; -$wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; -$wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; -$wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['top_menu_mailuser'] = 'Имейл потребител'; +$wb['globalsearch_resultslimit_of_txt'] = 'от'; +$wb['globalsearch_resultslimit_results_txt'] = 'резултата'; +$wb['globalsearch_noresults_text_txt'] = 'Няма намерени резултати.'; +$wb['globalsearch_noresults_limit_txt'] = '0 резултата'; +$wb['globalsearch_searchfield_watermark_txt'] = 'Търсене'; +$wb['globalsearch_suggestions_text_txt'] = 'Предложения'; +$wb['global_tabchange_warning_txt'] = 'Промените в тази секция бъдат запазени ако натиснете OK. При отмяна ще бъдат отхвърлени.'; +$wb['global_tabchange_discard_txt'] = 'Направили сте промени, които не са запазени. Промените ще бъдат отхвърлени, ако продължите.'; +$wb['datalog_changes_txt'] = 'Следните промени все още не са отразени на всички сървъри:'; +$wb['datalog_changes_end_txt'] = 'Запазването на промените може да отнеме до една минута. Моля, бъдете търпеливи.'; +$wb['datalog_status_i_web_database'] = 'Създай нова база данни'; +$wb['datalog_status_u_web_database'] = 'Обнови база данни'; +$wb['datalog_status_d_web_database'] = 'Изтрий база данни'; +$wb['datalog_status_i_web_database_user'] = 'Създай потребител за база данни'; +$wb['datalog_status_u_web_database_user'] = 'Обнови потребител за база данни'; +$wb['datalog_status_d_web_database_user'] = 'Изтрий потребител за база данни'; +$wb['datalog_status_i_web_domain'] = 'Създай нов уебсайт'; +$wb['datalog_status_u_web_domain'] = 'Обнови уебсайт настройките'; +$wb['datalog_status_d_web_domain'] = 'Изтрий уебсайт'; +$wb['datalog_status_i_ftp_user'] = 'Създай FTP потребител'; +$wb['datalog_status_u_ftp_user'] = 'Обнови FTP потребител'; +$wb['datalog_status_d_ftp_user'] = 'Изтрий FTP потребител'; +$wb['datalog_status_i_mail_domain'] = 'Създай имейл домейн'; +$wb['datalog_status_u_mail_domain'] = 'Обнови имейл домейн'; +$wb['datalog_status_d_mail_domain'] = 'Изтрий имейл домейн'; +$wb['datalog_status_i_mail_user'] = 'Създай имейл потребител'; +$wb['datalog_status_u_mail_user'] = 'Обнови имейл потребител'; +$wb['datalog_status_d_mail_user'] = 'Изтрий имейл потребител'; +$wb['datalog_status_i_mail_forwarding'] = 'Създай имейл адрес'; +$wb['datalog_status_u_mail_forwarding'] = 'Обнови имейл адрес'; +$wb['datalog_status_d_mail_forwarding'] = 'Изтрий имейл адрес'; +$wb['datalog_status_i_dns_rr'] = 'Създай DNS запис'; +$wb['datalog_status_u_dns_rr'] = 'Обнови DNS запис'; +$wb['datalog_status_d_dns_rr'] = 'Изтрий DNS запис'; +$wb['datalog_status_i_dns_soa'] = 'Създай DNS зона'; +$wb['datalog_status_u_dns_soa'] = 'Обнови DNS зона'; +$wb['datalog_status_d_dns_soa'] = 'Изтрий DNS зона'; +$wb['datalog_status_i_cron'] = 'Създай автоматична задача'; +$wb['datalog_status_u_cron'] = 'Обнови автоматична задача'; +$wb['datalog_status_d_cron'] = 'Изтрий автоматична задача'; +$wb['datalog_status_i_mail_get'] = 'Създай имейл акаунт за извличане на поща'; +$wb['datalog_status_u_mail_get'] = 'Обнови имейл акаунт за извличане на поща'; +$wb['datalog_status_d_mail_get'] = 'Изтрий имейл акаунт за извличане на поща'; +$wb['datalog_status_i_mail_mailinglist'] = 'Създай пощенски списък'; +$wb['datalog_status_u_mail_mailinglist'] = 'Обнови пощенски списък'; +$wb['datalog_status_d_mail_mailinglist'] = 'Изтрий пощенски списък'; +$wb['datalog_status_i_shell_user'] = 'Създай shell потребител'; +$wb['datalog_status_u_shell_user'] = 'Обнови shell потребител'; +$wb['datalog_status_d_shell_user'] = 'Изтрий shell потребител'; +$wb['datalog_status_i_web_folder'] = 'Създай защитена директория'; +$wb['datalog_status_u_web_folder'] = 'Обнови защитена директория'; +$wb['datalog_status_d_web_folder'] = 'Изтрий защитена директория'; +$wb['datalog_status_i_web_folder_user'] = 'Създай потребител за защитена директория'; +$wb['datalog_status_u_web_folder_user'] = 'Обнови потребител за защитена директория'; +$wb['datalog_status_d_web_folder_user'] = 'Изтрий потребител за защитена директория'; +$wb['datalog_status_i_spamfilter_users'] = 'Създай спам филтър настройки'; +$wb['datalog_status_u_spamfilter_users'] = 'Обнови спам филтър настройки'; +$wb['datalog_status_d_spamfilter_users'] = 'Изтрий спам филтър настройки'; +$wb['login_as_txt'] = 'Логнат като'; +$wb['no_domain_perm'] = 'Нямате права върху този домейн.'; +$wb['no_destination_perm'] = 'Нямате права върху тази дестинация.'; +$wb['client_you_are_locked'] = 'Нямате права да променяте каквито и да било настройки.'; +$wb['gender_m_txt'] = 'Г-н'; +$wb['gender_f_txt'] = 'Г-жа'; +$wb['client_cannot_be_deleted_because_of_billing_module_txt'] = 'Този клиент не може да бъде изтрит, тъй като за него съществуват записи в билинг системата.'; +$wb['yes_txt'] = 'Да'; +$wb['no_txt'] = 'Не'; +$wb['None'] = 'Без'; +$wb['strength_1'] = 'Слаба'; +$wb['strength_2'] = 'Лесна'; +$wb['strength_3'] = 'Добра'; +$wb['strength_4'] = 'Сложна'; +$wb['strength_5'] = 'Много сложна'; +$wb['weak_password_txt'] = 'Избраната парола не отговаря на изискванията за сигурност. Трябва да съдържа поне {chars} символа и сложността и трябва да е \\"{strength}\\".'; +$wb['weak_password_length_txt'] = 'Избраната парола не отговаря на изискванията за сигурност. Трябва да съдържа поне {chars} символа.'; +$wb['security_check1_txt'] = 'Проверете за права за сигурност:'; +$wb['security_check2_txt'] = 'се провали.'; +$wb['err_csrf_attempt_blocked'] = 'CSRF опитът е блокиран.'; +$wb['select_directive_snippet_txt'] = 'Извлечения от директивите'; +$wb['select_master_directive_snippet_txt'] = 'Мастър Извлечения от директивите'; +$wb['datalog_status_i_xmpp_domain'] = 'Създай XMPP домейн'; +$wb['datalog_status_u_xmpp_domain'] = 'Обнови XMPP домейн'; +$wb['datalog_status_d_xmpp_domain'] = 'Изтрий XMPP домейн'; +$wb['datalog_status_i_xmpp_user'] = 'Създай XMPP потребител'; +$wb['datalog_status_u_xmpp_user'] = 'Обнови XMPP потребител'; +$wb['datalog_status_d_xmpp_user'] = 'Изтрий XMPP потребител'; +$wb['datalog_changes_close_txt'] = 'Затвори'; ?> diff --git a/interface/lib/lang/br.lng b/interface/lib/lang/br.lng index 156a52ca19ce26b80d66c8ab40baeb5c8577e927..03624037179552ad5101eb8116c76a5118490e41 100644 --- a/interface/lib/lang/br.lng +++ b/interface/lib/lang/br.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/ca.lng b/interface/lib/lang/ca.lng index c39cd0db272fcd0861f0fad0b5d448a6a119c202..dc4ca57a82fe54514f7621106f8735080437f57b 100644 --- a/interface/lib/lang/ca.lng +++ b/interface/lib/lang/ca.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/cz.lng b/interface/lib/lang/cz.lng index 259b66d9131568a993552b2a06c4db20524c5bec..b20e9358ecc0a6b6e8e588a5fd6cd23b0c2d38d6 100644 --- a/interface/lib/lang/cz.lng +++ b/interface/lib/lang/cz.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/de.lng b/interface/lib/lang/de.lng index 61551ceeab566d7472f5d4f41687703edf63a34a..f690a51c4cdf4fd278f35536b738a29bbf07e37e 100644 --- a/interface/lib/lang/de.lng +++ b/interface/lib/lang/de.lng @@ -158,4 +158,5 @@ $wb['security_check1_txt'] = 'Sicherheitsüberprüfung für:'; $wb['security_check2_txt'] = 'fehlgeschlagen.'; $wb['select_directive_snippet_txt'] = 'Direktiven Schnipsel'; $wb['select_master_directive_snippet_txt'] = 'Master Direktiven Schnipsel'; +$wb['datalog_changes_close_txt'] = 'Schließen'; ?> diff --git a/interface/lib/lang/dk.lng b/interface/lib/lang/dk.lng index 798d2ccd451ef6d6f3d02cb7fbe4869de621754d..f9f2f1b4b1e7841607ef13020fbd8d65d760596c 100644 --- a/interface/lib/lang/dk.lng +++ b/interface/lib/lang/dk.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/el.lng b/interface/lib/lang/el.lng index 382bf4a75839c737702cb9124cd900d739c044f8..0c8ad1afa45a7c8665db00672f865875d674b8d6 100644 --- a/interface/lib/lang/el.lng +++ b/interface/lib/lang/el.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/en.lng b/interface/lib/lang/en.lng index 66f4ee3811efc6c82b08b4338cfafc33c5013d9e..a3b9a53ae173cafe67fa20a1432e9771fbdab289 100644 --- a/interface/lib/lang/en.lng +++ b/interface/lib/lang/en.lng @@ -122,6 +122,9 @@ $wb['datalog_status_d_mail_get'] = 'Delete mail fetcher account'; $wb['datalog_status_i_mail_mailinglist'] = 'Create mailing list'; $wb['datalog_status_u_mail_mailinglist'] = 'Update mailing list'; $wb['datalog_status_d_mail_mailinglist'] = 'Delete mailing list'; +$wb['datalog_status_i_mail_ml_membership'] = 'Create mailing list member'; +$wb['datalog_status_u_mail_ml_membership'] = 'Update mailing list member'; +$wb['datalog_status_d_mail_ml_membership'] = 'Delete mailing list member'; $wb['datalog_status_i_shell_user'] = 'Create shell user'; $wb['datalog_status_u_shell_user'] = 'Update shell user'; $wb['datalog_status_d_shell_user'] = 'Delete shell user'; @@ -159,4 +162,5 @@ $wb['security_check1_txt'] = 'Check for security permission:'; $wb['security_check2_txt'] = 'failed.'; $wb['select_directive_snippet_txt'] = 'Directive Snippets'; $wb['select_master_directive_snippet_txt'] = 'Master Directive Snippets'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> \ No newline at end of file diff --git a/interface/lib/lang/es.lng b/interface/lib/lang/es.lng index 3b1bae0b469eb7e9e1a904c6d41e320e0b980efc..506629c9459c28d3a5159288a09e30656d2468f7 100644 --- a/interface/lib/lang/es.lng +++ b/interface/lib/lang/es.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/fi.lng b/interface/lib/lang/fi.lng index d4c23ca777a6388718c07c4be4f6883b99392476..4cec2fc37c928215ee3733d811dbddba700a340c 100755 --- a/interface/lib/lang/fi.lng +++ b/interface/lib/lang/fi.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/fr.lng b/interface/lib/lang/fr.lng index 3e9bfa8daa4521f3c5a568df8ff0e4a6932115a3..aa1392db627f7e217c892e6f19d881c79b29a02c 100644 --- a/interface/lib/lang/fr.lng +++ b/interface/lib/lang/fr.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/hr.lng b/interface/lib/lang/hr.lng index 310371be479f1ea8d250aa7956dd7da305318817..e66a36c8c55ee073c15b8f145710c13599f18371 100644 --- a/interface/lib/lang/hr.lng +++ b/interface/lib/lang/hr.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/hu.lng b/interface/lib/lang/hu.lng index dd4cce79b3bffd015b61ffc7c06379148e78b677..8f4e8761bf8049ebc6cd18327cbd02a4971e5486 100644 --- a/interface/lib/lang/hu.lng +++ b/interface/lib/lang/hu.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/id.lng b/interface/lib/lang/id.lng index bd90fd5a1b5e10cb294cec6ff7486a3365bb61e4..45447b4756dc08974c5f2677404f6489013727f5 100644 --- a/interface/lib/lang/id.lng +++ b/interface/lib/lang/id.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/it.lng b/interface/lib/lang/it.lng index 33d16c3d5f66d055bfabf69dc69e4dbc7a16ae51..f5c22a67449051aba44ea9777367ddfd957728b1 100644 --- a/interface/lib/lang/it.lng +++ b/interface/lib/lang/it.lng @@ -114,6 +114,9 @@ $wb['datalog_status_d_cron'] = 'Elimina cron job'; $wb['datalog_status_i_mail_mailinglist'] = 'Crea mailing list'; $wb['datalog_status_u_mail_mailinglist'] = 'Aggiorna mailing list'; $wb['datalog_status_d_mail_mailinglist'] = 'Elimina mailing list'; +$wb['datalog_status_i_mail_ml_membership'] = 'Crea membro di mailing list'; +$wb['datalog_status_u_mail_ml_membership'] = 'Aggiorna membro di mailing list'; +$wb['datalog_status_d_mail_ml_membership'] = 'Elimina membro di mailing list'; $wb['datalog_status_i_shell_user'] = 'Crea utente shell'; $wb['datalog_status_u_shell_user'] = 'Aggiorna utente shell'; $wb['datalog_status_d_shell_user'] = 'Elimina utente shell'; @@ -142,20 +145,21 @@ $wb['weak_password_txt'] = 'La password indicata non segue le impostazioni di si $wb['weak_password_length_txt'] = 'La password indicata non segue le impostazioni di sicurezza. Deve essere lunga almeno {chars} caratteri.'; $wb['security_check1_txt'] = 'Verifica permessi di sicurezza:'; $wb['security_check2_txt'] = 'fallito.'; -$wb['global_tabchange_warning_txt'] = 'Changed data in this tab will be changed if you press OK. On cancel they will be discarded.'; -$wb['datalog_status_i_mail_get'] = 'Create mail fetcher account'; -$wb['datalog_status_u_mail_get'] = 'Update mail fetcher account'; -$wb['datalog_status_d_mail_get'] = 'Delete mail fetcher account'; -$wb['datalog_status_i_web_folder_user'] = 'Create folder protection user'; -$wb['datalog_status_u_web_folder_user'] = 'Update folder protection user'; -$wb['datalog_status_d_web_folder_user'] = 'Delete folder protection user'; -$wb['err_csrf_attempt_blocked'] = 'CSRF attempt blocked.'; -$wb['select_directive_snippet_txt'] = 'Directive Snippets'; +$wb['global_tabchange_warning_txt'] = 'Cliccando OK le modifiche effettuate in questo tab verranno salvate. Cancel per non salvare le modifiche.'; +$wb['datalog_status_i_mail_get'] = 'Crea account mail fetcher'; +$wb['datalog_status_u_mail_get'] = 'Aggiorna account mail fetcher'; +$wb['datalog_status_d_mail_get'] = 'Elimina account mail fetcher'; +$wb['datalog_status_i_web_folder_user'] = 'Crea protezione cartella'; +$wb['datalog_status_u_web_folder_user'] = 'Aggiorna protezione cartella'; +$wb['datalog_status_d_web_folder_user'] = 'Elimina protezione cartella'; +$wb['err_csrf_attempt_blocked'] = 'Tentativo CSRF bloccato.'; +$wb['select_directive_snippet_txt'] = 'Snippets direttiva'; $wb['select_master_directive_snippet_txt'] = 'Master Directive Snippets'; -$wb['datalog_status_i_xmpp_domain'] = 'Create XMPP domain'; -$wb['datalog_status_u_xmpp_domain'] = 'Update XMPP domain'; -$wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; -$wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; -$wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; -$wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_status_i_xmpp_domain'] = 'Crea dominio XMPP'; +$wb['datalog_status_u_xmpp_domain'] = 'Aggiorna dominio XMPP'; +$wb['datalog_status_d_xmpp_domain'] = 'Elimina dominio XMPP'; +$wb['datalog_status_i_xmpp_user'] = 'Crea utente XMPP'; +$wb['datalog_status_u_xmpp_user'] = 'Aggiorna utente XMPP'; +$wb['datalog_status_d_xmpp_user'] = 'Elimina utente XMPP'; +$wb['datalog_changes_close_txt'] = 'Chiudi'; ?> diff --git a/interface/lib/lang/ja.lng b/interface/lib/lang/ja.lng index 2a56e77399dc0a7d9f98fabba751d7e909082525..0946603c46b2955b13384c67d454cbaa0a5a079e 100644 --- a/interface/lib/lang/ja.lng +++ b/interface/lib/lang/ja.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/nl.lng b/interface/lib/lang/nl.lng index 888f9c020098702b7d3c1e4b8e9a956419bbee71..0605e02a125722a6dfa41b6f8831c0e99a2e2cc3 100644 --- a/interface/lib/lang/nl.lng +++ b/interface/lib/lang/nl.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/pl.lng b/interface/lib/lang/pl.lng index b5b62c816dd9a20b699ee7eaef9bc076d7af3c6b..b225430f15336748639d7fa5fbf3ce2b7bd84f3c 100644 --- a/interface/lib/lang/pl.lng +++ b/interface/lib/lang/pl.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/pt.lng b/interface/lib/lang/pt.lng index 7845520a5bb8db428dab5d281e2bfe476eb725c3..7f232a8e73f323c4ff5fc4015b43f4453a12de6f 100644 --- a/interface/lib/lang/pt.lng +++ b/interface/lib/lang/pt.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/ro.lng b/interface/lib/lang/ro.lng index 613f2377a12bfe152ad2bcc0764ed4480cc8ac51..6db08b7e1e1dcef4cf0305cd248293ab86b4d247 100644 --- a/interface/lib/lang/ro.lng +++ b/interface/lib/lang/ro.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/ru.lng b/interface/lib/lang/ru.lng index 823ef44c79161730252ef0143cb5960a457807d1..a1503b2677cd52858cb1b70349ca4201f5ed5a7e 100644 --- a/interface/lib/lang/ru.lng +++ b/interface/lib/lang/ru.lng @@ -68,7 +68,7 @@ $wb['monthnamesshort_sep'] = 'Сен'; $wb['monthnamesshort_oct'] = 'Окт'; $wb['monthnamesshort_nov'] = 'Ноя'; $wb['monthnamesshort_dec'] = 'Дек'; -$wb['conf_format_dateshort_human_readable'] = 'гггг-мм-дд'; +$wb['conf_format_dateshort_human_readable'] = 'yyyy-mm-dd'; $wb['logout_txt'] = 'Выход'; $wb['submit_confirmation'] = 'Вы действительно хотите выполнить это действие?'; $wb['top_menu_mailuser'] = 'Пользователь почты'; @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Удалить домен XMPP'; $wb['datalog_status_i_xmpp_user'] = 'Создать пользователя XMPP'; $wb['datalog_status_u_xmpp_user'] = 'Обновить пользователя XMPP'; $wb['datalog_status_d_xmpp_user'] = 'Удалить пользователя XMPP'; + ?> diff --git a/interface/lib/lang/se.lng b/interface/lib/lang/se.lng index b6767144df9eaaca9528a3666128a2a6af85f114..cd7d80e9c39521ad8c2a19c3ca52df04d87912b5 100644 --- a/interface/lib/lang/se.lng +++ b/interface/lib/lang/se.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/sk.lng b/interface/lib/lang/sk.lng index 6b4ef7676f8f38e29409f6b649a3b063670c6853..a2c13805c69d4a84a4566ef3e1945531c2e3bcd1 100644 --- a/interface/lib/lang/sk.lng +++ b/interface/lib/lang/sk.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/lang/tr.lng b/interface/lib/lang/tr.lng index 115bc890bb97fb7536a4960bc705b0e05d37a46c..8e7b790b74716d96f31d2269cfc3661f4ca606b3 100644 --- a/interface/lib/lang/tr.lng +++ b/interface/lib/lang/tr.lng @@ -158,4 +158,5 @@ $wb['datalog_status_d_xmpp_domain'] = 'Delete XMPP domain'; $wb['datalog_status_i_xmpp_user'] = 'Create XMPP user'; $wb['datalog_status_u_xmpp_user'] = 'Update XMPP user'; $wb['datalog_status_d_xmpp_user'] = 'Delete XMPP user'; +$wb['datalog_changes_close_txt'] = 'Close'; ?> diff --git a/interface/lib/plugins/mail_user_filter_plugin.inc.php b/interface/lib/plugins/mail_user_filter_plugin.inc.php index 5afd1c004494fc96062d253d3aa8f8779e6a235b..5b898f84c667eaf5f298f87a29983b7f7a26053d 100644 --- a/interface/lib/plugins/mail_user_filter_plugin.inc.php +++ b/interface/lib/plugins/mail_user_filter_plugin.inc.php @@ -193,6 +193,8 @@ class mail_user_filter_plugin { $content .= " stop;\n"; } elseif ($page_form->dataRecord["action"] == 'reject') { $content .= ' reject "'.$page_form->dataRecord["target"].'"; stop;\n\n'; + } elseif ($page_form->dataRecord["action"] == 'read') { + $content .= ' setflag "\\\\Seen";\n stop;\n'; } else { $content .= " discard;\n stop;\n"; } @@ -254,6 +256,8 @@ if ( ".'$RETURNCODE'." != 1 ) $content .= 'ID' . "$page_form->id" . 'EndFolder = "$DEFAULT/.' . $page_form->dataRecord['target'] . '/"' . "\n"; $content .= "xfilter \"/usr/bin/formail -A \\\"X-User-Mail-Filter-ID"."$page_form->id".": Yes\\\"\"" . "\n"; $content .= "to ". '$ID' . "$page_form->id" . 'EndFolder' . "\n"; + } elseif ($page_form->dataRecord["action"] == 'read') { + $content .= ''; // mark as read currently not supported for Maildrop } else { $content .= "to /dev/null\n"; } diff --git a/interface/lib/plugins/system_config_dns_ca_plugin.inc.php b/interface/lib/plugins/system_config_dns_ca_plugin.inc.php new file mode 100644 index 0000000000000000000000000000000000000000..5ab338640c006065a653abbaa97f3ce507972459 --- /dev/null +++ b/interface/lib/plugins/system_config_dns_ca_plugin.inc.php @@ -0,0 +1,103 @@ +plugin->registerEvent('dns:dns_caa:on_after_update', 'system_config_dns_ca_plugin', 'caa_update'); + $app->plugin->registerEvent('dns:dns_caa:on_after_insert', 'system_config_dns_ca_plugin', 'caa_update'); + + $app->plugin->registerEvent('sites:web_vhost_domain:on_after_insert', 'system_config_dns_ca_plugin', 'web_vhost_domain_edit'); + $app->plugin->registerEvent('sites:web_vhost_domain:on_after_update', 'system_config_dns_ca_plugin', 'web_vhost_domain_edit'); + } + + function caa_update($event_name, $page_form) { + global $app; + + if(trim($page_form->dataRecord['additional'] != '')) { + $rec = $app->db->queryOneRecord("SELECT * FROM dns_rr WHERE id = ?", $page_form->id); + unset($rec['id']); + $zone = $app->db->queryOneRecord("SELECT origin FROM dns_soa WHERE id = ?", $rec['zone']); + $host=str_replace($zone['origin'], '', $page_form->dataRecord['name']); + $host=rtrim($host,'.'); + $page_form->dataRecord['additional']=str_replace($host, '', $page_form->dataRecord['additional']); + $additional=explode(',', $page_form->dataRecord['additional']); + foreach($additional as $new) { + if($new != '') { + $insert_data = $rec; + $insert_data['name'] = $new.'.'.$zone['origin']; + $app->db->datalogInsert('dns_rr', $insert_data, 'id'); + } + } + } + } //* End function + + function web_vhost_domain_edit($event_name, $page_form) { + global $app; + + if($page_form->dataRecord['ssl_letsencrypt'] == 'y') { + $domain = $page_form->dataRecord['domain']; + $subdomain = $page_form->dataRecord['subdomain']; + $temp=$app->db->queryAllRecords("SELECT * FROM dns_rr WHERE type = 'CAA' AND (name = ? OR name = ?) AND data like ?", $domain.'.', $subdomain.'.'.$domain.'.', '%letsencrypt%'); + if(count($temp) == 0) { + $caa = $app->db->queryOneRecord("SELECT * FROM dns_ssl_ca WHERE ca_issue = 'letsencrypt.org' AND active = 'Y'"); + $soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE origin = ?", $domain.'.'); + if(is_array($caa) && is_array($soa)) { + $records = array(); + $records[] = $domain.'.';; + if($subdomain != '' && $subdomain != 'www') $records[] = $subdomain.'.'.$domain; + foreach($records as $record) { + $new_rr = $app->db->queryOneRecord("SELECT * FROM dns_rr WHERE name = ?", $soa['origin']); + unset($new_rr['id']); + $new_rr['type'] = 'CAA'; + $new_rr['name'] = $record; + $new_rr['data'] = "0 issue \"$caa[ca_issue]\""; + $new_rr['ttl'] = $soa['ttl']; + $new_rr['active'] = 'Y'; + $new_rr['stamp'] = date('Y-m-d H:i:s'); + $new_rr['serial'] = $app->validate_dns->increase_serial($new_rr['serial']); + $app->db->datalogInsert('dns_rr', $new_rr, 'id', $new_rr['zone']); + $zone = $app->db->queryOneRecord("SELECT id, serial FROM dns_soa WHERE active = 'Y' AND id = ?", $new_rr['zone']); + $new_serial = $app->validate_dns->increase_serial($zone['serial']); + $app->db->datalogUpdate('dns_soa', array("serial" => $new_serial), 'id', $zone['id']); + } + } + } + } + } + +} // End class + +?> diff --git a/interface/web/admin/form/server_config.tform.php b/interface/web/admin/form/server_config.tform.php index 5cf56ca5372befe9de7d5de2c930d476d99b7bc8..9146056017e85a8ce9b352c180d569f3f74b1661 100644 --- a/interface/web/admin/form/server_config.tform.php +++ b/interface/web/admin/form/server_config.tform.php @@ -357,6 +357,34 @@ $form["tabs"]['server'] = array( 'width' => '40', 'maxlength' => '255' ), + 'nagios_url' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'validators' => array ( 0 => array ( 'type' => 'REGEX', + 'regex' => '/(^$)|(^((?:http|https)(?::\\/{2}[\\w]+)(?:[\\/|\\.]?)(?:[^\\s"]*))$)/', + 'errmsg'=> 'nagios_url_error_regex'), + ), + 'value' => '', + 'width' => '40', + 'maxlength' => '255' + ), + 'nagios_user' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'width' => '40', + 'maxlength' => '255' + ), + 'nagios_password' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'width' => '40', + 'maxlength' => '255' + ), 'monitor_system_updates' => array( 'datatype' => 'VARCHAR', 'formtype' => 'CHECKBOX', @@ -608,6 +636,12 @@ $form["tabs"]['mail'] = array( 'default' => 'n', 'value' => array(0 => 'n', 1 => 'y') ), + 'mailinglist_manager' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'SELECT', + 'default' => '20', + 'value' => array('mlmmj' => 'Mlmmj', 'mailman' => 'Mailman') + ), //################################# // ENDE Datatable fields //################################# @@ -1574,7 +1608,7 @@ $form["tabs"]['jailkit'] = array( 'validators' => array( 0 => array('type' => 'NOTEMPTY', 'errmsg' => 'jailkit_chroot_app_programs_error_empty'), 1 => array ( 'type' => 'REGEX', - 'regex' => '/^[a-zA-Z0-9\.\-\_\/\ ]{1,}$/', + 'regex' => '/^[a-zA-Z0-9\*\.\-\_\/\ ]{1,}$/', 'errmsg'=> 'jailkit_chroot_app_programs_error_regex'), ), 'value' => '', diff --git a/interface/web/admin/form/system_config.tform.php b/interface/web/admin/form/system_config.tform.php index 72618657968a7642d32f8f35ef1607af82877fef..9e00f29f89584a8d7dfcf30c37f672e8d3354935 100644 --- a/interface/web/admin/form/system_config.tform.php +++ b/interface/web/admin/form/system_config.tform.php @@ -160,6 +160,12 @@ $form["tabs"]['sites'] = array ( 'default' => 'n', 'value' => array(0 => 'n', 1 => 'y') ), + 'asp_new_package_disabled' => array( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'n', + 'value' => array(0 => 'n', 1 => 'y') + ), 'client_username_web_check_disabled' => array ( 'datatype' => 'VARCHAR', 'formtype' => 'CHECKBOX', @@ -238,6 +244,12 @@ $form["tabs"]['mail'] = array ( 'default' => 'y', 'value' => array(0 => 'n', 1 => 'y') ), + 'mailbox_show_backup_tab' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'CHECKBOX', + 'default' => 'y', + 'value' => array(0 => 'n', 1 => 'y') + ), 'mailboxlist_webmail_link' => array ( 'datatype' => 'VARCHAR', 'formtype' => 'CHECKBOX', @@ -634,5 +646,21 @@ $form["tabs"]['misc'] = array ( ) ); +$form['tabs']['dns_ca'] = array ( + 'title' => 'DNS CAs', + 'width' => 100, + 'template' => 'templates/system_config_dns_ca.htm', + 'fields' => array (), + 'plugins' => array ( + 'dns_ca' => array ( + 'class' => 'plugin_system_config_dns_ca', + 'options' => array() + ), + 'dns_ca_list' => array ( + 'class' => 'plugin_system_config_dns_ca_list', + 'options' => array() + ) + ) +); ?> diff --git a/interface/web/admin/lib/lang/ar_system_config.lng b/interface/web/admin/lib/lang/ar_system_config.lng index 45fb0fa9e9a26d796f1b91a8697e84bbd4af64e7..d5a54ab724053bb52b84b791c2f406a2aa194415 100644 --- a/interface/web/admin/lib/lang/ar_system_config.lng +++ b/interface/web/admin/lib/lang/ar_system_config.lng @@ -52,6 +52,7 @@ $wb['backups_include_into_web_quota_txt'] = 'Include backup files into web quota $wb['mailbox_show_autoresponder_tab_txt'] = 'Show autoresponder tab in mail account details'; $wb['mailbox_show_mail_filter_tab_txt'] = 'Show mail filter tab in mail account details'; $wb['mailbox_show_custom_rules_tab_txt'] = 'Show custom mailfilter tab in mail account details'; +$wb['mailbox_show_backup_tab_txt'] = 'Show backup tab in mail account details'; $wb['webmail_url_error_regex'] = 'Invalid webmail URL'; $wb['phpmyadmin_url_note_txt'] = 'Placeholder:'; $wb['webmail_url_note_txt'] = 'Placeholder:'; @@ -81,4 +82,12 @@ $wb['default_webserver_txt'] = 'Default Webserver'; $wb['default_dnsserver_txt'] = 'Default DNS Server'; $wb['default_slave_dnsserver_txt'] = 'Default Secondary DNS Server'; $wb['default_dbserver_txt'] = 'Default Database Server'; +$wb['ca_name_txt'] = 'Name'; +$wb['ca_issue_txt'] = 'Issue'; +$wb['ca_wildcard_txt'] = 'Use Wildcard'; +$wb['ca_critical_txt'] = 'Strict Check'; //For future use. At this time, CA+ | ||
---|---|---|
{tmpl_var name="active"} | +{tmpl_var name="name"} | ++ + + | +
{tmpl_var name="toolsarea_head_txt"}
+ + + + + + +{tmpl_var name='search_limit'} | +||||
---|---|---|---|---|
+ | + | + | + | + + | +
{tmpl_var name="mailinglist_id"} | +{tmpl_var name="email"} | +{tmpl_var name="name"} | +{tmpl_var name="goodbye_msg"} | ++ + | +
{tmpl_var name='globalsearch_noresults_text_txt'} | +||||