Commit 72695f03 authored by tbrehm's avatar tbrehm

Merged Revisions 3771-3801 from stable branch.

parent a126d73f
......@@ -100,7 +100,7 @@ class installer_dist extends installer_base {
'smtpd_tls_security_level = may',
'smtpd_tls_cert_file = '.$config_dir.'/smtpd.cert',
'smtpd_tls_key_file = '.$config_dir.'/smtpd.key',
'transport_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_transports.cf',
'transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:'.$config_dir.'/mysql-virtual_transports.cf',
'relay_domains = mysql:'.$config_dir.'/mysql-virtual_relaydomains.cf',
'relay_recipient_maps = mysql:'.$config_dir.'/mysql-virtual_relayrecipientmaps.cf',
'proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps',
......
......@@ -97,7 +97,7 @@ class installer extends installer_base
'smtpd_tls_security_level = may',
'smtpd_tls_cert_file = '.$config_dir.'/smtpd.cert',
'smtpd_tls_key_file = '.$config_dir.'/smtpd.key',
'transport_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_transports.cf',
'transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:'.$config_dir.'/mysql-virtual_transports.cf',
'relay_domains = mysql:'.$config_dir.'/mysql-virtual_relaydomains.cf',
'proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps',
'smtpd_sender_restrictions = check_sender_access mysql:'.$config_dir.'/mysql-virtual_sender.cf',
......
......@@ -114,7 +114,7 @@ class installer_dist extends installer_base {
'smtpd_tls_security_level = may',
'smtpd_tls_cert_file = '.$config_dir.'/smtpd.cert',
'smtpd_tls_key_file = '.$config_dir.'/smtpd.key',
'transport_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_transports.cf',
'transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:'.$config_dir.'/mysql-virtual_transports.cf',
'relay_domains = mysql:'.$config_dir.'/mysql-virtual_relaydomains.cf',
'relay_recipient_maps = mysql:'.$config_dir.'/mysql-virtual_relayrecipientmaps.cf',
'proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps',
......
......@@ -566,6 +566,23 @@ class installer_base {
}
}
}
$config_dir = $conf['mailman']['config_dir'].'/';
$full_file_name = $config_dir.'virtual_to_transport.sh';
//* Backup exiting virtual_to_transport.sh script
if(is_file($full_file_name)) {
copy($full_file_name, $config_dir.'virtual_to_transport.sh~');
}
copy('tpl/mailman-virtual_to_transport.sh',$full_file_name);
chgrp($full_file_name,'list');
chmod($full_file_name,0750);
if(!is_file('/var/lib/mailman/data/transport-mailman')) touch('/var/lib/mailman/data/transport-mailman');
exec('/usr/sbin/postmap /var/lib/mailman/data/transport-mailman');
exec('/usr/lib/mailman/bin/genaliases');
$virtual_domains = '';
if($status == 'update')
......@@ -681,7 +698,7 @@ class installer_base {
'smtpd_tls_security_level = may',
'smtpd_tls_cert_file = '.$config_dir.'/smtpd.cert',
'smtpd_tls_key_file = '.$config_dir.'/smtpd.key',
'transport_maps = proxy:mysql:'.$config_dir.'/mysql-virtual_transports.cf',
'transport_maps = hash:/var/lib/mailman/data/transport-mailman, proxy:mysql:'.$config_dir.'/mysql-virtual_transports.cf',
'relay_domains = mysql:'.$config_dir.'/mysql-virtual_relaydomains.cf',
'relay_recipient_maps = mysql:'.$config_dir.'/mysql-virtual_relayrecipientmaps.cf',
'proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps',
......
ALTER TABLE `client` CHANGE `web_php_options` `web_php_options` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'no,fast-cgi,cgi,mod,suphp,php-fpm';
\ No newline at end of file
......@@ -185,7 +185,7 @@ CREATE TABLE `client` (
`limit_web_ip` text,
`limit_web_domain` int(11) NOT NULL DEFAULT '-1',
`limit_web_quota` int(11) NOT NULL DEFAULT '-1',
`web_php_options` varchar(255) NOT NULL DEFAULT 'no,fast-cgi,cgi,mod,suphp',
`web_php_options` varchar(255) NOT NULL DEFAULT 'no,fast-cgi,cgi,mod,suphp,php-fpm',
`limit_cgi` enum('n','y') NOT NULL DEFAULT 'n',
`limit_ssi` enum('n','y') NOT NULL DEFAULT 'n',
`limit_perl` enum('n','y') NOT NULL DEFAULT 'n',
......
......@@ -9,7 +9,7 @@ user = {fpm_user}
group = {fpm_group}
pm = dynamic
pm.max_children = 10
pm.max_children = 50
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 5
......
#!/bin/sh
sed -r -e 's/(^[^#]\S+\s+).+$/\1local/' $1 > /var/lib/mailman/data/transport-mailman
/usr/sbin/postmap /var/lib/mailman/data/transport-mailman
\ No newline at end of file
......@@ -102,5 +102,7 @@ POSTFIX_STYLE_VIRTUAL_DOMAINS = [{virtual_domains}]
# http://www.jamesh.id.au/articles/mailman-spamassassin/
# GLOBAL_PIPELINE.insert(1, 'SpamAssassin')
POSTFIX_MAP_CMD = '/etc/mailman/virtual_to_transport.sh'
# Note - if you're looking for something that is imported from mm_cfg, but you
# didn't find it above, it's probably in /usr/lib/mailman/Mailman/Defaults.py.
\ No newline at end of file
......@@ -45,6 +45,7 @@ class db extends mysqli
public $errorMessage = ''; // last error message
private $errorLocation = '';// last error location
public $show_error_messages = true; // false in server, true in interface
private $isConnected = false; // needed to know if we have a valid mysqli object from the constructor
// constructor
public function __construct($prefix = '') {
......@@ -58,12 +59,20 @@ class db extends mysqli
$this->dbNewLink = $conf[$prefix.'db_new_link'];
$this->dbClientFlags = $conf[$prefix.'db_client_flags'];
parent::__construct($conf[$prefix.'db_host'], $conf[$prefix.'db_user'],$conf[$prefix.'db_password'],$conf[$prefix.'db_database']);
if ($this->connect_error) {
$try = 0;
while(!is_null($this->connect_error) && $try < 5) {
if($try > 0) sleep(1);
$try++;
$this->updateError('DB::__construct');
return false;
} else {
$this->setCharacterEncoding();
parent::__construct($conf[$prefix.'db_host'], $conf[$prefix.'db_user'],$conf[$prefix.'db_password'],$conf[$prefix.'db_database']);
}
if(is_null($this->connect_error)) $this->isConnected = true;
else return false;
$this->setCharacterEncoding();
}
public function __destruct() {
......@@ -74,7 +83,7 @@ class db extends mysqli
public function updateError($location) {
global $app;
if($this->connect_error) {
if(!is_null($this->connect_error)) {
$this->errorNumber = $this->connect_errno;
$this->errorMessage = $this->connect_error;
} else {
......@@ -95,18 +104,20 @@ class db extends mysqli
}
private function setCharacterEncoding() {
if($this->isConnected == false) return false;
parent::query( 'SET NAMES '.$this->dbCharset);
parent::query( "SET character_set_results = '".$this->dbCharset."', character_set_client = '".$this->dbCharset."', character_set_connection = '".$this->dbCharset."', character_set_database = '".$this->dbCharset."', character_set_server = '".$this->dbCharset."'");
}
public function query($queryString) {
if($this->isConnected == false) return false;
$try = 0;
do {
$try++;
$ok = parent::ping();
$ok = $this->ping();
if(!$ok) {
if(!parent::real_connect($this->dbHost, $this->dbUser, $this->dbPass,$this->dbName)) {
if($try > 9) {
if(!$this->real_connect($this->dbHost, $this->dbUser, $this->dbPass, $this->dbName)) {
if($try > 4) {
$this->updateError('DB::query -> reconnect');
return false;
} else {
......@@ -479,7 +490,7 @@ public function toLower($record) {
// gibt Array mit Tabellennamen zur�ck
public function getTables($database_name = '') {
if($this->isConnected == false) return false;
if($database_name == '') $database_name = $this->dbName;
$result = parent::query("SHOW TABLES FROM $database_name");
for ($i = 0; $i < $result->num_rows; $i++) {
......
......@@ -59,10 +59,12 @@ class listform_tpl_generator {
';
$lang["list_head_txt"] = $listDef["name"];
$colcount = 0;
foreach($listDef["item"] as $field) {
$key = $field["field"];
$html .= " <th class=\"tbl_col_".$key."\" scope=\"col\"><tmpl_var name=\"".$key."_txt\"></th>\n";
$lang[$key."_txt"] = $key;
$colcount++;
}
$html .= ' <th class="tbl_col_buttons" scope="col">&nbsp;</th>
......@@ -99,6 +101,11 @@ class listform_tpl_generator {
</td>
</tr>
</tmpl_loop>
<tmpl_unless name=\"records\">
<tr class=\"tbl_row_noresults tbl_row_<tmpl_if name='__EVEN__'}even<tmpl_else>uneven</tmpl_if>\">
<td colspan=\"".$colcount."\">{tmpl_var name='globalsearch_noresults_text_txt'}</td>
</tr>
</tmpl_unless>
</tbody>";
$html .= '
<tfoot>
......
......@@ -208,6 +208,8 @@ class searchform {
$content .= ' '.$app->lng('Page').' '.$vars['next_page'].' '.$app->lng('of').' '.$vars['max_pages'].' ';
if($vars['show_page_next'] == 1){
$content .= '<a href="'.$list_file.'?page='.$vars['next_page'].$page_params.'"><img src="../themes/iprg/images/btn_next.png" border="0"></a> &nbsp; ';
} else{
$content .= '&nbsp;';
}
$content .= '<a href="'.$list_file.'?page='.$vars['pages'].$page_params.'"> <img src="../themes/iprg/images/btn_right.png" border="0"></a>';
return $content;
......
......@@ -9103,7 +9103,7 @@ class SimplePie_Misc
return $time;
}
function absolutize_url($relative, $base)
static function absolutize_url($relative, $base)
{
$iri = SimplePie_IRI::absolutize(new SimplePie_IRI($base), $relative);
return $iri->get_iri();
......@@ -9163,7 +9163,7 @@ class SimplePie_Misc
return $output . $input;
}
function get_element($realname, $string)
static function get_element($realname, $string)
{
$return = array();
$name = preg_quote($realname, '/');
......@@ -11006,7 +11006,7 @@ class SimplePie_Misc
}
}
function atom_10_construct_type($attribs)
static function atom_10_construct_type($attribs)
{
if (isset($attribs['']['type']))
{
......@@ -11059,7 +11059,7 @@ class SimplePie_Misc
}
}
function is_isegment_nz_nc($string)
static function is_isegment_nz_nc($string)
{
return (bool) preg_match('/^([A-Za-z0-9\-._~\x{A0}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFEF}\x{10000}-\x{1FFFD}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}\x{40000}-\x{4FFFD}\x{50000}-\x{5FFFD}\x{60000}-\x{6FFFD}\x{70000}-\x{7FFFD}\x{80000}-\x{8FFFD}\x{90000}-\x{9FFFD}\x{A0000}-\x{AFFFD}\x{B0000}-\x{BFFFD}\x{C0000}-\x{CFFFD}\x{D0000}-\x{DFFFD}\x{E1000}-\x{EFFFD}!$&\'()*+,;=@]|(%[0-9ABCDEF]{2}))+$/u', $string);
}
......@@ -11699,7 +11699,7 @@ class SimplePie_IRI
* @param string $relative Relative IRI
* @return SimplePie_IRI
*/
function absolutize($base, $relative)
static function absolutize($base, $relative)
{
$relative = (string) $relative;
if ($relative !== '')
......
......@@ -937,31 +937,44 @@ class tform {
}
break;
case 'ISIP':
//* Check if its a IPv4 or IPv6 address
if(function_exists('filter_var')) {
if(!filter_var($field_value,FILTER_VALIDATE_IP)) {
$errmsg = $validator['errmsg'];
if(isset($this->wordbook[$errmsg])) {
$this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n";
} else {
$this->errorMessage .= $errmsg."<br />\r\n";
}
}
if($validator['allowempty'] != 'y') $validator['allowempty'] = 'n';
if($validator['allowempty'] == 'y' && $field_value == '') {
//* Do nothing
} else {
//* Check content with regex, if we use php < 5.2
$ip_ok = 0;
if(preg_match("/^(\:\:([a-f0-9]{1,4}\:){0,6}?[a-f0-9]{0,4}|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){0,6}?\:\:|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){1,6}?\:\:([a-f0-9]{1,4}\:){1,6}?[a-f0-9]{1,4})(\/\d{1,3})?$/i", $field_value)){
$ip_ok = 1;
}
if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $field_value)){
$ip_ok = 1;
//* Check if its a IPv4 or IPv6 address
if(isset($validator['separator']) && $validator['separator'] != '') {
//* When the field may contain several IP addresses, split them by the char defined as separator
$field_value_array = explode($validator['separator'],$field_value);
} else {
$field_value_array[] = $field_value;
}
if($ip_ok == 0) {
$errmsg = $validator['errmsg'];
if(isset($this->wordbook[$errmsg])) {
$this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n";
foreach($field_value_array as $field_value) {
if(function_exists('filter_var')) {
if(!filter_var($field_value,FILTER_VALIDATE_IP)) {
$errmsg = $validator['errmsg'];
if(isset($this->wordbook[$errmsg])) {
$this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n";
} else {
$this->errorMessage .= $errmsg."<br />\r\n";
}
}
} else {
$this->errorMessage .= $errmsg."<br />\r\n";
//* Check content with regex, if we use php < 5.2
$ip_ok = 0;
if(preg_match("/^(\:\:([a-f0-9]{1,4}\:){0,6}?[a-f0-9]{0,4}|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){0,6}?\:\:|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){1,6}?\:\:([a-f0-9]{1,4}\:){1,6}?[a-f0-9]{1,4})(\/\d{1,3})?$/i", $field_value)){
$ip_ok = 1;
}
if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $field_value)){
$ip_ok = 1;
}
if($ip_ok == 0) {
$errmsg = $validator['errmsg'];
if(isset($this->wordbook[$errmsg])) {
$this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n";
} else {
$this->errorMessage .= $errmsg."<br />\r\n";
}
}
}
}
}
......
......@@ -31,7 +31,7 @@ class vlibTemplateError {
| DO NOT TOUCH ANYTHING IN THIS CLASS IT MAY NOT WORK OTHERWISE |
\-----------------------------------------------------------------------------*/
function raiseError ($code, $level = null, $extra=null) {
public static function raiseError ($code, $level = null, $extra=null) {
if (!($level & error_reporting())&& $level != KILL) return; // binary AND checks for reporting level
$error_codes = array(
......
......@@ -132,4 +132,3 @@ $wb['datalog_status_u_web_folder_user'] = 'Aktualizace nastavení uživatele pro
$wb['datalog_status_d_web_folder_user'] = 'Odstranění uživatele pro adresáře chráněné heslem';
?>
......@@ -131,4 +131,6 @@ $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['login_as_txt'] = 'Log in as';
?>
<?php
$wb["login_1_txt"] = 'Do you want to login as user';
$wb["login_2_txt"] = 'If you do so, you can "go back" by clicking at logout.';
$wb["btn_yes_txt"] = 'Yes, login as Client';
$wb["btn_back_txt"] = 'No, back to list';
$wb["udp_port_help_txt"] = 'Separated by comma';
$wb["active_txt"] = 'Active';
$wb["firewall_error_unique"] = 'There is already a firewall record for this server.';
$wb["active_txt"] = 'Active';
$wb["tcp_ports_error_regex"] = 'Character not allowed in tcp port definition. Allowed characters are numbers, ":" and ",".';
$wb["udp_ports_error_regex"] = 'Character not allowed in udp port definition. Allowed characters are numbers, ":" and ",".';
?>
\ No newline at end of file
......@@ -170,7 +170,4 @@ $wb['enable_ip_wildcard_txt'] = 'Enable IP wildcard (*)';
$wb['web_folder_protection_txt'] = 'Make web folders immutable (extended attributes)';
$wb['overtraffic_notify_admin_txt'] = 'Send overtraffic notification to admin';
$wb['overtraffic_notify_client_txt'] = 'Send overtraffic notification to client';
$wb['v6_prefix_txt'] = 'IPv6 Prefix';
$wb['vhost_rewrite_v6_txt'] = 'Rewrite IPv6 on Mirror';
$wb['v6_prefix_wrong'] = 'Invalid v6 Netmask format.';
?>
......@@ -29,5 +29,5 @@ $wb['generate_password_txt'] = 'Generate Password';
$wb['repeat_password_txt'] = 'Repeat Password';
$wb['password_mismatch_txt'] = 'The passwords do not match.';
$wb['password_match_txt'] = 'The passwords do match.';
$wb['username_error_collision'] = 'The username may not be web or web plus a number.\"';
$wb['username_error_collision'] = 'The username may not be web or web plus a number.\\"';
?>
<?php
$wb["login_1_txt"] = 'Do you want to login as user';
$wb["login_2_txt"] = 'If you do so, you can "go back" by clicking at logout.';
$wb["btn_yes_txt"] = 'Yes, login as Client';
$wb["btn_back_txt"] = 'No, back to list';
$wb["udp_port_help_txt"] = 'Separated by comma';
$wb["active_txt"] = 'Active';
$wb["firewall_error_unique"] = 'There is already a firewall record for this server.';
$wb["active_txt"] = 'Active';
$wb["tcp_ports_error_regex"] = 'Character not allowed in tcp port definition. Allowed characters are numbers, ":" and ",".';
$wb["udp_ports_error_regex"] = 'Character not allowed in udp port definition. Allowed characters are numbers, ":" and ",".';
?>
\ No newline at end of file
......@@ -170,7 +170,4 @@ $wb['website_autoalias_txt'] = 'Website auto alias';
$wb['website_autoalias_note_txt'] = 'Placeholders:';
$wb['overtraffic_notify_admin_txt'] = 'Send overtraffic notification to admin';
$wb['overtraffic_notify_client_txt'] = 'Send overtraffic notification to client';
$wb['v6_prefix_txt'] = 'IPv6 Prefix';
$wb['vhost_rewrite_v6_txt'] = 'Rewrite IPv6 on Mirror';
$wb['v6_prefix_wrong'] = 'Invalid v6 Netmask format.';
?>
......@@ -29,5 +29,5 @@ $wb['generate_password_txt'] = 'Generate Password';
$wb['repeat_password_txt'] = 'Repeat Password';
$wb['password_mismatch_txt'] = 'The passwords do not match.';
$wb['password_match_txt'] = 'The passwords do match.';
$wb['username_error_collision'] = 'The username may not be web or web plus a number.\"';
$wb['username_error_collision'] = 'The username may not be web or web plus a number.\\"';
?>
<?php
$wb["login_1_txt"] = 'Do you want to login as user';
$wb["login_2_txt"] = 'If you do so, you can "go back" by clicking at logout.';
$wb["btn_yes_txt"] = 'Yes, login as Client';
$wb["btn_back_txt"] = 'No, back to list';
$wb["udp_port_help_txt"] = 'Separated by comma';
$wb["active_txt"] = 'Active';
$wb["firewall_error_unique"] = 'There is already a firewall record for this server.';
$wb["active_txt"] = 'Active';
$wb["tcp_ports_error_regex"] = 'Character not allowed in tcp port definition. Allowed characters are numbers, ":" and ",".';
$wb["udp_ports_error_regex"] = 'Character not allowed in udp port definition. Allowed characters are numbers, ":" and ",".';
?>
\ No newline at end of file
......@@ -170,7 +170,4 @@ $wb['enable_ip_wildcard_txt'] = 'Enable IP wildcard (*)';
$wb['web_folder_protection_txt'] = 'Make web folders immutable (extended attributes)';
$wb['overtraffic_notify_admin_txt'] = 'Send overtraffic notification to admin';
$wb['overtraffic_notify_client_txt'] = 'Send overtraffic notification to client';
$wb['v6_prefix_txt'] = 'IPv6 Prefix';
$wb['vhost_rewrite_v6_txt'] = 'Rewrite IPv6 on Mirror';
$wb['v6_prefix_wrong'] = 'Invalid v6 Netmask format.';
?>
......@@ -29,5 +29,5 @@ $wb['generate_password_txt'] = 'Generate Password';
$wb['repeat_password_txt'] = 'Repeat Password';
$wb['password_mismatch_txt'] = 'The passwords do not match.';
$wb['password_match_txt'] = 'The passwords do match.';
$wb['username_error_collision'] = 'The username may not be web or web plus a number.\"';
$wb['username_error_collision'] = 'The username may not be web or web plus a number.\\"';
?>
......@@ -49,4 +49,3 @@ $wb['Do ISPConfig-Update'] = 'Aktualizovat ISPConfig';
$wb['Directive Snippets'] = 'Directive Snippets';
?>
......@@ -8,4 +8,3 @@ $wb['directive_snippets_name_empty'] = 'Please specify a name for the snippet.';
$wb['directive_snippets_name_error_unique'] = 'There is already a directive snippet with this name.';
?>
......@@ -6,4 +6,3 @@ $wb['type_txt'] = 'Verze';
$wb['add_new_record_txt'] = 'Add Directive Snippet';
?>
......@@ -10,4 +10,3 @@ $wb['tcp_ports_error_regex'] = 'Znak není povole v definici TCP portu. Povolen
$wb['udp_ports_error_regex'] = 'Znak není povole v definici UDP portu. Povolené symboly jsou čísla, : a ,.';
?>