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

82 Commits

Author SHA1 Message Date
David Goodwin
f01274ec94
try relaxing composer dependencies to allow php8.2 dev support, reformat so composer format passes 2024-04-22 21:02:01 +01:00
David Goodwin
2d6ded2786 PSR2 -> PSR12 formatting 2022-06-28 13:46:11 +01:00
Sven Strickroth
74a12b4f0c Add support for domain_postedit_script
Signed-off-by: Sven Strickroth <email@cs-ware.de>
2021-05-08 18:27:44 +02:00
David Goodwin
2edabc3e03 phpcs insists on some brace changes 2021-04-13 21:19:16 +01:00
David Goodwin
823f27b29d phpcs wants to change ... 2021-03-22 09:28:28 +00: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
e8f27969a3 psalm fixes 2020-06-21 16:44:43 +01: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
Christian Boltz
bee61f329b
Only show password expiration if enabled in config 2020-02-12 17:12:19 +01:00
David Goodwin
87824ef970 psalm fixes/workarounds; require PHP 5.6+ 2019-10-19 20:51:05 +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
74002bbf57 psalm fixes 2018-12-27 21:43:11 +00: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
Christian Boltz
d2588a4de2
Fix phpcs whitespace breakage in initStruct etc. 2018-04-22 18:24:41 +02:00
Adrien Crivelli
15df6c1d7b
Reformat everything with PHP-Cs-Fixer 2018-01-26 23:54:37 +09: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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
871bcbbe2f functions.inc.php:
- check_domain(), check_email(): instead of calling flash_error(),
  return string with error message - or empty string if everything is ok

model/AdminHandler.php, model/AliasHandler.php,
model/DomainHandler.php, model/MailboxHandler.php,
sendmail.php, users/edit-alias.php:
- adopt to changed check_domain() and check_email() return value


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1451 a1433add-5e2c-0410-b055-b7f2511e0802
2013-04-01 21:22:30 +00:00
Christian Boltz
227eca6faf PFAHandler.php:
- introduce public array $infomsg[] (for success messages)
- store(): write successmessage to $this->infomsg[]

edit.php:
- display $handler->infomsg instead of hardcoded success message

AdminHandler.php, AliasHandler.php, AliasdomainHandler.php,
DomainHandler.php, MailboxHandler.php:
- move successmsg from webformConfig() to initMsg()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1428 a1433add-5e2c-0410-b055-b7f2511e0802
2013-02-16 20:42:17 +00:00
Christian Boltz
232cee9d5f PFAHandler:
- make PFAHandler an "abstract class"
- add functions that must be implemented by every *Handler class
  as abstract functions:
  - abstract protected function initStruct();
  - abstract protected function initMsg();
  - abstract public function webformConfig();
  - abstract protected function validate_new_id();
- lots of additional comments

AdminHandler, AliasdomainHandler, DomainHandler, MailboxHandler:
- remove comments that are now in PFAHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1385 a1433add-5e2c-0410-b055-b7f2511e0802
2012-05-06 20:01:32 +00:00
Christian Boltz
18b8564b64 Make $struct in the *Handler classes customizeable
config.inc.php:
- add $CONF['*_struct_hook'] to modify $struct in the *Handler classes

PFAHandler.php:
- call $CONF['*_struct_hook'] hook

AdminHandler.php, AliasdomainHandler.php, DomainHandler.php:
- remove now outdated TODO notes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1303 a1433add-5e2c-0410-b055-b7f2511e0802
2011-12-20 23:07:34 +00:00
Christian Boltz
8f267c1b7f Use edit.php to create/edit domains
model/DomainHandler.php:
- add webformConfig()

configs/menu.conf:
- change url_edit_domain to edit.php?table=domain
- drop url_create_domain (use url_edit_domain instead)

templates/*:
- replace #url_create_domain# with #url_edit_domain#
- replace ? with &

create-domain.php:
- deleted :-)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1276 a1433add-5e2c-0410-b055-b7f2511e0802
2011-11-13 22:59:21 +00:00
Christian Boltz
a0e59f82b9 model/DomainHandler.php:
- set $domain_field to enable domain permission handling

list-domain.php:
- use permission handling of DomainHandler. This means:
  - no need to call list_domains_for_admin() 
  - no longer hand over SQL sniplets
  - much easier handling for superadmins and "simulate admin" mode
  - 14 lines less code for permission handling etc.
- remove superfluous/outdated header comments
- move $smarty_assign('select_options') to global section (it's the
  same code for domain admins and superadmins)

Note: don't try to read the diff of list-domain.php.
Read the complete file instead ;-)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1267 a1433add-5e2c-0410-b055-b7f2511e0802
2011-11-12 22:01:45 +00:00
Christian Boltz
161c9b1ed2 scripts/shells/domain.php:
- AddTask:
  - use $values[$field] instead of a short variable name for input
  - hand over $values array to __handle as array instead of dozens of variables
- ViewTask: use $struct for printing the output

model/DomainHandler.php:
- use 'created' as label for created



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1259 a1433add-5e2c-0410-b055-b7f2511e0802
2011-10-31 20:57:43 +00:00
Christian Boltz
8dda511cd5 scripts/shells/domain.php / AddTask:
- read transport options from $handler->getStruct
  (instead of $handler->getTransports())
- convert selected transport to to transport name directly
  (instead of using $handler->getTransport)

model/DomainHandler.php:
- init_struct: read transport options with Conf::read directly
  (instead of using $this->getTransports()
- delete no longer used functions getTransports() and getTransport()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1256 a1433add-5e2c-0410-b055-b7f2511e0802
2011-10-30 21:25:57 +00:00
Christian Boltz
ae52f243e5 PFAHandler.php, DomainHandler.php:
- move definition of public and protected variables to DomainHandler.php
- move lots of functions from DomainHandler.php to PFAHandler.php:
  - __construct()
  - init()
  - set()
  - store()
  - read_from_db()
  - view()
  - getList()
  - getStruct()
  - getId_field()
  All functions and comments were moved without any modification.
  See the history of DomainHandler.php if you need to find out something 
  about the history of the functions listed above.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1254 a1433add-5e2c-0410-b055-b7f2511e0802
2011-10-30 20:58:00 +00:00
Christian Boltz
7a236d401c DomainHandler.php:
- rename $this->username to $this->id
- rename function validate_id() to validate_new_id()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1253 a1433add-5e2c-0410-b055-b7f2511e0802
2011-10-30 20:39:14 +00:00