0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-20 03:36:20 +02:00
Commit Graph

236 Commits

Author SHA1 Message Date
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