diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 29433f57..930cc369 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -9,6 +9,19 @@ # Last update: # $Id$ +SVN changes since 3.0 beta1 (2.91) +---------------------------------- + +- AliasHandler: don't clean goto field when making alias inactive (bug#316) +- list-virtual: display quota even if $CONF[used_quotas] == NO (bug#307) +- vacation.pl: fix postgresql queries in vacation.pl (bug#315) +- fix query in AliasHandler getList which caused an empty list on some + systems (bug#313) +- fetchmail.pl: fix ssl extra options (cert check, cert path, fingerprint) +- fix logging (run setup.php to fix old log entries) (bug#317) +- fetchmail.php: change error_reporting() to exclude E_NOTICE (bug#322) +- fr.lang translation update (patch#123) + Version 3.0 beta1 (2.91) - 2014/05/06 - SVN r1670 ------------------------------------------------- diff --git a/fetchmail.php b/fetchmail.php index e5ef8958..7e99726a 100644 --- a/fetchmail.php +++ b/fetchmail.php @@ -37,6 +37,11 @@ require_once('common.php'); authentication_require_role('admin'); +# workaround for https://sourceforge.net/p/postfixadmin/bugs/322/ +# TODO: convert fetchmail.php to FetchmailHandler +$old_error_reporting = error_reporting(); +error_reporting($old_error_reporting ^ E_NOTICE); + $extra_options = 0; if ($CONF['fetchmail_extra_options'] == 'YES') $extra_options = 1; diff --git a/languages/language-update.sh b/languages/language-update.sh index 0a988f49..8100ed6a 100755 --- a/languages/language-update.sh +++ b/languages/language-update.sh @@ -277,7 +277,7 @@ echo ' Add a comment to $PALANG['"'"'string'"'"'] - Useful if a string needs to be translated again. + Useful if a string needs to be translated again. '"$0"' --obsolete string [--patch] [--nocleanup] [foo.lang [bar.lang [...] ] ] @@ -297,9 +297,9 @@ echo ' '"$0"' --comparetext string1 string2 [foo.lang [bar.lang [...] ] ] - Compare two texts in $PALANG. - This can be useful to find out if two equel texts in $PALANG are the - same in all languages. No output means no difference. + Compare two texts in $PALANG. + This can be useful to find out if two equel texts in $PALANG are the + same in all languages. No output means no difference. '"$0"' --stats @@ -311,6 +311,7 @@ Common parameters: --patch patch the language file directly (instead of displaying the patch) + (use --forcepatch if --patch fails with rejections) --nocleanup keep all temp files (for debugging) diff --git a/model/AliasHandler.php b/model/AliasHandler.php index 1e7783d1..7a293339 100644 --- a/model/AliasHandler.php +++ b/model/AliasHandler.php @@ -138,6 +138,11 @@ class AliasHandler extends PFAHandler { return $retval; } + protected function domain_from_id() { + list(/*NULL*/,$domain) = explode('@', $this->id); + return $domain; + } + protected function validate_new_id() { if ($this->id == '') { $this->errormsg[$this->id_field] = Config::lang('pCreate_alias_address_text_error1'); diff --git a/model/CliHelp.php b/model/CliHelp.php index 17ee8201..009725e7 100644 --- a/model/CliHelp.php +++ b/model/CliHelp.php @@ -49,7 +49,6 @@ class CliHelp extends Shell { "\t\t".sprintf("%-20s %s", "add: ", "Add a $module.")."\n". "\t\t".sprintf("%-20s %s", "update: ", "Update a $module.")."\n". "\t\t".sprintf("%-20s %s", "delete: ", "Delete a $module")."\n". - "\t\t".sprintf("%-20s %s", "password: ", "Changes the password for a $module")."\n", 'address' => "\t[
]\n" . "\t\tA address of recipient.\n", ); diff --git a/model/MailboxHandler.php b/model/MailboxHandler.php index f557f56b..d2335eae 100644 --- a/model/MailboxHandler.php +++ b/model/MailboxHandler.php @@ -51,19 +51,22 @@ class MailboxHandler extends PFAHandler { return false; } - list(/*NULL*/,$domain) = explode('@', $this->id); - if ($this->new) { $currentquota = 0; } else { $currentquota = $this->result['quotabytes']; # parent::init called ->view() } - $this->updateMaxquota($domain, $currentquota); + $this->updateMaxquota($this->domain, $currentquota); return true; # still here? good. } + protected function domain_from_id() { + list(/*NULL*/,$domain) = explode('@', $this->id); + return $domain; + } + /** * show max allowed quota in quota field description * @param string - domain diff --git a/model/PFAHandler.php b/model/PFAHandler.php index cc4519b0..a95130f2 100644 --- a/model/PFAHandler.php +++ b/model/PFAHandler.php @@ -51,6 +51,10 @@ abstract class PFAHandler { # filled in init() protected $id = null; + # the domain of the current item (used for logging) + # filled in domain_from_id() via init() + protected $domain = null; + # structure of the database table, list, edit form etc. # filled in initStruct() protected $struct = array(); @@ -189,17 +193,21 @@ abstract class PFAHandler { } elseif (!$this->validate_new_id() ) { # errormsg filled by validate_new_id() return false; - } else { - return true; +# } else { +# return true; } } else { # edit mode if (!$exists) { $this->errormsg[$this->id_field] = Config::lang($this->msg['error_does_not_exist']); return false; - } else { - return true; +# } else { +# return true; } } + + $this->domain = $this->domain_from_id(); + + return true; } /** @@ -210,6 +218,21 @@ abstract class PFAHandler { */ abstract protected function validate_new_id(); + /** + * called by init() if $this->id != $this->domain_field + * must be overridden if $id_field != $domain_field + * @return string the domain to use for logging + */ + protected function domain_from_id() { + if ($this->id_field == $this->domain_field) { + return $this->id; + } elseif ($this->domain_field == "") { + return ""; + } else { + die('You must override domain_from_id()!'); + } + } + /** * web interface can prefill some fields * if a _prefill_$field method exists, call it (it can for example modify $struct) @@ -367,7 +390,7 @@ abstract class PFAHandler { $result = $this->storemore(); # db_log() even if storemore() failed - db_log ($this->id, $this->msg['logname'], ""); + db_log ($this->domain, $this->msg['logname'], $this->id); if ($result) { # return success message diff --git a/upgrade.php b/upgrade.php index 7848ff68..0103c300 100644 --- a/upgrade.php +++ b/upgrade.php @@ -1347,6 +1347,19 @@ function upgrade_1610() { _db_add_field('vacation', 'interval_time', '{INT}', 'domain'); } +function upgrade_1685_mysql() { + # Fix existing log entries broken by https://sourceforge.net/p/postfixadmin/bugs/317/ + $table = table_by_key('log'); + db_query_parsed("UPDATE $table SET data = domain WHERE data = '' AND domain LIKE '%@%'"); + db_query_parsed("UPDATE $table SET domain=SUBSTRING_INDEX(domain, '@', -1) WHERE domain=data;"); +} +function upgrade_1685_pgsql() { + $table = table_by_key('log'); + db_query_parsed("UPDATE $table SET data = domain WHERE data = '' AND domain LIKE '%@%'"); + db_query_parsed("UPDATE $table SET domain=SPLIT_PART(domain, '@', 2) WHERE domain=data;"); +} + + # TODO MySQL: # - various varchar fields do not have a default value # https://sourceforge.net/projects/postfixadmin/forums/forum/676076/topic/3419725