Commit Graph

15 Commits (da21a4cae2b4458fe661f55a581df94595262255)

Author SHA1 Message Date
Christian Boltz bf2d5e0f4b DomainHandler.php:
- validate $username (domain name in this case) in __construct
  (using the new function validate_id)
- make initStruct protected (was private)
- additional parameter for view() to supress error messages



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1207 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 14c5433faf DomainHandler:
- use ' instead of " for $struct keys
- whitespace changes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1204 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 1e601ce4d4 DomainHandler.php:
various fixes, implemented some TODOs

- move table name into variable $this->db_table
- use correct config option to detect if quota support is enabled
- fix (virtual) column name for default aliases
- use type 'ts' (timestamp) for created and modified
- fill non-editable rows with defaults if $this->new
- read values from $values instead of safepost()
- unset $db_values['default_aliases'] before writing to database
- some other minor changes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1203 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz d09ae9e360 model/DomainHandler.php:
- integrate $defaults in $struct to have everything in one place
- integrate field labels, descriptions etc. in $struct
- $struct now has named keys and is filled with the new pacal() helper function
- replaced TODO comments with new ones ;-)

functions.inc.php:
- new function pacol() to fill $struct with an associative array


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1145 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 9f94438a78 model/DomainHandler.php:
- replace $domain with $this->username in add()
- comment cleanup


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1047 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 19bf885fa9 model/DomainHandler.php:
- allow editing and viewing of "quota" (domain-level quota) field.
  Otherwise the CLI can't set it ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1044 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 562f1ac5b8 model/DomainHandler.php:
- get default domain quota from $CONF
- remove unused from "quota" field - it's used now ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1043 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 721ee60e8d DomainHandler.php:
- convert domain name to lowercase

This is a follow-up to
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=3287965&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1038 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 51262b7675 DomainHander: on the way to a common interface for all classes and
easy-to-edit field lists. With lots of inspiration from fetchmail.php
and a base class I started 2.5 years ago.

model/DomainHandler.php
- base on PFAHandler (see below)
- new protected variables
  - $id_field (column that contains $username)
  - $struct (field list)
  - $defaults (default values, option lists)
  - $new (switch between new and edit mode)
- change $username to protected (preparation for move to PFAHandler)
- add optional $new parameter to __construct. Targets (not yet implemented):
  - early validation of $username (domain name in this case)
  - if $new == 1, check that item does NOT exist and is a valid domain
  - else: check if item exists. error out if not.
- new function initStruct to fill $id_field, $struct, $defaults
- add():
  - use an array as parameter instead of single parameters
    Advantage: this makes it easy to add another field
  - use _inp_* base validation 
  - create default aliases only in create mode, not in edit mode
- view(): fix error message
- added various TODO notes. Some affect design questions - feedback welcome ;-)

scripts/shells/domain.php:
- change $handler->add call to array usage
- add some TODO notes
- some whitespace fixes in execute()

model/PFAHandler.php:
- new base class for *Handler classes
- contains only some generic input validation for now
- more code will be moved from DomainHandler to PFAHandler later


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@978 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 6225e555f4 model/AliasHandler.php:
- fix comment for delete() - it no longer has a param

model/*:
- add svn $Id line


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@975 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz c97e5224dc Remove $username parameter from db_log()
functions.inc.php:
- remove $username parameter from function db_log()
  (now auto-detected with authentication_get_username())

various files:
- remove hardcoded username ('CONSOLE', $username etc.) in db_log() calls


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@966 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 1de551320b DomainHandler.php:
- implement delete()

Note that this is a dummy function at the moment. It doesn't work,
it just errors out with "not implemented yet" ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@961 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 562842f154 DomainHandler.php:
- return true/false instead of shell-style 0/1


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@959 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz d21bf2e82d DomainHandler.php: proofreading results: various small changes
- use $this->username for the domain name (I know the variable name is
  confusing, but I'd like to be consistent with the other classes)
- remove $domain parameter in add() and view(), use $this->username instead
- escape domain in view() for select query
- removed unused "global $config" in view()
- remove superfluous created/modified arrays in db_insert calls
- added some TODO notes
- changed db_log to 'CONSOLE' instead of $this-username for consistency
  with other classes. Long-term fix is to remove the first parameter of
  db_log and let it detect the username automatically.
- various whitespace fixes



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@958 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz fe2d4ba129 moved scripts/models-ext/* to model/
- moved scripts/models-ext/DomainHandler.php to model/
- deleted redirect scripts in scripts/models-ext/ (UserHandler.php, 
  AliasHandler.php)
- changed scripts/common.php to include the files from ../model/


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@925 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago