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
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
Christian Boltz
46d807c83d DomainHandler.php:
- initStruct():
  - don't display domain_quota if $CONF[quota] == NO or $CONF[domain_quota] is NO
  - drop 'total_quota' column which seems to be unused (and had a non-existing label)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1755 a1433add-5e2c-0410-b055-b7f2511e0802
2015-03-19 00:01:35 +00:00
Christian Boltz
dd43f12e9b delete list-admin.php and its template, use list.php instead
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1754 a1433add-5e2c-0410-b055-b7f2511e0802
2015-03-17 22:37:34 +00:00
Christian Boltz
add12b9fb4 AdminHandler.php:
- initStruct():
  - link username to domain list
  - hide superadmin, domain list and created columns in list view
  - add label to domain_count to make it visible in list view
- read_from_db_postprocess(): if user is a superadmin, replace domain
  count with "superadmin"



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1753 a1433add-5e2c-0410-b055-b7f2511e0802
2015-03-17 22:30:47 +00:00
Christian Boltz
eb7e40cf94 PFAHandler, editform.tpl:
- add support for 'b64p' fields (passwords stored base64-encoded)
  as preparation to migrate fetchmail.php to FetchmailHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1750 a1433add-5e2c-0410-b055-b7f2511e0802
2015-03-17 21:19:36 +00:00
Christian Boltz
cc2b157d59 *Handler:
- add $msg['confirm'] (confirmation message when attemping to delete an
  item, displayed by list.php)

*.lang:
- add various confirm_delete_* texts needed by *Handler
- rename confirm_domain to confirm_delete_domain


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1749 a1433add-5e2c-0410-b055-b7f2511e0802
2015-03-17 21:07:59 +00:00
Christian Boltz
1d35ba80ab model/DomainHandler.php:
- initStruct():
  - add optical quota indicators for aliases, mailboxes, domain quota
  - some adjustments to get nice output with list.php (mostly following
    list-domain.php)
- webformConfig(): switch listview to list.php

configs/menu.conf, templates/adminlistadmin.tpl:
- switch list-domain.php to list.php?table=domain



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1745 a1433add-5e2c-0410-b055-b7f2511e0802
2015-02-28 22:42:11 +00:00
Christian Boltz
5706f146d6 MailboxHandler:
- storemore(): store maildir in the correct variable to fix running
  mailbox_postedit script
  Fix by bit-jockey @SF,
  https://sourceforge.net/p/postfixadmin/bugs/342/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1737 a1433add-5e2c-0410-b055-b7f2511e0802
2015-01-24 14:00:35 +00:00
Christian Boltz
087dc34b01 MailboxHandler:
- check_quota(): deny creating an unlimited mailbox if domain quota is set
  (reported by idaho7 in IRC)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1736 a1433add-5e2c-0410-b055-b7f2511e0802
2015-01-12 17:12:07 +00:00
Christian Boltz
7bf5b74a47 MailboxHandler, AliasHandler:
- initStruct: set "display in list" to 1 to allow searching for domain
  with list.php (nevertheless, the domain won't be displayed because
  it doesn't have a column label set)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1735 a1433add-5e2c-0410-b055-b7f2511e0802
2015-01-07 21:25:20 +00:00
Christian Boltz
13f1a28b6e PFAHandler:
- read_from_db(), getList(): 
  - add $searchmode parameter (_before_ $limit and $offset!) to be able to 
    use query different query modes, not only "="
  - add a warning that $condition will be changed to array only in the future
- getList(): filter $condition for fields that are available to the user
  to avoid information leaks by using search parameters
  (filter is only applied if $condition is an array!)

functions.inc.php: 
- db_where_clause():
  - add $additional_raw_where parameter for additional query parameters
  - add $searchmode parameter to be able to use query different
    query modes, not only "=" (see $allowed_operators)
  - check for allowed operators in $searchmode
  - split query into WHERE and HAVING (if a parameter has
    $struct[select] set, HAVING is used)

list-virtual.php:
- adopt getList() call to the new syntax

AliasHandler:
- adopt getList() definition and call to the new syntax

 


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1731 a1433add-5e2c-0410-b055-b7f2511e0802
2014-11-02 22:45:22 +00:00
Christian Boltz
b76511628d PFAHandler:
- add $this->order_by to allow ordering by any field(s)
  (defaults to $this->id_field)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1730 a1433add-5e2c-0410-b055-b7f2511e0802
2014-11-02 22:07:20 +00:00
Christian Boltz
6bfe6706ba PFAHandler:
- add $this->label_field and $this->label (defaults to $this->id_field 
  and $this->id) to allow nicer messages
- use $this->label in various messages



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1729 a1433add-5e2c-0410-b055-b7f2511e0802
2014-11-02 22:03:58 +00:00
Christian Boltz
ca76b0fb6e PFAHandler:
- add getMsg() function (needed by list.php)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1728 a1433add-5e2c-0410-b055-b7f2511e0802
2014-11-02 21:55:56 +00:00
Christian Boltz
a4085d287f DomainHandler:
- initStruct: 
  - set column write permissions depending on superadmin status
  - add _can_edit and _can_delete (also depending on superadmin status)
- webformConfig(): reduce required permissions to 'admin'
- add beforestore() - aborts writing for non-superadmins
- delete: allow deletion only for superadmins

*.lang:
- new text 'no_delete_permissions'



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1718 a1433add-5e2c-0410-b055-b7f2511e0802
2014-11-01 20:58:01 +00:00
Christian Boltz
e39d13aa52 PFAHandler:
Add $can_edit and $can_delete flags. This makes it possible to make 
some, but not all items non-editable or non-deletable (based on a 
database column/query or read_from_db_postprocess())

- add $can_edit and $can_delete
- after initStruct, check if $struct contains _can_edit and _can_delete.
  If not, fill with default values (allowed)
- init(): set $this->can_edit and $this->can_delete (only in view/edit mode)
- set(): abort if !$this->can_edit



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1716 a1433add-5e2c-0410-b055-b7f2511e0802
2014-11-01 19:51:25 +00:00
Christian Boltz
3fe75c117d PFAHandler:
- add handling of users (non-admins), including permission checks



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1715 a1433add-5e2c-0410-b055-b7f2511e0802
2014-11-01 19:38:28 +00:00
Christian Boltz
72d9d42601 PFAHandler:
- add protected $is_superadmin = 1;
  will be set to 0 if $admin_username is set and is not a superadmin



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1714 a1433add-5e2c-0410-b055-b7f2511e0802
2014-11-01 19:30:54 +00:00
Christian Boltz
f07281cdc1 PFAHandler:
- automatically skip quot, vnum and vtxt fields in store()
  (as if dont_write_to_db == 1)
- document new field types vtxt and quot and mark field types that will
  never be stored in db



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1713 a1433add-5e2c-0410-b055-b7f2511e0802
2014-11-01 19:25:11 +00:00
Christian Boltz
647aa39218 PFAHandler:
- add validation for "enma" field type - list of options, must be given
  in column "options" as associative array (value => displayed value)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1711 a1433add-5e2c-0410-b055-b7f2511e0802
2014-11-01 18:54:27 +00:00
Christian Boltz
d9e30fb41b Add CliScheme.php:
- displays the database scheme (for usage in upgrade.php)

PFAHandler:
- add "Scheme" to the list of available tasks

postfixadmin-cli.php:
- add "scheme" to help

This is the first patch of a series sponsored by 
    Bund der Deutschen Landjugend (german rural youth)
	http://bdl.landjugend.info/



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1710 a1433add-5e2c-0410-b055-b7f2511e0802
2014-11-01 18:08:11 +00:00
Christian Boltz
22839d3695 Cli*.php:
- add SVN $Id header


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1709 a1433add-5e2c-0410-b055-b7f2511e0802
2014-11-01 18:05:39 +00:00
Christian Boltz
6ec360b0b7 AliasHandler:
- finally fix alias deletion when using MariaDB. The workaround is
  to add another field from the subquery to the outer SELECT so that
  MariaDB can't optimize the subquery to "always 1"
  http://sourceforge.net/p/postfixadmin/bugs/325/
  (I'll open a MariaDB bugreport and add the link to the bugtracker)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1703 a1433add-5e2c-0410-b055-b7f2511e0802
2014-10-23 18:26:54 +00:00
Christian Boltz
46a632ec02 AliasHandler:
- initStruct(): revert the MariaDB workaround because PostfixAdmin now
  "thinks" none of the aliases belong to a mailbox (and displays all of
  them in the alias list, even the mailbox aliases)
  - reverts r1699 + the CHANGELOG entry (part of r1700)
  - reopened https://sourceforge.net/p/postfixadmin/bugs/325/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1702 a1433add-5e2c-0410-b055-b7f2511e0802
2014-10-22 16:30:25 +00:00
Christian Boltz
d9ff7ece05 AliasHandler:
- initStruct(): use "SELECT COUNT(1)" instead of "SELECT 1" as workaround
  for a MariaDB problem (bug?)
  https://sourceforge.net/p/postfixadmin/bugs/325/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1700 a1433add-5e2c-0410-b055-b7f2511e0802
2014-10-22 15:12:08 +00:00
David Goodwin
f436a0d17c fix typo in model/CliHelp.php as per ticket 332
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1698 a1433add-5e2c-0410-b055-b7f2511e0802
2014-10-20 08:31:57 +00:00
Christian Boltz
fb4af233af config.inc.php:
- add note that $CONF[vacation_domain] can't be used for "normal" mails

model/DomainHandler.php:
- validate_new_id(): 
  - error out when trying to add $CONF[vacation_domain]
  - some whitespace fixes
- remove superfluous comment on initStruct()

*.lang:
- add 'domain_conflict_vacation_domain' error message



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1694 a1433add-5e2c-0410-b055-b7f2511e0802
2014-10-07 16:11:49 +00:00
Christian Boltz
b30292c420 MailboxHandler.php:
- storemore(): 
  - fix undefined variable if creating subfolders fails (bug#328)
  - remove some outdated TODO notes
- create_mailbox_subfolders(): add $this->id to error_log


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1693 a1433add-5e2c-0410-b055-b7f2511e0802
2014-10-05 22:09:42 +00:00
Christian Boltz
d80816ad86 DomainHandler:
- $CONF[default_aliases] can now use the new domain as alias target
  http://sourceforge.net/p/postfixadmin/patches/124/

config.inc.php:
- update comment for $CONF[default_aliases]



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1690 a1433add-5e2c-0410-b055-b7f2511e0802
2014-09-28 10:39:42 +00:00
Christian Boltz
c5de88390e PFAHandler.php:
fix logging - log the domain instead of $this->id
- add protected $domain (used for logging)
- add function domain_from_id()
- http://sourceforge.net/p/postfixadmin/bugs/317/

AliasHandler.php:
- add function domain_from_id()

MailboxHandler.php:
- add function domain_from_id()
- init(): use $this->domain instead of splitting $this-id again



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1684 a1433add-5e2c-0410-b055-b7f2511e0802
2014-09-12 09:22:09 +00:00
Christian Boltz
3f62a577a4 CliHelp:
- remove help text about "password" command (not implemented)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1683 a1433add-5e2c-0410-b055-b7f2511e0802
2014-09-11 22:17:59 +00:00
Christian Boltz
8e5a4551cb AliasHandler:
- fix query in getList(), which caused an empty list on some systems
  https://sourceforge.net/p/postfixadmin/bugs/313/
  Fix by VERSATECH SRL, versatechsrl @SF


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1678 a1433add-5e2c-0410-b055-b7f2511e0802
2014-06-06 19:11:05 +00:00
Christian Boltz
566f2845bd AliasHandler:
- setmore(): use old goto values if no new value is given. Fixes
  'Making alias inactive cleans "goto" field'
  https://sourceforge.net/p/postfixadmin/bugs/316/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1675 a1433add-5e2c-0410-b055-b7f2511e0802
2014-05-27 21:27:20 +00:00
Christian Boltz
a8b79b4548 MailboxHandler:
- validate_new_id(): make sure mailbox creation still works if the 
  alias limit for the domain is hit


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1663 a1433add-5e2c-0410-b055-b7f2511e0802
2014-04-28 20:42:38 +00:00
Christian Boltz
bbd7c3af77 CliEdit.php:
- execute(): call __handle_params() also if empty args[0] is given
- __interactive(): only ask for id if $id_field is editable

This fixes two issues with a non-editable auto_increment id field


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1661 a1433add-5e2c-0410-b055-b7f2511e0802
2014-04-27 13:41:41 +00:00
Christian Boltz
2289096ccc Config.php:
- do not error_log() 'undefined config option' for deprecated options



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1659 a1433add-5e2c-0410-b055-b7f2511e0802
2014-03-18 21:57:47 +00:00
Christian Boltz
5fcade96d5 MailboxHandler:
- read_from_db_postprocess(): avoid warning if quota is disabled in $struct


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1655 a1433add-5e2c-0410-b055-b7f2511e0802
2014-03-16 19:29:55 +00:00
David Goodwin
eb2ccbc2e5 typo fix
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1642 a1433add-5e2c-0410-b055-b7f2511e0802
2014-02-19 11:47:17 +00:00
Christian Boltz
8c139c95d6 vacation:
restrict reply type to a list of options ($CONF[vacation_choice_of_reply]),
remove input field for custom interval


config.inc.php:
- change $CONF['vacation_choice_of_reply'] to [seconds] => [$PALANG label]
  (note: reply to every mail is commented by default because it can be
  annoying. Admins will have to explicitely add/enable it in their config.)
- remove $CONF[vacation_replytype_default]
- update comment about dovecot:* for $CONF[encrypt]

*.lang:
- add texts for reply types

VacationHandler.php:
- remove reply_type at various places
- set_away(): remove reply_type from list of function parameters

templates/vacation.tpl:
- update reply type dropdown for the changed $CONF['vacation_choice_of_reply']
- remove the input fields for custom reply delay

vacation.php:
- restrict reply type to a list of options ($CONF[vacation_choice_of_reply])
- if vacation is disabled, but old values are stored in the database,
  change the activeFrom and activeUntil date to today to avoid users
  have to scroll through the calendar a lot

xmlrpc.php:
- update set_away() call to match the removed parameter

upgrade.php:
- comment out upgrade_1345_mysql() which created the reply_type and 
  interval_time fields in the vacation table in mysql
- add upgrade_1610() to add the vacation.interval_time field


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1610 a1433add-5e2c-0410-b055-b7f2511e0802
2013-12-22 16:50:55 +00:00
Christian Boltz
8d99a8a9fb DomainHandler:
- initStruct(): set valid bool default for backupmx


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1604 a1433add-5e2c-0410-b055-b7f2511e0802
2013-12-08 21:30:30 +00:00
Christian Boltz
beffb3ec85 r1595 accidently included more changed files than it should.
This commit contains some dummy changes to get a proper changelog
attached to those files.

VacationHandler:
- (r1595) rewrite based on PFAHandler (not useable yet)
- (this commit) add a dummy init() function that calls die()

DOCUMENTS/DOVECOT.txt:
- (r1595) TODO note
- (this commit) remove the TODO note again

CHANGELOG.TXT:
- (r1595) include changes of 2.3.4, 2.3.5 and 2.3.6 (copied from 2.3 branch)
- (r1595) update some notes about SVN version (still far from complete)	


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1596 a1433add-5e2c-0410-b055-b7f2511e0802
2013-12-01 22:29:25 +00:00
Christian Boltz
57f4ad0b75 functions.inc.php pacrypt():
- for 'system' encryption, use full hashed password as salt 
  https://sourceforge.net/p/postfixadmin/bugs/2/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1595 a1433add-5e2c-0410-b055-b7f2511e0802
2013-12-01 21:48:14 +00:00
Christian Boltz
bafd2f1f58 edit.php:
- use prefill values from $_SESSION (if not provided in GET/POST)
- remember prefill values for next usage of the form

list-virtual.php
- set prefill values for edit.php

PFAHandler.php:
- let prefill() store the value in $struct if no prefill_$field()
  function exists

This fixes the remaining parts of
http://sourceforge.net/p/postfixadmin/bugs/298/



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1594 a1433add-5e2c-0410-b055-b7f2511e0802
2013-12-01 20:45:17 +00:00
Christian Boltz
1688065fca DomainHandler.php:
- better error/info messages
- remove superfluous (and never displayed) success message in storemore()

languages/*.lang:
- add texts for DomainHandler
- delete empty pAdminCreate_domain_defaultaliases_text



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1588 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-16 20:32:37 +00:00
Christian Boltz
801acc6cf2 AliasHandler:
- only allow @domain as target if $this->id is a catchall
- delete commented out version of delete()
- better error messages

languages/*.lang
- add new texts needed for AliasHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1587 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-16 20:20:50 +00:00
Christian Boltz
4e489df526 AliasdomainHandler:
- better error messages

languages/*.lang
- rename pCreate_alias_domain_error3 to alias_domain_create_failed
- add new texts needed for AliasdomainHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1586 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-16 20:02:14 +00:00
Christian Boltz
c11932e58c MailboxHandler:
- use better/translateable messages at various places

languages/*.lang
- add texts needed by MailboxHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1585 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-16 19:49:40 +00:00
Christian Boltz
53c28990ad PFAHandler:
- read_from_db(): convert $limit and $offset with (int) to make sure
  they contain a sane value


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1584 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-16 19:10:15 +00:00
Christian Boltz
79274dcedf AdminHandler:
- clear some TODO notes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1583 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-16 19:02:44 +00:00
Christian Boltz
20d1ffcafc functions.inc.php:
- new function db_pgsql() to replace lots of
  "if ($CONF[database_type] == 'pgsql')) checks
- delete unused function boolconf()

several files:
- use db_pgsql() instead of checking $CONF[database_type]



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1582 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-16 00:00:53 +00:00
Christian Boltz
60297e483c *.lang:
- rename pAdminCreate_admin_username_text to email_address
- rename pAdminEdit_admin_super_admin to super_admin

AdminHandler.php - initStruct(): 
- adopt to the renamed $PALANG texts
- remove some TODOs
- whitespace changes

setup.php, adminlistadmin.tpl:
- adopt to the renamed $PALANG texts


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1580 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-14 22:33:56 +00:00
Christian Boltz
2bf5df92ea functions.inc.php, DomainHandler, MailboxHandler:
- move mailbox_postdeletion() to MailboxHandler
- move domain_postcreation() and domain_postdeletion() to
  DomainHandler
- adopt those functions for usage inside the *Handler (replace
  print with $this->errormsg etc.)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1579 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-14 22:10:05 +00:00
Christian Boltz
c65e3293b6 Quite big CLI cleanup (and more)
model/CliHelp.php:
- new class, used for "postfixadmin-cli $module help"
- replaces the PostfixAdmin* classes in scripts/shells/*.php

model/PFAHandler.php
- add public $taskNames with the list of supported CLI commands

scripts/postfixadmin-cli.php - dispatch():
- directly set the classes to load instead of using shell->loadTasks()
- when "postfixadmin-cli $module" is called, display help instead of 
  error message about "invalid command ''"
- make it more readable by moving error checks to the beginning
  (replaces deeply nested if's with return statements)
- remove unused code parts

scripts/shells/*.php:
- remove PostfixAdmin* classes (obsoleted by CliHelp)
- remove $tasks (now in PFAHandler)
- delete alias.php and domain.php because nothing is left
- mailbox.php still contains PasswordTask

scripts/shells/shell.php:
- remove $taskNames (moved to PFAHandler)
- remove loadTasks() (integrated in postfixadmin-cli.php's dispatch())



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1575 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-13 19:07:12 +00:00
Christian Boltz
b3dc3f91ae AliasHandler:
- if parent::init() fails, return false early to avoid warnings about
  undefined $this->result


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1574 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-13 00:40:08 +00:00
Christian Boltz
39001c3ba4 DomainHandler.php:
- add some _formatted_*() functions to get a more informative output
  (currently only used in CLI)

MailboxHandler.php:
- add TODO for reading used quota from quota/quota2 table and adding
  a formatted_quota() function



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1573 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-12 21:37:08 +00:00
Christian Boltz
04cd5c5aa4 model/CliView.php:
- new file for CLI 'view'
- based on the ViewTask classes in scripts/shells/*.php
- introduces usage of *Handler->_formatted_$field() to get "pretty" 
  output for a field 
  (not sure if this is the final solution, but it works ;-)

scripts/shells/*.php
- remove ViewTask, obsoleted by model/CliView.php
 
scripts/shells/shell.php:
- use CliView instead of ViewTask



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1572 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-12 21:32:49 +00:00
Christian Boltz
f1831975c0 CliDelete:
- execute() and help() must be public


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1571 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-12 21:19:54 +00:00
Christian Boltz
0a71a236c2 model/CliDelete.php
- new file, handles deleting something with the CLI
  (based on DeleteTask in scripts/shells/*.php)

scripts/shells/*.php
- remove DeleteTask, obsoleted by model/CliDelete.php

scripts/shells/shell.php:
- use CliDelete instead of DeleteTask



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1570 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-12 19:32:12 +00:00
Christian Boltz
288ba0e143 DomainHandler.php
- delete(): check if the domain is an alias domain target - if yes, do 
  not allow to delete it
- better error message if domain_postdeletion() fails

*.lang:
- rename pAdminDelete_domain_error to domain_postdel_failed and change 
  the text
- add delete_domain_aliasdomain_target



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1567 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-10 23:05:43 +00:00
Christian Boltz
508d05e1ed AdminHandler.php, AdminpasswordHandler.php:
- initMsg(): better texts for error_already_exists and error_does_not_exist 

*.lang:
- rename pAdminCreate_admin_username_text_error2 to admin_already_exists
  and change the text
- add admin_does_not_exist



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1565 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-10 22:00:16 +00:00
Christian Boltz
3b09562fb8 MailboxHandler.php:
- rewrite and simplify delete()
- also cleanup fetchmail, quota	and quota2 tables

AliasHandler.php:
- update delete() to match the workflow in other classes



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1562 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-10 19:38:43 +00:00
Christian Boltz
bcb38c9664 AliasdomainHandler:
- implement delete()
- rename _field_target_domain() to _validate_target_domain()
  (follow-up for r1555)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1561 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-10 18:55:23 +00:00
Christian Boltz
2f26624ceb DomainHandler.php, AdminHandler.php:
- implement delete()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1560 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-10 17:26:47 +00:00
Christian Boltz
5871516b47 model/Config:
- read_f(): fix error logging - $var can be an array


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1559 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-10 16:00:20 +00:00
Christian Boltz
49573da2d7 PFAHandler:
- make error messages in _inp_*() translateable
- make date format in SQL "translateable"

*.lang:
- add the texts needed for the changes listed above


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1556 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-08 21:49:53 +00:00
Christian Boltz
1b74926afb PFAHandler, *Handler:
- rename _field_$field() to _validate_$field() to make the function name
  more obvious
 


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1555 a1433add-5e2c-0410-b055-b7f2511e0802
2013-11-08 21:26:46 +00:00
Christian Boltz
462cb6992f AdminpasswordHandler:
- initStruct(): remove description for current password - it doesn't
  exist in $PALANG and we don't really need a description here


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1550 a1433add-5e2c-0410-b055-b7f2511e0802
2013-10-31 21:05:54 +00:00
Christian Boltz
f748f31137 model/Config.php:
- Config::read(): error_log() attemps to read undefined config options


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1549 a1433add-5e2c-0410-b055-b7f2511e0802
2013-10-31 21:02:04 +00:00
Christian Boltz
8ea4fd6c82 AliasdomainHandler.php:
- better error/success messages
- cleanup TODO notes

*.lang:
- new texts for alias domains: alias_domain_change_failed, 
  alias_domain_changed, alias_domain_to_itsself


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1541 a1433add-5e2c-0410-b055-b7f2511e0802
2013-10-19 18:45:41 +00:00
Christian Boltz
e96544e815 model/PFAHandler.php, setup.php:
- use Config::lang_f() for $this->msg['successmessage']

*.lang:
- add %s to all texts used for 'successmessage'


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1540 a1433add-5e2c-0410-b055-b7f2511e0802
2013-10-13 22:07:15 +00:00
Christian Boltz
21aea632b7 model/PFAHandler.php:
- use Config::lang_f() for msg['store_error']

*.lang:
- add %s to all messages that are used as store_error


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1539 a1433add-5e2c-0410-b055-b7f2511e0802
2013-10-13 20:33:48 +00:00
Christian Boltz
e809d2c651 MailboxHandler.php:
- _missing_maildir(): fix forgotten $CONF usage
- cleanup outdated TODO notes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1538 a1433add-5e2c-0410-b055-b7f2511e0802
2013-10-13 20:07:34 +00:00
Christian Boltz
4d9a338eb2 After hunting an "undefined index transport" error in list-domain, I
found out that the 'Config' class is too static - it shares its static
data with the 'Lang' child class. 

This caused a conflict because we have $CONF[transport] and 
$PALANG[transport], and Config::read('transport') returned the $PALANG 
text.

To fix this, all texts are now stored as $CONF[__LANG].
I also dropped the 'Lang' class.


model/Config.php:
- mark the 'Config' class as final to ensure we don't trap into the 
  "too static" problem again.
- bool(): display and log an error message if a $CONF option does not
  contain YES or NO (that would have uncovered this bug much earlier)
- add lang() and lang_f() wrapper functions to get $PALANG texts
- remove unused $__cache and $__objects

model/Lang.php:
- deleted

common.php:
- store $PALANG as $CONF[__LANG]

lots of files:
- replace Lang::read() and Lang::read_f() calls with Config::lang()
  and Config::lang_f()




git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1536 a1433add-5e2c-0410-b055-b7f2511e0802
2013-10-13 18:11:18 +00:00
Christian Boltz
f2c2b554ac model/PFAHandler.php:
- getList: change return value to be always true (even if the database 
  result is an empty array), and die() if the database result is not an 
  array.
  This avoids some if blocks in various files to implement a fallback
  to array() on empty results.

functions.inc.php:
- list_admins(): simplify after the *Handler->getList() change
- get_domain_properties(): change a forgotten $handler->return to 
  $handler->result() (follow-up for r1534)

list-domain, list-virtual.php:
- simplify after the *Handler->getList() change



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1535 a1433add-5e2c-0410-b055-b7f2511e0802
2013-10-13 16:11:15 +00:00
Christian Boltz
bb7a3ff04d model/*Handler.php and various other files
- rename $this->return to $this->result


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1534 a1433add-5e2c-0410-b055-b7f2511e0802
2013-10-13 15:26:37 +00:00
Christian Boltz
f38b10cd61 PFAHandler.php:
- set(): make "field $key is missing" translateable
- store(): call db_log() even if storemore() failed


MailboxHandler.php
- storemore(): use $this->infomsg instead of flash_info
 
*.lang
- add 'missing_field' = 'Field %s is missing';
- change reate_mailbox_result_success' and
  'pCreate_mailbox_result_succes_nosubfolders'
  to "The mailbox %s ..."

en.lang, nl.lang:
- remove unused texts 'pAdminList_domain_usercontrol',
  'pAdminCreate_domain_usercontrol', 'pAdminEdit_domain_usercontrol'


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1533 a1433add-5e2c-0410-b055-b7f2511e0802
2013-10-09 20:11:06 +00:00
Christian Boltz
ade5fd0c24 AliasHandler:
- initStruct(): set default for 'goto' to empty array()
  This fixes a problem with the cli when --goto was not specified				


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1530 a1433add-5e2c-0410-b055-b7f2511e0802
2013-10-07 20:01:52 +00:00
Christian Boltz
6ea8b370c0 CliEdit.php:
- make help text (slightly) different for add vs. update


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1528 a1433add-5e2c-0410-b055-b7f2511e0802
2013-10-06 22:35:02 +00:00
Christian Boltz
5f94773ae4 MailboxHandler:
- fix syntax error :-/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1518 a1433add-5e2c-0410-b055-b7f2511e0802
2013-08-07 21:46:53 +00:00
Christian Boltz
7b6f3e56cb MailboxHandler.php:
- create_mailbox_subfolders(), check_quota(): 
  use class variables instead of parameters
- create_mailbox_subfolders(): remove check for empty $this-id - this can 
  never happen because it would fail much earlier in the class
- check_quota(), allowed_quota(), mailbox_post_script(), 
  create_mailbox_subfolders(): mark as protected



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1517 a1433add-5e2c-0410-b055-b7f2511e0802
2013-08-07 20:58:02 +00:00
Christian Boltz
f9506d97b1 MailboxHandler.php:
- new function mailbox_post_script()
  - result of merging mailbox_postcreation() and mailbox_postedit(),
    replaces those two functions
  - drop all parameters, read them from class variables instead
  - store warn message in $this->errormsg[] instead of using print
- changed function calls to use mailbox_post_script()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1516 a1433add-5e2c-0410-b055-b7f2511e0802
2013-08-07 20:39:37 +00:00
Christian Boltz
73a793433e moved the following functions from functions.inc.php to MailboxHandler.php:
- check_quota ()
- allowed_quota()
- mailbox_postcreation()
- mailbox_postedit()
- create_mailbox_subfolders()

The code was moved without any changes, except
- added leading whitespace
- removed "TODO: move to MailboxHandler" ;-)


MailboxHandler:
- change function calls for moved functions


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1515 a1433add-5e2c-0410-b055-b7f2511e0802
2013-08-07 20:05:18 +00:00
Christian Boltz
08c9b4e49f *.lang:
- renamed some $PALANG texts:
  - pOverview_button => go
  - pOverview_mailbox_name => name
  - pSendmail_admin => from
  - pAdminEdit_admin_username => admin
  - pEdit_alias_goto => to 
- deleted obsolete or duplicate $PALANG texts:
  - pOverview_alias_goto
  - pCreate_alias_goto
  - pEdit_alias_button
  - pEdit_mailbox_name
  - pEdit_mailbox_button
  - pViewlog_username
  - pViewlog_button
  - pAdminList_admin_username
  - pAdminList_virtual_button
  - pAdminList_virtual_alias_address
  - pAdminList_virtual_alias_goto
  - pAdminList_virtual_mailbox_name
  - pAdminEdit_domain_button
  - pAdminEdit_admin_button
  - pBroadcast_from
  - pBroadcast_send

model/*, setup.php, templates/*, users/edit-alias.php:
- update to use the renamed $PALANG texts


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1513 a1433add-5e2c-0410-b055-b7f2511e0802
2013-07-29 22:08:07 +00:00
Christian Boltz
76f66ac8db *.lang:
- rename some $PALANG variables once more because smarty breaks when
  using "-"
  - add-alias => add_alias
  - add-alias-domain => add_alias_domain
  - add-mailbox => add_mailbox
  - email-address-already-exists => email_address_already_exists
  - change-password => change_password
  - password-again => password_again

model/*, setup.php, templates/*
- update to use the changed $PALANG variables


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1511 a1433add-5e2c-0410-b055-b7f2511e0802
2013-07-28 22:51:28 +00:00
Christian Boltz
9c0004a431 *.lang:
- rename various $PALANG texts:
  - pMenu_create_alias => add-alias
  - pMenu_create_alias_domain => add-alias-domain
  - pMenu_create_mailbox => add-mailbox
  - pOverview_get_mailboxes => mailboxes
  - pPassword_button => change-password
  - pAdminList_domain_description => description
  - pAdminList_domain_aliases => aliases
  - pAdminEdit_domain_transport => transport
  - pAdminEdit_admin_password2 => password-again
- remove duplicate or unused $PALANG texts:
  - pOverview_alias_alias_count
  - pOverview_alias_mailbox_count
  - pOverview_get_aliases
  - pCreate_alias_domain_button
  - pCreate_alias_welcome
  - pCreate_alias_button
  - pCreate_mailbox_password2
  - pCreate_mailbox_quota_text_error
  - pCreate_mailbox_button
  - pAdminMenu_viewlog
  - pAdminMenu_create_alias
  - pAdminMenu_create_mailbox
  - pAdminList_domain_mailboxes
  - pAdminList_domain_transport
  - pAdminList_virtual_welcome
  - pAdminList_virtual_alias_alias_count
  - pAdminList_virtual_alias_mailbox_count
  - pAdminList_virtual_mailbox_username
  - pAdminList_virtual_mailbox_quota
  - pAdminEdit_domain_description
  - pAdminEdit_domain_aliases
  - pAdminEdit_domain_mailboxes
  - pAdminEdit_domain_mailboxes_text
  - pUsersMenu_password

model/*, seetup.php, templates/*
- use changed $PALANG texts


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1510 a1433add-5e2c-0410-b055-b7f2511e0802
2013-07-28 22:33:35 +00:00
Christian Boltz
7bf10e6b91 *.lang:
- rename $PALANG['pEdit_alias_address'] to $PALANG['alias']
  - remove duplicate $PALANG['pOverview_alias_edit']

model/*, templates/*:
- use $PALANG['alias'] everywhere


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1507 a1433add-5e2c-0410-b055-b7f2511e0802
2013-07-28 20:22:05 +00:00
Christian Boltz
c70465f0e3 *.lang:
- rename $PALANG['pCreate_alias_address_text_error2'] to 
  $PALANG['email-address-already-exists']
- delete $PALANG['pCreate_mailbox_username_text_error2']

model/*:
- use new $PALANG names


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1506 a1433add-5e2c-0410-b055-b7f2511e0802
2013-07-28 20:14:57 +00:00
Christian Boltz
80591f97bc *.lang:
- add $PALANG['password'] to replace duplicate texts
  -$PALANG['pLogin_password']
  -$PALANG['pCreate_mailbox_password']
  -$PALANG['pAdminEdit_admin_password']
- set $PALANG['pFetchmail_field_src_password']= $PALANG['password']; 
  (needed until fetchmail is migrated into FetchmailHandler)

model/*, setup.php, templates/*:
- use $PALANG['password'] everywhere	  


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1504 a1433add-5e2c-0410-b055-b7f2511e0802
2013-07-28 19:46:50 +00:00
Christian Boltz
a1646f84b6 *.lang:
- add $PALANG['active'] = 'Active' to replace various duplicates:
  -$PALANG['pOverview_alias_active']
  -$PALANG['pOverview_alias_domain_active']
  -$PALANG['pOverview_mailbox_active']
  -$PALANG['pCreate_alias_active']
  -$PALANG['pEdit_alias_active']
  -$PALANG['pCreate_mailbox_active']
  -$PALANG['pAdminList_admin_active']
  -$PALANG['pAdminList_domain_active']
  -$PALANG['pAdminList_virtual_mailbox_active']
  -$PALANG['pAdminEdit_domain_active']
  -$PALANG['pAdminEdit_admin_active']

model/*, templates/*:
- use $PALANG['active'] everywhere


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1503 a1433add-5e2c-0410-b055-b7f2511e0802
2013-07-28 19:24:00 +00:00
Christian Boltz
bf0a5c02f4 *.lang:
- add $PALANG['domain'] = 'Domain'; which replaces duplicate texts:
  -$PALANG['pOverview_get_domain']
  -$PALANG['pViewlog_domain']
  -$PALANG['pAdminList_admin_domain']
  -$PALANG['pAdminList_domain_domain']
  -$PALANG['pAdminEdit_domain_domain']
  -$PALANG['pAdminCreate_admin_address']

model/*, templates/*:
- update to use $PALANG['domain']  


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1502 a1433add-5e2c-0410-b055-b7f2511e0802
2013-07-28 18:25:43 +00:00
Christian Boltz
fcee414740 *.lang and various other files:
- rename $PALANG['pAdminList_domain_modified'] to $PALANG['last_modified']


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1500 a1433add-5e2c-0410-b055-b7f2511e0802
2013-07-27 21:52:52 +00:00
Christian Boltz
d3d7249ea0 MailboxHandler.php:
- remove a TODO in store_more() (tested, works already)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1494 a1433add-5e2c-0410-b055-b7f2511e0802
2013-06-23 20:23:02 +00:00
Christian Boltz
414c05e678 functions.inc.php:
- db_where_clause(): wrap condition in "(...)"


model/PFAHandler.php:
- read_from_db(): wrap condition in "(...)"


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1493 a1433add-5e2c-0410-b055-b7f2511e0802
2013-06-23 20:02:05 +00:00
Christian Boltz
00bc5c6553 AdminpasswordHandler.php:
- new file, used for "change password" for admins

configs/menu.conf:
- switch from password.php to edit.php?table=adminpassword

password.php:
- deleted, replaced by AdminpasswordHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1491 a1433add-5e2c-0410-b055-b7f2511e0802
2013-06-23 17:49:54 +00:00
Christian Boltz
ce233789b9 PFAHandler.php:
- add $skip_empty_pass (default: true) - set to false to
  disable skipping empty password fields in edit mode
  (needed for "change password" form)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1490 a1433add-5e2c-0410-b055-b7f2511e0802
2013-06-23 17:34:14 +00:00
Christian Boltz
7557ed5fae PFAHandler.php, MailboxHandler.php:
- move login() to PFAHandler.php


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1485 a1433add-5e2c-0410-b055-b7f2511e0802
2013-06-23 15:13:33 +00:00
Christian Boltz
8ff856df12 MailboxHandler.php:
- make login() a non-static function
- login: use $this->db_table and $this->id_field instead of hardcoded names

users/login.php, xmlrpc.php:
- adopt to now non-static MailboxHandler->login()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1484 a1433add-5e2c-0410-b055-b7f2511e0802
2013-06-23 15:07:17 +00:00
Christian Boltz
9af5a5cc03 *Handler.php:
- set $db_table and $id_field in the class, not inside initStruct()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1483 a1433add-5e2c-0410-b055-b7f2511e0802
2013-06-23 15:04:05 +00:00
Christian Boltz
b5aeb5a0a6 MailboxHandler:
- fix 'goto' handling
  https://sourceforge.net/p/postfixadmin/bugs/292/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1476 a1433add-5e2c-0410-b055-b7f2511e0802
2013-06-10 22:18:53 +00:00
Christian Boltz
21494f2a14 Config.php:
- add intbool() - similar to bool(), but returns 1/0 instead of true/false

DomainHandler.php
- initStruct(): use Config::intbool() instead of boolconf()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1473 a1433add-5e2c-0410-b055-b7f2511e0802
2013-06-06 20:47:28 +00:00
Christian Boltz
68ae542817 AliasHandler:
- use Config::bool() instead of boolconf()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1472 a1433add-5e2c-0410-b055-b7f2511e0802
2013-06-06 20:40:54 +00:00