- change_pass() now returns the return value of change_pw()
- made most variables un-escaped (as expected by db_insert/db_update/
db_delete). This means they HAVE TO BE ESCAPED when using them in a
hand-written query. (Error messages also need escaping - the
backslashes from escape_string wouldn't help there anyways.)
- escaped variables renamed to $E_whatever
- changed all return values to true (success) and false (failure)
instead of shell-like 0 (success) and 1 (failure)
- removed unused global $config at various places
- removed timestamp columns from db_insert and db_update call where they
match the default
- added db_log() for some (but not all) failures
- honor $CONF[maildir_name_hook] when creating a mailbox
- splitting a mail address is now done with list(...) = explode(...)
- switched to db_begin(), db_commit(), db_rollback()
- let smtp_mail create the mail header
- added missing db_commit in delete()
- various minor fixes, code cleanup, comments and TODO notes
To sum it up: all code in UserHandler.php that does not have a TODO
attached should be fine :-)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@908 a1433add-5e2c-0410-b055-b7f2511e0802
- smtp_mail(): added another (currently optional) parameter.
It can now be called with subject and body, no need to build the mail
header in every script that needs to send a mail.
- db_delete() did not use table_by_key. Fixed, backport queued for
2.3 branch
- db_insert() now has array(created,modified) as default for timestamp
columns so that most calls can be done without that parameter
- db_update() now has array(modified) as default for timestamp column
so that most calls can be done without that parameter
- new functions db_begin / db_commit / db_rollback - BEGIN / COMMIT /
ROLLBACK wrapped in a check for $CONF['database_type'] == "pgsql".
One more step to get rid of database-specific code in all files.
- db_log():
- migrated to db_insert. This should also fix some missing quoting.
- sorted $action_list to make it more readable
- backport queued for 2.3 branch for both changes
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@907 a1433add-5e2c-0410-b055-b7f2511e0802
- check_domain(): don't trim() the domain - whitespace is an error.
This catches "foo@ domain.com" that wasn't catched before.
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@902 a1433add-5e2c-0410-b055-b7f2511e0802
some small fixes that came up while integrating the multiple alias
target patch from anexius (r898 [2.3]/r900 [trunk]):
- replace spaces only at the start and end of a line, not in the
middle of an (BTW: invalid) mail address
- prevent input data loss on validation errors
- allow multiple error messages (separated by <br />)
- removed some obsolete comments
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@901 a1433add-5e2c-0410-b055-b7f2511e0802
- merged in all new functions and changes (by valkum + some bugfixes
and notes from me) - for details see r831, r888 and r891 of
scripts/models-ext/UserHandler.php
- re-added change_pass() function (was removed/renamed by valkum) for
backward compatibility.
IMPORTANT: change_pass will only exist temporarily and is deprecated.
Besides that, the new implementation has different return values etc.
so existing code might break already.
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@896 a1433add-5e2c-0410-b055-b7f2511e0802
- db_insert and db_delete need the default table name as parameter
('alias', not $table_alias aka table_by_key('alias') )
DomainHandler.php
- removed now unused $table_domain and $table_alias
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@891 a1433add-5e2c-0410-b055-b7f2511e0802
some changes after using perlcritic.org - in detail:
- removed unused variable $spam
- use ':encoding(UTF-8)' instead of ':utf8' to validate input against
invalid utf8 sequences
- foreach creates its own instance of $item - marking it with "my $item"
- replaced lots of "..." with '...'
BTW: Thanks to the nice guy who recommended perlcritic.org at the
openSUSE conference!
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@881 a1433add-5e2c-0410-b055-b7f2511e0802
- fix displaying of 'modified' column for aliases when using postgres
(bugreport mailed by Dominic, neocoretech @SF)
- drop MySQL variant of the alias query, the fixed postgres variant works for
both
- fixed wrong position of $sql_where (search string) - must be outside
the sub-query
- escape search string in page browser - even if it is unlikely that enough
mail adresses contain funny chars to let the pagebrowser appear ;-)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@874 a1433add-5e2c-0410-b055-b7f2511e0802
- store language in session variable
(BTW: storing it only at login instead of calling check_language() on
every page would save some processor cycles ;-)
templates/header.tpl:
- add class="lang-XY" (where XY is the language to the body tag.
This allows language-specific CSS code: .lang-XY table {...}
This commit implements the feature request from J.Kruis (jan-kruis)
https://sourceforge.net/tracker/?func=detail&aid=2903088&group_id=191583&atid=937967
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@872 a1433add-5e2c-0410-b055-b7f2511e0802
- change edit form to XHTML
(and BTW: the whole form is produced by fetchmail_edit_row() and
handed over to smarty in a single variable. Should be converted to
a generic "edit form" smarty template...)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@871 a1433add-5e2c-0410-b055-b7f2511e0802
list-virtual.php. We now have two file less to maintain without loosing
functionality :-)
Only remaining bug: in search mode, no page browser is displayed.
This means that you'll only see the first $CONF['page_size'] search results
*without* the possibility to see the next page of results.
(BTW: search.php simply ignored $CONF['page_size'] ;-)
search.php, templates/search.tpl:
- deleted, RIP ;-)
configs/menu.conf:
- change search form to use list-virtual.php instead of search.php
list-virtual.php:
- added TODO note about the "no page browser in search mode" bug
templates/list-virtual.tpl:
- hand over $search to all tabs
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@869 a1433add-5e2c-0410-b055-b7f2511e0802
- hand over $search to smarty templates
templates/list-virtual_alias.tpl, templates/list-virtual_alias_domain.tpl:
- add search result highlighting
templates/list-virtual_mailbox.tpl:
- add search result highlighting
- move output of "Mailbox" / "Forward only" outside the foreach loop
(was displayed once per mailbox alias target)
css/default.css:
- add style for ".searchresult"
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@868 a1433add-5e2c-0410-b055-b7f2511e0802
- function upgrade_1_mysql(): change default charset of vacation table to
latin1. Otherwise table creation breaks with MySQL 6.
Fields that need to be utf-8 are changed to utf-8 later anyways.
(Found by mechno on #postfixadmin)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@790 a1433add-5e2c-0410-b055-b7f2511e0802
- fix delete link for alias domains (when on target domain - delete link
must contain the "from" domain)
Reported by roe_ on #postfixadmin, also affects 2.3
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@789 a1433add-5e2c-0410-b055-b7f2511e0802