- 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
- 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
- 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
(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
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
- 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
- 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
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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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