- 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
- change list_admins() to use AdminHandler (code from list-admin.php)
Note: this changes the return value format to include all details,
not only the usernames. Use array_keys(list_admins()) if you need
the previous return format.
list-admin.php:
- replace code with a list_admins() call
list-domain.php:
- adopt to new list_admins() return value
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1386 a1433add-5e2c-0410-b055-b7f2511e0802
- 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
Based on a patch from W. Rossmann (W. Rossmann@SF),
https://sourceforge.net/tracker/index.php?func=detail&aid=2974928&group_id=191583&atid=937966
with some modifications, cleanup and adoptions to trunk (especially templates)
config.inc.php:
- new config option $CONF['domain_quota'] to enable/disable domain-level
quota (default: enabled)
- new config option $CONF['domain_quota_default'] (default: 2 GB)
functions.inc.php - check_quota():
- add code to check the quota sum on a domain
- add optional parameter $username (to exclude that username from quota
calculation, used by edit-mailbox)
edit-domain.php, create-domain.php,
admin_edit-domain.tpl, admin_create-domain.tpl:
- add input field and handling for domain-level quota
list-domain.php, overview-get.tpl, adminlistdomain.tpl:
- display allocated and allowed domain quota
- beautify quota and max_quota fields - display "unlimited" instead of "-1"
edit-mailbox.php:
- hand over username to check_quota()
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1042 a1433add-5e2c-0410-b055-b7f2511e0802
- hand over $search to smarty templates
templates/list-virtual_alias.tpl, templates/list-virtual_alias_domain.tpl:
- add search result highlighting
templates/list-virtual_mailbox.tpl:
- add search result highlighting
- move output of "Mailbox" / "Forward only" outside the foreach loop
(was displayed once per mailbox alias target)
css/default.css:
- add style for ".searchresult"
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@868 a1433add-5e2c-0410-b055-b7f2511e0802
- replace get_domain_properties() calls with two SQL queries that fetch
the domain data and count the number of mailboxes and aliases per domain.
This change speeds up list-domain extremely on setups with lots of domains,
mailboxes and aliases. The old code took several minutes on my test data
(that's about 55000 mailboxes and their aliases), the new code only needs
some seconds.
- $domain_properties now uses the domain name as index key instead of a
serial number
templates/admin_list-domain.php:
- replace usage of $list_domains with $domain_properties
- change main loop to use the domain name as $domain_properties array key
instead of a serial number
upgrade.php:
- upgrade_655(): add index on domain column in mailbox and alias table.
This speeds up list-domain from 14s to about 1s on my test data in MySQL
(the 14s were _after_ the changes in list_domain.php)
- added _add_index() function to hide the database specific details in
upgrade functions
This commit should fix the performance problems reported on
http://sourceforge.net/forum/forum.php?thread_id=2343349&forum_id=676076
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@655 a1433add-5e2c-0410-b055-b7f2511e0802
list-domain.php:
- added several admin/superadmin switches and permission checks
- merged GET and POST code
- Note: still different templates for superadmins (admin_list-domain.tpl)
and admins (overview-get.tpl) because of large layout difference
list-virtual.php:
- added several admin/superadmin switches and permission checks
- added check for admins without any domains (redirects to domain list,
which can handle this situation)
- migrated FIXME from overview.php
-> David, please review the query and remove the FIXME afterwards
overview.php:
- DELETED - no longer needed
overview.tpl:
- RENAMED overview.tpl to list-virtual.tpl
- removed admin/superadmin filename switch
- removed $incpath switch for images
menu.tpl:
- menu for domain admins now has "domain list" and "virtual list"
instead of "overview"
delete.php, edit-active.php, edit-alias.php, edit-mailbox.php, search.php:
- changed redirect to list-virtual.php
overview-get.tpl:
- changed link to list-virtual.php
main.tpl:
- changed overview link to list-domain.php
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@181 a1433add-5e2c-0410-b055-b7f2511e0802
- moved admin-only scripts from admin/ to /
- removed all merged files ("require('../$file')") from admin/
- changed include paths - no more admin/superadmin switching needed
- admin_menu.tpl is also gone
- removed all menu.tpl / admin_menu.tpl switches - no more needed
- admin/index.php still exists and redirects to /
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@168 a1433add-5e2c-0410-b055-b7f2511e0802