0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00
Commit Graph

491 Commits

Author SHA1 Message Date
David Goodwin
5827a12628 require a password to be non-empty on login 2021-01-13 22:46:33 +00:00
David Goodwin
72ded8494a wrap pacrypt() call with a try/catch to log/handle issues where an exception is thrown - see https://github.com/postfixadmin/postfixadmin/issues/420 2021-01-13 22:44:09 +00:00
BotoX
c6ae3ea2f3 Suport for dovecot mail-crypt-plugin via new mailbox_postpassword_script hook.
Uses doveadm mailbox cryptokey on create user / password change to adjust user encryption key.
https://doc.dovecot.org/configuration_manual/mail_crypt_plugin/
2021-01-11 21:07:45 +01:00
David Goodwin
efb1897a4f fix for CLI not behaving - see #411 2021-01-10 10:58:16 +00:00
David Goodwin
431d885e4e see: //github.com/postfixadmin/postfixadmin/issues/410 - ignore theme_css if it points to css/default.css; drop css/default.css 2021-01-09 19:43:43 +00:00
David Goodwin
f79351aaee composer format 2021-01-08 15:53:55 +00:00
David Goodwin
c7850b78eb fix bootstrap theme for users/ urls; make some other links use https. 2021-01-07 20:34:06 +00:00
Christian Boltz
6663a35bdb
PFAHandler: fix backwards compability for store()
... and beforestore() and storemore()

Custom child classes might use the old names, and we should keep them
working (with a deprecation notice in the error log).
2021-01-06 21:18:53 +01:00
David Goodwin
16531534a3 add @deprecated phpdoc 2020-10-02 20:57:55 +01:00
David Goodwin
d07d115bd5 fix names .... 2020-10-02 20:56:45 +01:00
David Goodwin
712939eb88 maintain backwards compatability with PFAHAndler::{store(),storemore(),beforestore()} 2020-09-28 21:51:57 +01:00
David Goodwin
b8fa60bb8a more type hints / psalm fixes 2020-09-28 20:33:54 +01:00
David Goodwin
d83b287297 rejig smarty 2020-09-28 20:33:21 +01:00
David Goodwin
8be966d0bb allow the template to be destroyed 2020-09-27 10:52:19 +01:00
David Goodwin
e4d5e4bee0 reformat 2020-09-26 09:58:16 +01:00
David Goodwin
ce8c636eb5 rejig Login::__construct() as only one arg is really needed 2020-09-26 09:58:05 +01:00
David Goodwin
7107e17c4c composer format 2020-09-25 21:33:26 +01:00
David Goodwin
b868f950bf refactor Login stuff out of Handler classes into Login... add tests 2020-09-25 21:32:53 +01:00
David Goodwin
f091948381 move password check and recovery code generation out of PFAHandlers and into a Login class 2020-09-25 21:32:03 +01:00
David Goodwin
3c7da4f3b8 Refactor some methods
PFAHandler::store() -> PFAHandler::save();
 PFAHandler::storemore() -> PFAHandler::postSave();
 PFAHandler::beforestore() -> PFAHandler::preSave();
2020-09-25 21:29:45 +01:00
David Goodwin
3d46ec7959 revert: 1d1960a476 - see https://github.com/postfixadmin/postfixadmin/issues/384 2020-09-12 21:04:18 +01:00
David Goodwin
12f68a6e3a composer format time 2020-08-13 15:27:47 +01:00
David Goodwin
5bd5bdc25b merge https://github.com/postfixadmin/postfixadmin/pull/375 add unit test 2020-08-13 15:00:22 +01:00
GermanCoding
fe3e9e2702 Disallow alias that points to itself (fixes #358)
Based on an older commit, but this time done right. This change prevents any user-defined aliases
that point to themselves, because such aliases are not supported by Postfix and cause mail
delivery errors.
2020-08-07 22:15:45 +02:00
David Goodwin
c3a8875ca6 psalm fixes 2020-08-06 21:10:30 +01:00
David Goodwin
89aebea61d Revert "Disallow aliases that point to themselves (fixes postfixadmin/postfixadmin/issues/358)"
This reverts commit c3d5b26740.
2020-08-06 20:28:20 +01:00
GermanCoding
c3d5b26740 Disallow aliases that point to themselves (fixes postfixadmin/postfixadmin/issues/358)
See github.com/postfixadmin/postfixadmin/issues/358 for details
2020-08-06 16:12:04 +01:00
David Goodwin
e8f27969a3 psalm fixes 2020-06-21 16:44:43 +01:00
David Goodwin
bbf41c7acc formatting 2020-06-02 12:59:47 +01:00
David Goodwin
864065cd37 fix MailboxHandler -> adding mailbox with empty quota field 2020-05-15 20:30:31 +01:00
David Goodwin
85e15790bb should fix: #351 2020-05-02 19:08:47 +01:00
David Goodwin
df9a400ea2 remove debug stuff 2020-04-22 09:37:31 +01:00
David Goodwin
fd48714615 fix issue reported with __LANG.$var - 844840c6a8 (commitcomment-38653465) 2020-04-22 09:34:25 +01:00
David Goodwin
844840c6a8 simplify Config use; drop support for dotty name notation which we are not using 2020-04-14 21:26:01 +01:00
David Goodwin
e4158d6d7e psalm fix 2020-04-14 21:25:36 +01:00
David Goodwin
ffc7787b76 psalm fix 2020-04-14 21:09:18 +01:00
David Goodwin
d81363541a fix psalm 2020-03-18 21:03:27 +00:00
David Goodwin
338fb8c564 Fix quota storage; see https://github.com/postfixadmin/postfixadmin/issues/342 2020-03-18 14:36:53 +00:00
David Goodwin
d3295a59bb format 2020-03-16 14:10:05 +00:00
David Goodwin
d540d904db cast mailbox['quota'] to be integer.
see:  https://github.com/postfixadmin/postfixadmin/issues/342
2020-03-16 13:11:51 +00:00
David Goodwin
3303f25bcc add some php 7+ array type hints. 2020-03-16 13:11:15 +00:00
David Goodwin
48e236ffc0 use hash_equals for login - see: https://github.com/postfixadmin/postfixadmin/issues/58 2020-03-14 22:04:54 +00:00
David Goodwin
fefe3f7df5 default domain_quota_default to -1 if not specified - see https://github.com/postfixadmin/postfixadmin/issues/299 2020-03-14 21:08:50 +00:00
David Goodwin
d2b8f7ac15 might fix: https://github.com/postfixadmin/postfixadmin/issues/306 2020-03-13 22:03:40 +00:00
Michael Krieger
101490111a
Update AliasHandler.php 2020-03-05 18:06:13 -05:00
Michael Krieger
02e238cf30
Add a local-only domain check 2020-03-05 17:47:04 -05:00
David Goodwin
30f97c97ee avoid: A non-numeric value encountered errors from no quota being specified 2020-03-02 09:55:13 +00:00
David Goodwin
9dfc866edd composer format 2020-02-23 18:59:07 +00:00
David Goodwin
95d92a2345 psalm fix: rewrite to avoid php error (@) suppression 2020-02-12 21:33:55 +00:00
Christian Boltz
bee61f329b
Only show password expiration if enabled in config 2020-02-12 17:12:19 +01:00
David Goodwin
1ad184641d php7.4 / psalm fixes 2020-01-31 16:30:46 +00:00
David Goodwin
bcae218cbb composer format time 2019-10-19 21:36:27 +01:00
David Goodwin
87824ef970 psalm fixes/workarounds; require PHP 5.6+ 2019-10-19 20:51:05 +01:00
David Goodwin
4aa3110712 phpdoc/psalm fixes 2019-10-19 20:01:25 +01:00
David Goodwin
2742849e7b reformat 2019-09-17 21:06:00 +01:00
David Goodwin
7965a83aff tighten psalm checks even more 2019-09-17 21:05:08 +01:00
David Goodwin
034a50836c tighten psalm checks 2019-09-17 20:50:42 +01:00
David Goodwin
f7c7e35b34 fix formatting 2019-09-15 11:42:21 +01:00
David Goodwin
80418e6412 try and avoid hitting : https://github.com/postfixadmin/postfixadmin/issues/51 2019-09-14 21:19:39 +01:00
David Goodwin
9cd7dac187 initial attempt at trying to return an exit value within the cli 2019-09-14 20:09:56 +01:00
David Goodwin
34cf66110e see https://github.com/postfixadmin/postfixadmin/issues/251 - avoid things breaking if imap_open is not present 2019-09-05 18:10:07 +01:00
David Goodwin
296fc2f48e silence psalm error - cast $show_password_fields to an int in model/MailboxHandler.php lines 33/34 2019-08-13 08:53:43 +01:00
David Goodwin
8b19ef21cf add default value for password_expiry (default to one year)
should fix: https://github.com/postfixadmin/postfixadmin/issues/280
2019-07-16 19:01:48 +01:00
David Goodwin
c53d17fff7 support TRUE orFALSE strings just incase 2019-07-12 10:53:27 +01:00
Felix Ableitner
600248e955 Add option to use smtp password when sending admin emails (fixes #272) 2019-07-02 13:41:58 +02:00
David Goodwin
651688c802 if we are generating passwords, there will only be one password value; so reduce the fields we check before deciding whether to update password_expiry - see https://github.com/postfixadmin/postfixadmin/issues/266 2019-06-11 21:05:53 +01:00
David Goodwin
1d1960a476 if CONF['generate_password'] == 'YES' then do not display password fields
Given we autogenerate a password ....
2019-06-11 21:03:39 +01:00
David Goodwin
3ff2436f2f try a bit harder to avoid non-numeric argument issues with $multiplier
(see https://github.com/postfixadmin/postfixadmin/issues/266 )
2019-06-10 20:13:22 +01:00
David Goodwin
8e2e4eb189 run: composer format 2019-06-08 20:38:54 +01:00
David Goodwin
03b9483204 default to providing a password_expiry datetime value - even if password_expiry is turned off - this should fix https://github.com/postfixadmin/postfixadmin/issues/280 2019-06-08 20:34:07 +01:00
David Goodwin
3322b43bb6 see: https://github.com/postfixadmin/postfixadmin/issues/282 - try and ensure local_part contains an @ on creating a mailbox 2019-06-08 20:05:33 +01:00
David Goodwin
71402e9051 comment 2019-04-26 11:46:57 +01:00
David Goodwin
045a19ae33 re-format 2019-02-27 14:44:20 +00:00
David Goodwin
7ed57a0cda assume the db updates work if no exception was thrown 2019-02-27 14:44:20 +00:00
David Goodwin
9024dddf46 move password_expiration code into the MailboxHandler. 2019-02-27 14:44:20 +00:00
David Goodwin
df99e66b2d try and stop "A non-numeric value encountered in ..."; see #239 2019-02-27 14:44:20 +00:00
David Goodwin
28e687ff5b sqlite does not support NOW(), use a string comparison 2019-02-18 21:11:17 +00:00
Christian Boltz
5bc85bec44
fix error message in Config::read_array(() 2019-01-28 00:48:05 +01:00
David Goodwin
570972944d Merge remote-tracking branch 'origin/master' into feature-try-pdo 2019-01-08 13:38:38 +00:00
David Goodwin
5d47b85b9d remove attribute that is in parent class 2019-01-08 13:22:44 +00:00
David Goodwin
020343999a
Merge pull request #221 from SuperVirus/fetchmail_different_source_port
Allow different port for fetchmail
2019-01-07 21:56:28 +00:00
David Goodwin
803e2342f8 fix psalm issues; reformat; rename new db functions 2019-01-06 21:32:58 +00:00
David Goodwin
1176c9ce78 reformat; fix some transition bugs 2019-01-06 21:32:58 +00:00
David Goodwin
ea33d9951a try migrating to pdo 2019-01-06 21:32:58 +00:00
David Goodwin
d78fb1fbbd move to Shell 2019-01-03 19:47:28 +00:00
David Goodwin
e5cacbec90 add missing attribute 2019-01-03 19:47:16 +00:00
David Goodwin
4fcdba9cf4 run php-cs-fixer (code reforamt) 2018-12-28 19:31:43 +00:00
David Goodwin
19cda31849 remove psalm warnings from code; fix password_expiry behaviour when enabled/disabled on MySQL 2018-12-28 19:27:33 +00:00
David Goodwin
74002bbf57 psalm fixes 2018-12-27 21:43:11 +00:00
David Goodwin
173d5775cd psalm fixes 2018-12-27 13:55:02 +00:00
Christoph 'SuperVirus' Heitkamp
d35e66808b Allow different port for fetchmail 2018-12-17 13:29:07 +01:00
David Goodwin
69e234f668
Merge pull request #200 from doktoil-makresh/master
Support for password expiration, managed in PostFix Admin
2018-11-27 09:14:36 +00:00
David Goodwin
afd418675c pointless comment 2018-09-07 11:01:50 +01:00
David Goodwin
77d1b6c2e7 rename sql fields to just have mailbox.password_expiry and domain.password_expiry 2018-08-28 21:19:56 +01:00
Damien Martins
ce60b9fa59 Now password expiration is managed through Postfix Admin GUI 2018-08-20 15:32:53 +02:00
Damien Martins
e786609aa9 Adding support for password expiration. Please read README.password_expiration for more details 2018-08-17 16:07:14 +02:00
David Goodwin
76ee147375 phpdoc fix 2018-06-18 21:42:34 +01:00
David Goodwin
ec085b668b missing class property 2018-06-18 21:34:24 +01:00
David Goodwin
9c0e1dd575 phpdoc fixes 2018-06-18 21:34:10 +01:00
David Goodwin
c44e82cc2d phpdoc fix 2018-06-10 21:24:06 +01:00
David Goodwin
b48f99d4c6 reformat (phpcs) 2018-05-02 12:54:17 +01:00
David Goodwin
94f05bf9e4 switch to store $config internally within an array 2018-04-29 21:52:57 +01:00
Christian Boltz
24ad5cc3d8
Set $reset_by_sms even if password reset is disabled
... to avoid an "undefined variable" warning
2018-04-27 23:23:57 +02:00
Christian Boltz
3f1866d041
display phone number field only if $CONF[sms_send_function] is set
Without a way to send a SMS, asking users for their mobile number is
pointless.
2018-04-22 22:55:55 +02:00
Christian Boltz
cdf3c9acb9
initStruct(): use multiopt for 'id' 'dont_write_to_db'
This also means we can drop the 0 for not_in_db because this is the
default.
2018-04-22 20:09:38 +02:00
Christian Boltz
d2588a4de2
Fix phpcs whitespace breakage in initStruct etc. 2018-04-22 18:24:41 +02:00
Christian Boltz
12c4a4f29e
move shells/shell.php to model/Shell.php
... and drop a few lines in postfixadmin-cli.php that became superfluous
by this move (thanks autoloader!)
2018-03-25 21:44:42 +02:00
Christian Boltz
500c847fe0
re-add lost comment 2018-03-25 19:16:21 +02:00
Christian Boltz
91c07c9eae
VacationHandler: re-enable and fix code in validate_new_id()
Note that vacation.php doesn't use this function yet, so it's not
surprising that users didn't notice the broken code.
2018-03-25 15:22:51 +02:00
David Goodwin
4fb4d406ee phpdoc; disable function init() - seems invalid 2018-03-16 20:07:52 +00:00
David Goodwin
fef2591335 phpdoc fixes 2018-03-16 20:07:21 +00:00
David Goodwin
cb34da4f46 phpcs reformat 2018-02-18 19:59:37 +00:00
David Goodwin
152975d05c move to use db_assoc() rather than db_array() (code assumes assoc. array) 2018-02-10 21:08:35 +00:00
David Goodwin
5e1855632a allow local aliases - see #134 2018-02-09 21:19:45 +00:00
Adrien Crivelli
15df6c1d7b
Reformat everything with PHP-Cs-Fixer 2018-01-26 23:54:37 +09:00
Christian Boltz
8fb67e6fbf
Fix broken table names caused by doubled table_by_key() calls
The high-level db_*() functions (like db_update(), and also
_db_add_field() in upgrade.php) call table_by_key() internally, which
also means the unwrangled table name needs to be handed over to them.
If handing over an already table_by_key()'d table name, it gets modified
again and results in something like prefix_prefix_mailbox.
2017-12-30 11:55:55 +01:00
houmingtao
5f1ac12d72 use current time as default token_validity value 2017-11-24 16:04:39 +08:00
root
4670182d79 fix invalid value for token_validity 2017-10-12 14:54:47 +08:00
Sylvain Tissot
ffb84283c2
Harden password reset process
The improvements are:

- Die with an explicit message when a user is trying to reset his lost password and the option is disabled in config
- Redirect user to main page after password change using relative URL
- Don't leak info whether user exists or has recovery info defined
- Throttle password reset requests to prevent brute force attacks
- Show phone/alt email fields in mailbox/admin edit form only when the password reset option is enabled
- Make database upgrade code compatible with other databases types
- Use the existing password generator to generate OTP. It is now stored in database, unique to each user, valid only for 1 hour and can only by used once.
2017-10-09 11:45:51 +09:00
Sylvain Tissot
9c9ba64a7f Allows a user or admin to reset his/her forgotten password with a code sent by email/SMS #18 2017-08-21 13:05:25 +02:00
Christian Boltz
a366654757
Better use Config::Lang instead of global $PALANG 2017-06-25 14:35:27 +02:00
David Goodwin
8508b8e119 global PALANG 2017-06-25 13:29:55 +01:00
Christian Boltz
80d381f644 Make VacationHandler compatible with MySQL strict mode again
The MySQL database layout includes a 'cache' column for historical
reasons, the PostgreSQL database never did.

r1883 removed the 'cache' column from VacationHandler to unbreak
PostgreSQL, and at the same time broke MySQL in strict mode.

This patch re-adds the 'cache' column only for MySQL to fix this
regression.



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1890 a1433add-5e2c-0410-b055-b7f2511e0802
2017-02-09 05:21:12 +00:00
Jan-Frederik Rieckers
800f07816a
Fix wrong way of check for can_delete 2017-02-07 15:54:21 +01:00
Jan-Frederik Rieckers
7bb36d0bbc
Fix security hole in AliasHandler
Without this fix it is possible to delete a protected alias via editing
the request parameter of the alias to delete.
2017-02-03 14:53:10 +01:00
David Goodwin
2f2db5949a fix date formatting in non-english languages, thanks to uz@musoftware.de
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1884 a1433add-5e2c-0410-b055-b7f2511e0802
2016-12-21 10:25:58 +00:00
David Goodwin
bd8e0e3ae3 apparently dead columns - thanks to uz@musoftware.de
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1883 a1433add-5e2c-0410-b055-b7f2511e0802
2016-12-20 08:39:18 +00:00
Christian Boltz
9ba7118d7b AliasHandler: restrict mailbox subquery to requested domains
set_is_mailbox_extrafrom() restricts the domain list to the domain that
needs to be checked (in normal list-virtual listing one domain), and is
then used to restore the default extrafrom.
This improves the performance for most usecases even for superadmins.

Note: Search mode might still be slow because by default it searches in
all domains available to the admin.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1882 a1433add-5e2c-0410-b055-b7f2511e0802
2016-11-09 20:41:24 +00:00
Christian Boltz
40b4fdf61c beautify alias list search parameters
AliasHandler:
- initStruct(): handle __mailbox_username as separate field (needed to
  make it searchable)
- split off a condition_ignore_mailboxes() function (used in getList()
  and getPagebrowser()) to add '__mailbox_username IS NULL' to the search
  condition array. Also, make sure $condition can be an array (preferred)
  or a string with a raw query

list-virtual.php:
- hand over a search array instead of a raw query


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1879 a1433add-5e2c-0410-b055-b7f2511e0802
2016-11-01 17:43:32 +00:00
Christian Boltz
bd28fcb194 AliasHandler: restrict __is_mailbox subquery to allowed domains
This improves performance on setups with lots of mailboxes.
Well, except for superadmins because restricting to "all domains"
doesn't really help ;-)

Thanks to gygy for reporting this on IRC, and for testing the patch.



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1877 a1433add-5e2c-0410-b055-b7f2511e0802
2016-10-31 20:15:31 +00:00
Christian Boltz
c909d4a71e FetchmailHandler: use a valid date as default for 'date'
This fixes an invalid query when using mysql strict mode.

Reported by Martin Kenney, https://sourceforge.net/p/postfixadmin/bugs/380/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1873 a1433add-5e2c-0410-b055-b7f2511e0802
2016-09-30 21:12:15 +00:00
Christian Boltz
386f37dfdb Don't decode b64p (base64-encoded password) fields.
This is not supported in MySQL < 5.6.
Besides that, we don't display the content of b64p fields anywhere, so
the easiest way is not to decode it.

Note: Currently, the only user of b64p is FetchmailHandler.

Fixes https://sourceforge.net/p/postfixadmin/bugs/357/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1847 a1433add-5e2c-0410-b055-b7f2511e0802
2016-05-22 17:44:17 +00:00
Christian Boltz
1d76c5af88 VacationHandler: Fill 'cache' field on INSERT
The 'cache' field is a leftover from PostfixAdmin 2.2 and unused (except
if someone still uses an ancient vacation.pl). However, MySQL in strict
mode errors out if isn't included in INSERTs because it doesn't have a
default value.

Fixes https://sourceforge.net/p/postfixadmin/bugs/345/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1845 a1433add-5e2c-0410-b055-b7f2511e0802
2016-05-22 16:17:46 +00:00
Christian Boltz
b261db86c7 Merge pull request #9 from phyrog/master
Add sqlite backend option (thank you @phyrog for doing this)

(imported from github)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1824 a1433add-5e2c-0410-b055-b7f2511e0802
2016-02-04 22:30:06 +00:00
Christian Boltz
c837eac20a DomainHandler:
- initStruct(): in 'aliases_quot' and '_aliases_quot_percent', use
  coalesce(__mailbox_count,0) - without, we always get _0_ aliases if
  a domain doesn't have mailboxes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1783 a1433add-5e2c-0410-b055-b7f2511e0802
2015-04-06 23:30:44 +00:00
Christian Boltz
23bdd02dcb broadcast-message.php, sendmail.php, MailboxHandler, *.lang:
- include mailbox name in pSendmail_result_error and
  pSendmail_result_success



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1781 a1433add-5e2c-0410-b055-b7f2511e0802
2015-04-06 22:44:51 +00:00
Christian Boltz
37bba15625 Use list.tpl to display the alias list
list-virtual.php:
- use list.tpl for aliases
- move show_gen_status handling for aliases to AliasHandler

AliasHandler:
- initStruct():
  - add 'status' column (hidden by default)
  - hide 'created'
  - move 'active' after 'modified' to match old list-virtual.php layout
- initMsg: add list_header
- webformConfig(): if $CONF[show_status], set display_in_list for
  'status' column. Also set a (whitespace) label to make sure it's
  displayed
- db_read_from_db_postprocess(): if 'status' column is requested, call
  gen_show_status() for each row

list-virtual.tpl
- remove alias table header and create alias button (which should have
  been in list-virtual_alias.tpl)

list-virtual_alias.tpl:
- replace code to generate the alias table with {include 'list.tpl'}
  (and some variable assignments)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1777 a1433add-5e2c-0410-b055-b7f2511e0802
2015-04-06 22:09:18 +00:00
Christian Boltz
adc038e218 list.tpl:
- add support for list_header (like ":: Alias" in list-virtual)

PFAHandler:
- add empty default for $msg['list_header']


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1776 a1433add-5e2c-0410-b055-b7f2511e0802
2015-04-06 21:58:58 +00:00
Christian Boltz
35fad174f7 smarty.inc.php:
- assign(): additionally provide the unsanitized values as RAW_$key

PFAHandler.php:
- document 'html' field type (used for raw html), including a big warning

list.tpl:
- add handling to display raw html fields

This is a preparation to use the status markers with list.tpl without
introducing too big changes.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1775 a1433add-5e2c-0410-b055-b7f2511e0802
2015-04-06 21:09:54 +00:00
Christian Boltz
3a72203de4 AliasHandler:
- initStruct(): replace (wrong) 'editable' with '_can_edit' and '_can_delete'
- read_from_db_postprocess(): disable _can_edit and _can_delete for
  default aliases if special_alias_control is off and not superadmin

list.tpl:
- use $item._can_edit instead of $check_alias_owner

list-virtual.php:
- drop $check_alias_owner variable and check_alias_owner() call
  (replaced by the code added in AliasHandler)
- drop unused $sql_domain

functions.inc.php:
- delete no longer used check_alias_owner() function



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1774 a1433add-5e2c-0410-b055-b7f2511e0802
2015-04-06 20:35:19 +00:00
Christian Boltz
8043515fdf migrate search input field to use search[_], and use list.tpl for alias domains
User-visible changes:
- alias domain list can be downloaded as CSV
- no more search highlighting for alias domains

list-virtual.php:
- expect $search to be an array
- change alias domain handling to use list.php instead of
  list-virtual_alias_domain.tpl, and move some logic from the template
  to list-virtual.php. (The template file is kept as list.tpl wrapper.)
- adopt mailbox and alias search to $search[_]
- adopt pagebrowser to $search[_]

list-virtual_alias_domain.tpl:
- replace custom output generation with {include 'list.php'} and some
  variable assignments

PFAHandler.php:
- add $this->id_field to $this->msg (avoids another smarty template
  variable)

configs/menu.conf:
- change input name to search[_]

list-virtual_alias.tpl, list-virtual_mailbox.tpl:
- adopt to $search[_] by setting $search in a backwards-compatible way

list.tpl:
- add special handling for aliasdomain.target_domain linking



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1773 a1433add-5e2c-0410-b055-b7f2511e0802
2015-04-06 14:17:25 +00:00
Christian Boltz
cc598d0f3f PFAHandler:
- build_select_query(): add support for $search['_'] (searching if one
  of the $this->searchfields contains the search text)
- getList(): make sure '_' is kept in the search parameters

functions.inc.php:
- db_where_clause(): slightly relax checks - if $condition is empty,
  only error out if $additional_raw_where is also empty


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1772 a1433add-5e2c-0410-b055-b7f2511e0802
2015-04-06 13:39:21 +00:00
Christian Boltz
31006928b4 AliasdomainHandler:
- initStruct(): Adjust columns to match list-virtual.php layout:
  - make 'alias_domain' a link
  - move 'active' after 'modified'
  - don't display 'created'



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1771 a1433add-5e2c-0410-b055-b7f2511e0802
2015-04-06 13:29:28 +00:00
Christian Boltz
4ce0a57e83 PFAHandler:
- add protected $searchfields = array(); - list of fields to search by
  default, if just a search term is given. This will be done with
  $search['_'], but that code is not implemented yet.
- add $this->msg['show_simple_search'] (true if $searchfields is non-empty)

list.tpl:
- display search input box and search overview only if $searchfields is
  not empty

AliasdomainHandler:
- add 'alias_domain' and 'target_domain' to $searchfields

MailboxHandler:
- add 'username' to $searchfields

AliasHandler:
- add 'address' and 'goto' to $searchfields

This effectively means that the search input box is no longer displayed
in list.php for admin, domain and fetchmail listings.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1770 a1433add-5e2c-0410-b055-b7f2511e0802
2015-04-05 20:23:38 +00:00
Christian Boltz
6e5c8f8054 add 'can_create' flag
PFAHandler:
- add $msg['can_create'] (true by default)

DomainHandler:
- set $msg['can_create'] based on is_superadmin

list.tpl:
- display 'create' button only if $msg['can_create'] is true

Note: This is only an optical improvement, not a permission check.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1769 a1433add-5e2c-0410-b055-b7f2511e0802
2015-04-05 19:21:15 +00:00
Christian Boltz
3f451371e3 PFAHandler:
- set(): if errormsg is set for a field, assume it's invalid (even if
  the validator functions did not (or forgot to) return False)

In theory this should never happen, but it's a nice safety net against
programming errors in validator functions that don't have an explicit
    return False;


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1768 a1433add-5e2c-0410-b055-b7f2511e0802
2015-04-04 14:37:46 +00:00
Christian Boltz
27bdba3ba2 Add FetchmailHandler.php
- uses list.php and edit.php instead of the fetchmail-specific template
- replaces fetchmail.php and its template

config.inc.php:
- add $CONF['fetchmail_struct_hook']



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1762 a1433add-5e2c-0410-b055-b7f2511e0802
2015-04-04 13:58:42 +00:00
Christian Boltz
9f2ae72f08 DomainHandler:
- initStruct(): re-enable total_quota - MailboxHandler needs it


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1758 a1433add-5e2c-0410-b055-b7f2511e0802
2015-03-19 23:07:19 +00:00
Christian Boltz
313270c00a PFAHandler.php:
- add getPagebrowser() (returns an array of pagebrowser keys)

AliasHandler.php:
- change getList() to work with empty $condition
- add getPagebrowser() to filter out mailboxes

list-virtual.php:
- replace $alias_pagebrowser_query and the create_page_browser() call
  with $handler->getPagebrowser()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1757 a1433add-5e2c-0410-b055-b7f2511e0802
2015-03-19 22:57:23 +00:00
Christian Boltz
28fe7042e8 PFAHandler.php:
- split off build_select_query() from read_from_db() as preparation for
  using build_select_query() to generate the pagebrowser query



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1756 a1433add-5e2c-0410-b055-b7f2511e0802
2015-03-19 22:05:49 +00:00