Commit Graph

31 Commits (ecf7757981b91ae4f5141c67263fd10e41a0ae59)

Author SHA1 Message Date
Christian Boltz 72441d7dd6 create-domain.php:
- assign smarty values only for fields that have the display_in_form flag

model/DomainHandler.php:
- initStruct(): make default_aliases display_in_form dependant on $this->new
  (it's useless in edit mode)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1235 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 2f52a8402d edit-domain.php:
- deleted (obsoleted by create-domain.php)

create-domain.php:
- fixed wrong variable name that broke saving an edited domain

configs/menu.conf, templates/adminlistdomain.tpl
- changed to use create-domain.php?edit= instead of edit-domain?domain=



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1226 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 24836cf3ad Add edit mode to create-domain.php
create-domain.php:
- add edit mode (use ?edit=example.com)
- use $id_field instead of hardcoded 'domain'
- redirect to list-domain after saving in edit mode
- rename some variables

edit-domain.php:
- rename some smarty variables

templates/admin_edit-domain.tpl:
- rename some smarty variables
- add two hidden fields "edit" and "domain", both contain $tDomain
  (only in edit mode)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1225 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 7fd57740cd create-domain.php:
- assign $values to smarty in a foreach loop

edit-domain.php, templates/admin_edit-domain.tpl:
- rename some smarty variables to match column name


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1221 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 95bf0161c6 Make create-domain.php even shorter (109 -> 89 lines) ;-)
create-domain.php
- replace old $form_fields with $handler->getStruct()
- rewrite handling POST data to make it easier to understand
  - move reading POST input to the section handling POST
  - remove condition on POST (we are in the POST block now)
  - check if editing of a field is allowed (use default value if not)
- move validation of 'enum' fields to PFAHandler
- allow changing the "active" state (instead of hardcoding it)

model/PFAHandler.php:
- add check for 'enum' fields

model/DomainHandler.php:
- change default for "active" and "default_aliases" to 1

templates/admin_edit-domain.tpl:
- don't hide the "Active" checkbox on new


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1220 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz f8fb724dcf model/DomainHandler.php:
- split __construct to
  - __construct($new=0) - init $struct etc.   and
  - init($username) - validate $username
  This allows reading of $struct before doing any check on the username,
  and will also avoid problems when I implement a function to list all
  domains
- init(): use direct return values instead of $this->return

scripts/shells/domain.php, create-domain.php
- update to use new DomainHandler->init()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1219 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 5c5c79e8a9 Make create-domain.php shorter (164 -> 109 lines) ;-)
create-domain.php:
- rename "fField" form fields to just "field" to match the column names 
  in the database
- remove list of template and POST variables in the header - the code is
  self-documenting on this, one useless comment block less to maintain ;-)
- rename $default to $field - matches the usage better
- use $values[$key] instead $$key (this also avoids the need to fill
  $values before calling $handler->set)
- remove some validation that is already done in DomainHandler
- use $handler->set even if creating $handler results in an error to
  make error messages for all fields visible
- set $values to defaults at the end of the file if $error == 0 (and
  use a foreach loop) instead of doing it for GET at the beginning and
  again after successful POST
- remove some unused variables
- various other changes

edit-domain.php, templates/admin_edit-domain.tpl:
- rename "fField" form fields to just "field" to match the column names 
  in the database



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1218 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a11d8c3dda Sometimes short commit messages are the best ones - see the message
for create-domain.php...

create-domain.php:
- finally: use DomainHandler :-))

edit-domain.php, create-domain.php, 
templates/admin_edit-domain.tpl:
- use 0/1 instead of off/on for checkboxes



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1217 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 6c35590eb7 Merge admin_edit-domain.tpl and admin_create-domain.tpl
admin_edit-domain.tpl:
- merged with admin_create-domain.tpl
- added various {if $mode = ...}
- added 4th column for error messages

admin_create-domain.tpl:
- deleted

edit-domain.php:
- added mode = edit smarty variable
- added pAdminCreate_domain_domain_text_error smarty variable to avoid
  "undefined variable" warning

create-domain.php
- added mode = create smarty variable
- switch to admin_edit-domain template


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1152 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 27caea6ca8 create-domain.php:
- default aliases were always created, even when unchecking the checkbox
  (to be exact: after my last commit yesterday, they were never created)
  This bug was introduced in r867 (setting the default to "on") in
  combination with isset() falling back to the default value. For an
  unchecked checkbox, this means that it always used the default fallback
  which was "on" since r867.
  (Does _not_ affect the 2.3 branch.)
- replaced two <br> with a TODO ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1135 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 93676dd7fc variables.inc.php:
- moved some variables from variables.inc.php to the (only) file that
  uses them
- removed unused $escaped_string

create-domain.php
- target for $fDefaultaliases and $tDefaultaliases

list-virtual.php
- target for $tDisplay_back, $tDisplay_back_show, $tDisplay_up_show,
  $tDisplay_next, $tDisplay_next_show


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1134 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 12694a420f create-domain.php:
- renamed $pAdminCreate_domain_domain_text to $pAdminCreate_domain_domain_text_error 
- replaced $tMessage with flash_error(), flash_info() and 
  $pAdminCreate_domain_domain_text_error 
- differences to Dale's patch:
  - removed now always empty smarty->assign for $pAdminCreate_domain_domain_text

templates/admin_create-domain.tpl:
- added 4th column for error messages
- marked labels as <label>
- aligned button to input fields
- removed tMessage
- differences to Dale's patch:
  - removed now unused $pAdminCreate_domain_domain_text

variables.inc.php:
- removed now unused $pAdminCreate_domain_domain_text
  (this was not part of Dale's patch)

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1102 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz af6a1b6626 Add support for domain-level quota (total quota for a domain)
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
14 years ago
Christian Boltz d94b4a6a95 create-domain.php:
- force domain name to lowercase to avoid problems with PgSQL foreign keys

Reported by Munroe Sollog (roe1234@SF),
https://sourceforge.net/tracker/?func=detail&aid=3287965&group_id=191583&atid=937964
after some bughunting on #postfixadmin



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1037 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 4c912f1da8 list-virtual.php:
- 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
14 years ago
Sebastian 9ddf15439f - fix some display errors after rev. 788, found and patch supplied by Jan-Kruis, thx.
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@791 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Sebastian b1287d97e2 - big merge of Postfixadmin smarty into trunk
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@757 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
Christian Boltz 773d97bca2 create-domain.php:
- fix pgsql error "Invalid query: ERROR: column "f" does not exist" by adding quotes
  (reported by Zelut in IRC)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@705 a1433add-5e2c-0410-b055-b7f2511e0802
15 years ago
David Goodwin f59423c8d6 create-domain.php: if the user makes a domain a backup mx, then accept whatever they type in for mailboxes/aliases
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@569 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
Christian Boltz 12c4c45416 create-domain.php:
- fixed "undefined variable $tBackupmx" on POST
- fixed vim: line - create-domain.php already uses 4 spaces per tab


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@565 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
David Goodwin 72676b0af9 do not use empty as it thinks the string 0 is empty...
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@542 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
David Goodwin 723090d6d0 add patch for domain postcreation script; see https://sourceforge.net/tracker/index.php?func=detail&aid=2508593&group_id=191583&atid=937966
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@516 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
David Goodwin 514d2df060 create-domain.php: try and remove code duplication, expand use of $form_fields (defaults etc); only allow valid transport values through
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@502 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
David Goodwin f82147a268 create-domain.php: reindent; applied patch from http://sourceforge.net/tracker/?func=detail&atid=937964&aid=2143861&group_id=191583 - thanks fabiobon - this enables the $CONF[transport] parameter again
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@463 a1433add-5e2c-0410-b055-b7f2511e0802
16 years ago
Christian Boltz 3e5549bfad functions.inc.php:
- move DNS checks from check_email() to check_domain()
- add clear error message on non-resolvable domains (using flash_error() -
  this is probably not the best solution, but better than nothing)
- made error messages translatable

create-domain.php:
- avoid duplicated call to check_domain (to avoid duplicated error message)
- domains are now DNS-checked on creation - see the changes in check_domain()
  in functions.inc.php

languages/*:
- added error messages for the above changes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@429 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
Christian Boltz d39d7b44aa create-domain.php:
- partly undo last change (r273) - $fBackupmx is not used in the SQL query, 
  but in the template file
- keep usage of db_get_boolean() for $sqlBackupmx


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@274 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
Christian Boltz eb1ddd2a80 create-domain.php:
- make $fBackupmx pgsql-compatible (using db_get_boolean())
  Thanks to Micheas Herman (micheas)
  https://sourceforge.net/tracker/?func=detail&atid=937966&aid=1858922&group_id=191583
- also use db_get_boolean() for $sqlBackupmx - that's better than 
  checking for pgsql explicitely


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@273 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
David Goodwin 39953d029d rename templates to .php instead of .tpl
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@250 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
David Goodwin 9af76e13e4 create-domain.php: fix for bug 1831720
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@224 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
David Goodwin f1321de6b4 create-domain.php: fix for bug 1831720
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@223 a1433add-5e2c-0410-b055-b7f2511e0802
17 years ago
Christian Boltz 1132b958e5 Finally got rid of admin/ :-)
- 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
17 years ago