Commit Graph

1270 Commits (5f94773ae44af083525e5cdf1c2d21e4a9494252)
 

Author SHA1 Message Date
Christian Boltz 41d8bcaf0a upgrade.php:
- upgrade_1284(): migrate the ALL domain to the superadmin column
  Note: The ALL domain is not (yet) deleted to stay backwards-compatible 
  for now (will be done in a later upgrade function)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1284 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 48f2a0a94b upgrade.php
- upgrade_1283(): add a "superadmin" column to the admin table
  This is the first step to get rid of the "ALL" dummy domain.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1283 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 6f9d520262 list-admin.php:
- use AdminHandler
- move displaying the superadmin flag to the template

templates/adminlistadmin.tpl:
- update to the fieldnames provided by AdminHandler (name->username)
- move displaying the superadmin flag to the template

functions.inc.php:
- delete function get_admin_properties() (was only used by list-admin
  and is not needed anymore) -> 48 lines less :-)
- add TODO to list_admins() to use AdminHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1282 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 36e31b9e23 AdminHandler.php (new file):
- Handler for admins
- list mode works
- edit mode not implemented yet


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1281 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz e95dffb55a users/edit-alias.php:
- remove unused $vacation_domain and $vacation_goto


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1280 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 24d9d695ad edit.php:
- whitespace fixes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1279 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz dd21f03616 functions.inc.php - db_log():
- add log action 'edit_alias_domain'
- update outdated comment to point to $action_list instead of 
  maintaining the list as comment _and_ variable

languages/*.lang
- add $PALANG['pViewlog_action_edit_alias_domain']


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1278 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 50590a5eea configs/menu.conf:
- move url_edit_domain to global section to avoid warning
- remove unused _txt_list_domain and [main] section


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1277 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
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
13 years ago
Christian Boltz 9cf7c7799a Use edit.php to edit/create for alias domains
(yes, we get edit mode "for free")

model/AliasdomainHandler.php:
- add webformConfig()

configs/menu.conf:
- change url_create_alias_domain to edit.php?table=aliasdomain

templates/list-virtual_alias_domain.tpl
- change ?target_domain to &target_domain 
  (TODO: this is currently ignored by edit.php)
- add edit link (TODO: add log action to avoid the error message)

create-alias-domain.php:
- deleted :-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1275 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 7ed5f7e471 Several changes to make edit.php a generic edit form
edit.php:
- use ?table= parameter to decide what will be edited
- generate (and validate) Handler classname based on ?table=
- read handler-specific configuration from $handler->webformConfig()
  and use it at various places
- add option to run $handler->init() early. Useful for $new in case
  of AliasdomainHandler which might fail if all domains are already
  aliased.
- always redirect to edit.php?table=$table after adding an item to
  ensure correct initialization for next item

templates/editform.tpl:
- add hidden field "table"


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1274 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz bfd4981433 PFAHandler.php:
- fix view() to use associative array key


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1273 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 0730cdfc6f copy edit-domain.php to edit.php (exact copy, no changes)
edit.php will be used as generic edit page for everything
(admins, domains, mailboxes, aliases, ...)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1272 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 63f20c28da AliasdomainHandler.php - initStruct():
- if only one alias_domain available, filter it out from target_domain list


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1271 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 3f0e77e6ab editform.tpl:
- replace hardcoded $value_transport with {$value_{$key}


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1270 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 06ffffae7d AliasdomainHandler.php:
- set $domain_field to enable permission handling (and to get a list of
  allowed/available domains)
- fill $this->struct['alias_domain']['options'] and 
  $this->struct['target_domain']['options'] with available domains that
  are not yet used as alias domain
- override init() to get "All domains are already aliased" error message
  out as early as possible (and let init() fail in this case)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1269 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 157034d8fe PFAHandler.php:
- read_from_db(): use associative array for database content
  (with $this->id_field as key)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1268 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
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
13 years ago
Christian Boltz 68c79b9013 PFAHandler.php:
allow restriction to an admin's domain permissions

- new protected variables:
  $admin_username  - if set, restrict $allowed_domains to this admin
  $domain_field    - column containing the domain
  $allowed_domains - if $domain_field is set, this is an array with
                     the domain list
- __construct: new optional parameter $admin_username to restrict
  allowed domains to this admin's permissions
- read_from_db(): handle $allowed_domains
- read_from_db(): fix query if $condition == ""

PS: Yes, I know some people would like to kill me for including 
    permission stuff in PFAHandler, but it's the best (and shortest,
    only +20 lines) way to handle it.



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1266 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 410de7229d functions.inc.php - list_domains_for_admin():
- rewrite to work for superadmins also (will list all domains now
  instead of "ALL"), which means we can drop the admin vs. superadmin
  check at various places
- escape_string $username


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1265 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a4e2e9101b functions.inc.php:
- get_admin_properties(): escape_string $username instead of relying on
  the calling code to pre-escape it


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1264 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz e21e843c8d templates/create-alias-domain.tpl:
- use PALANG.pAdminEdit_domain_active instead of 
  PALANG.pCreate_alias_domain_active

languages/*.lang
- mark $PALANG['pCreate_alias_domain_active'] as obsolete



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1263 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz d065179993 create-domain.php, templates/editform.tpl:
- move handling of displaying checkboxes to editform.tpl.
  This means: One switch block less in create-domain.php



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1262 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 398ce70132 model/AliasdomainHandler.php:
- new file
- handler class for alias domains
- completely working (except delete)
- some TODOs included


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1261 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz def9c22fb1 create-domain.php, templates/editform.tpl:
- move special handling for enum fields from PHP select_options() to 
  the template using smarty {html_options}


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1260 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
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
13 years ago
Christian Boltz 4010127bf7 language-update.sh:
- delete *.orig files on cleanup


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1258 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 46a475a75f *.lang:
- new text $PALANG['created'] = 'Created';


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1257 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
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
13 years ago
Christian Boltz e4fc3623cc PFAHandler.php:
- add/update several comments



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1255 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
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
13 years ago
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
13 years ago
Christian Boltz 7ac37cfbff templates/editform.tpl:
- new file
- generic edit form template that uses $struct to render the form

templates/admin_edit-domain.tpl:
- deleted, obsoleted by editform.tpl

create-domain.php
- use new editform.tpl
- use $errormsg array instead of join't $errortext
- store/move errors related to a display_in_form field in $fielderror
  (they will be displayed next to the field)
- display remaining error messages (not related to a field) with 
  flash_error()
- use "value_$key" instead of "t$Key" as smarty variable name for field 
  values

model/DomainHandler.php
- store error messages in $this->errormsg[$field] (instead of $this->errormsg[])
- fix label for default_aliases

model/PFAHandler.php:
- store error messages in $this->errormsg[$field] (instead of $this->errormsg[])



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1252 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 5ba826b067 create-domain.php, templates/admin_edit-domain.tpl:
- move some logic to select the correct labels to create-domain.php



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1251 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 102d4c8c32 DomainHandler.php:
- whitespace fixes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1250 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz eac2564c40 DomainHandler.php:
- initStruct(): fix alias_count ("something - NULL" is always NULL, now 
  enforces integer 0 for each JOINt in field with NULL value)
- set() now checks if $this->_field_$fieldname exists and calls it as
  additional validator
- split store() into store() (stores $this->values in the database) and
  storemore() (stores additional things and/or calls scripts)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1249 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz eba59ffd73 functions.inc.php:
- get_domain_properties(): use DomainHandler (function result mostly 
  unchanged, only difference: instead of quota_sum in bytes it now
  returns total_quota in MB)
- allowed_quota(): adopt to slightly changed return value of
  get_domain_properties()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1248 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a03a020095 MailboxHandler.php:
- delete(): use escaped $E_domain instead of $domain in some queries


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1247 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz ab050cb340 list-virtual.php:
- display everything by default, not only mailboxes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1246 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 55cf795c81 ru.lang:
- translation update by Pavel Usischev (pusischev@SF),
  https://sourceforge.net/tracker/?func=detail&aid=3428382&group_id=191583&atid=937966


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1245 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a8e626fe7f functions.inc.php:
- pacol(): new parameter $dont_write_to_db - needed to skip JOINt in 
  columns which (of course) aren't available on INSERT or UPDATE

model/DomainHandler.php:
- initStruct(): mark JOINt in columns with the dont_write_to_db flag
- store(): skip columns with the dont_write_to_db flag set (not_in_db
  columns are also/still skipped)

In non-technical terms: create-domain works now :-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1244 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 46c7455a12 en.lang:
- changed pVacation_result_removed from 'Auto response for %s has been 
  removed!' to '... has been disabled!'

*.lang:
- add %s in pVacation_result_removed and pVacation_result (+ translator note)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1243 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz a1dba20aff model/DomainHandler:
- read_from_db(): provide a working $colformat['ts'] for postgresql
  _and_ mysql (the only mysql/pgsql-specific code in DomainHandler,
  everything else works with both)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1242 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 3c880aa0c6 if we are going to write out an sql error message we might as well include the full query
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1241 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 5a18a1e48b postgresql fixes for DomainHandler perhaps
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1240 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin ecf7757981 Remove getInstance calls; not needed as we use ::write
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1239 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 25675e9377 use isset to check existance of a variable
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1238 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 89f66053a9 fix undefined var check before login - sessid is not set etc
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1237 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
David Goodwin 563e401c92 make Config.php a php5 compatible object; remove strict standards warnings
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1236 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
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