Commit Graph

138 Commits (c53400ec5f4bc64b20a879c14c14279cf4b39d1c)

Author SHA1 Message Date
Christian Boltz c53400ec5f MailboxHandler.php:
- validate_new_id(): store error message in 
  $this->errormsg[$this->id_field] instead of $this->errormsg[]
- beforestore(): use first array key instead of [0] to match the
  change in validate_new_id()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1461 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz ea7036ae62 AliasdomainHandler:
- delete(): return error message if db_delete fails


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1460 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 2d127bdec8 AliasHandler:
- validate_new_id(): store errormessages in 
  $this->errormsg[$this->id_field] instead of $this->errormsg[]


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1459 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 61dfcb9192 AdminHandler.php:
- implement delete()   (untested!)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1456 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 871bcbbe2f functions.inc.php:
- check_domain(), check_email(): instead of calling flash_error(),
  return string with error message - or empty string if everything is ok

model/AdminHandler.php, model/AliasHandler.php,
model/DomainHandler.php, model/MailboxHandler.php,
sendmail.php, users/edit-alias.php:
- adopt to changed check_domain() and check_email() return value


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1451 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz f92a32eae1 PFAHandler.php:
- initStruct(): add some comments
- add calledBy() and protected $called_by - calledBy() should be called if one 
  *Handler class calls another one (to avoid loops etc.)

AliasHandler.php:
- replace $called_by_MailboxHandler / MailboxAliasConfig() with $called_by
  (code moved to PFAHandler->calledBy())

MailboxHandler.php:
- beforestore(): update alias active status on edit
  (contains some whitespace changes - basically I removed "if ($this->new)"
  around most parts of the code)
- use calledBy() instead of MailboxAliasConfig()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1449 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz 1e0225e2c2 model/CliEdit.php:
- help(): generate help output based on $handler->struct
  It shows all available options/fields, but might need some finetuning
  to look better



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1441 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz f240e20831 model/CliEdit.php:
- add __handle_params() to implement non-interactive mode. It
  reads, checks and handles the various --* commandline parameters
- __handle():
  - replace $this->error() calls with $this->err()
  - add missing return on failure



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1440 a1433add-5e2c-0410-b055-b7f2511e0802
11 years ago
Christian Boltz be84a8b8fc MailboxHandler:
- _field_password(): return true if checks are successful
  (without this, an empty password might have ended up in the database!)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1438 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz eafc2b6222 model/CliEdit.php:
- new class for CLI add and edit
- based on AddTask, but big parts of __interactive()) are rewritten to:
  - use $struct for the user interface (which means it will automatically 
    adopt to changes in the *Handler classes)
  - check all entered data instantly. If an invalid value was entered,
    ask again to give the user a chance to enter valid data.
- CliEdit already replaces all AddTask classes (interactive mode works, 
  commandline parameter mode not implementated yet)
- will also replace all EditTask classes in the future

scripts/shells/shell.php
- loadTasks(): for add, use new CliEdit instead of AddTask class
- in():
  - print additional empty line if $prompt is not empty
  - print error message when invalid option is chosen
  - always return raw $in to avoid '0' vs. ''. vs NULL problems



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1437 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz b878f18dcc MailboxHandler:
- _missing_local_part(), _missing_domain(): remove broken if condition


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1436 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 13f89e339b MailboxHandler.php:
- add _field_password():
  - compare password / password2 field (error message will be displayed 
    at password2 field)
  - autogenerate password if enabled in config and $new
  - display password on $new if enabled in config or autogenerated

This means MailboxHandler now has all needed features to replace 
create-mailbox.php :-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1432 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 227eca6faf PFAHandler.php:
- introduce public array $infomsg[] (for success messages)
- store(): write successmessage to $this->infomsg[]

edit.php:
- display $handler->infomsg instead of hardcoded success message

AdminHandler.php, AliasHandler.php, AliasdomainHandler.php,
DomainHandler.php, MailboxHandler.php:
- move successmsg from webformConfig() to initMsg()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1428 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 5a8ee27af3 displaying the available quota on $new is harder than it looks...
edit.php:
- call $handler->prefill for all prefill fields
- refresh $form_fields after handling prefill fields

model/PFAHandler.php:
- add prefill() to handle prefill fields. If $this->_prefill_$field()
  exists, it will be called

model/MailboxHandler.php:
- init(): error out early if parent::init fails (no need to check the
  available quota if $this->id is invalid ;-)
- move updating the allowed quota to updateMaxquota()
- update the available quota based on the prefill domain. If no prefill
  domain is given, default to the first domain.
- new method _prefill_domain()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1426 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz fad18fc953 MailboxHandler.php: add (nearly) everything for creating a mailbox
(TODO: generating random passwords - when this is done, MailboxHandler
can replace create-mailbox.php)

- initStruct(): 
  - make 'username' a 'mail' field (doesn't really change anything at
    the moment)
  - make 'maildir' editable on $new
- init(): minor cleanup
- validate_new_id(): error out early if check_email() fails
- beforestore(): 
  - convert quota from MB to bytes - previously in setmore()
  - on $new, create mailbox alias
- storemore(): run mailbox_postcreation(), send_welcome_mail() and
  create_mailbox_subfolders() on $new
- add send_welcome_mail()
- _field_quota(): return true on success (otherwise it's interpreted 
  as invalid value)
- add _missing_local_part(), _missing_domain() and _missing_maildir()
  to fill those fields on $new
- remove add() because all the code moved to the functions mentioned 
  above. 
  Known regression: this breaks CLI create mailbox for now



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1425 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 5388bcf4cd AliasHandler.php:
- add MailboxAliasConfig() and $called_by_MailboxHandler for special
  handling if called by MailboxHandler
- create_allowed(): always allow creating an alias for a mailbox
- remove _missing_on_vacation() and _missing_active() which returned the
  default from $this->struct. This is now done by default, see previous
  change in PFAHandler



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1424 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 28f59d8305 PFAHandler.php:
- set(): if a field is not set and there's no _missing_$field() method
  for it, take default value from $this->struct
  (side effect: this automagically fixes CLI create domain)
- store(): add a beforestore() hook that is called at the beginning of
  store()
- add empty beforestore() (will be overwritten by MailboxHandler)
- some comment updates


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1423 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz a46bcc955c edit.php:
- prefill all $formconf['prefill'] fields from URL parameters (typically
  used for the domain)

model/AliasdomainHandler.php:
- allow to prefill alias_domain and target_domain from URL parameters
 
model/AliasHandler.php:
- allow to prefill domain from URL parameters
- some whitespace changes
- add storemore() with a TODO note

model/MailboxHandler.php:
- allow to prefill domain from URL parameters
- some whitespace changes
- add some TODO notes



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1422 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz fd7b02c870 MailboxHandler.php:
add everything for editing a mailbox

Details:
- include 'maildir' in "display in list" for now (not really
  needed/wanted in listview, but needed for the postedit hook)
- display max. allowed quota in quota field description (via init())
- add read_from_db_postprocess() - convert quota to MB and store the 
  original value in 'quotabytes'
- add setmore() - convert quota from MB to bytes
- add storemore() - call mailbox_postedit()
- add _field_quota() - quota validation


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1415 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz d17fb42cde AdminHandler.php:
- initStruct():
  - pgsql doesn't support group_concat, so we need a database-dependent
    query to list the domains :-/
  - change some "..." to '...' to make them pgsql-compatible


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1393 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 232cee9d5f PFAHandler:
- make PFAHandler an "abstract class"
- add functions that must be implemented by every *Handler class
  as abstract functions:
  - abstract protected function initStruct();
  - abstract protected function initMsg();
  - abstract public function webformConfig();
  - abstract protected function validate_new_id();
- lots of additional comments

AdminHandler, AliasdomainHandler, DomainHandler, MailboxHandler:
- remove comments that are now in PFAHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1385 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 4bb441d45d PFAHandler:
- mark _inp_* functions as protected


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1384 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz e36c3e2a23 PFAHandler.php:
- add lots of comments
- sort variables into categories
  - public variables (currently only errorMsg)
  - must be defined in *Handler classes
  - set by methods
- (no "real" code changes)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1383 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz ca8c27ae93 AliasHandler.php:
- initStruct(): add 'editable' virtual field
- add various comments

AdminHandler.php:
- add some comments


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1382 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
David Goodwin ef80736445 Merge jan-kruis's vacation interval reply behaviour - see SF patch 3508083 - https://sourceforge.net/tracker/?func=detail&aid=3508083&group_id=191583&atid=937966 ; Thank you
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1373 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 2e503a3867 MailboxHandler.php:
- initStruct() / $struct:
  - add various labels
  - make local_part and domain editable on $new
  - fill domain option list with allowed_domains
  - add 'welcome_mail' (bool, not in database) for $new
- webformConfig(): 
  - change $struct to display localpart + domain instead of username on $new
  - disable early_init (not needed for mailboxes)
- add function mergeId()
- add function _field_password2 (to compare password/password2)
- drop deprecated function change_pass()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1367 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz b58d398cf2 AdminHandler:
- initStruct(): add explanation what "superadmin" means
  https://sourceforge.net/tracker/?func=detail&aid=1865123&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1366 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz db8c2df6bc PFAHandler:
- set(): call $this->_missing_$fieldname() if a field is not set on $new
- new function set_default_value() - typically called from
  _missing_$fieldname to set the default from $struct

AliasHandler:
- set default values on $new:
  - on_vacation and active from $struct default
  - localpart and domain based on address

scripts/shells/alias.php:
- convert AddTask to *Handler syntax. It was broken before, see
  https://sourceforge.net/tracker/?func=detail&aid=3232719&group_id=191583&atid=937964 



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1364 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 306c5a9688 PFAHandler:
- add function compare_password_fields() - compares if two fields contain
  the same password (based on _field_password2() from AdminHandler)
  and use pEdit_mailbox_password_text_error as error message because it
  doesn't contain "... or empty"

AdminHandler:
- replace _field_password2() with a call to $this->compare_password_fields()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1361 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 56a8d1c52f MailboxHandler:
- start rewrite based on PFAHandler
- add initStruct(), initMsg(), webformConfig(), validate_new_id(), 
  create_allowed()
- drop old __construct() and view()
- replace $this->username with $this->id
- replace check of old password in change_pw() with $this->login 
 
users/password.php:
- adopt to *Handler syntax

scripts/shells/mailbox.php:
- adopt to *Handler view() syntax
- add TODO - maildir column isn't displayed
  
xmlrpc.php:
- adopt to *Handler syntax

Note: as usual, the changes in xmlrpc.php are untested ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1360 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 19c6748988 VacationHandler:
- move getVacationAlias to AliasHandler (the only code that uses it)

AliasHandler:
- insert (and rewrite) function getVacationAlias()
- change $vh->getVacationAlias() calls to $this->getVacationAlias.
  This also means we don't need to call VacationHandler anymore to get
  the vacation alias.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1359 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz e9d8fa1ff9 remove obsolete functions from AliasHandler (part 2/2)
AliasHandler.php:
- remove obsolete functions update(), is_mailbox_alias(), 
  is_vacation_address(), hasAliasRecord()
- updated delete() to use new *Handler syntax (most of it should be
  moved to PFAHandler, but that's another story ;-)

users/edit-alias.php:
- replace $ah->update with $ah->set / $ah->store
- use 0/1 for $fForward_and_store instead of YES/NO
- use safepost instead of isset()

templates/users_edit-alias.tpl:
- use 0/1 for $fForward_and_store instead of YES/NO

xmlrpc.php:
- replace $ah->update with new *Handler syntax

Note: the changes in xmlrpc.php are untested again ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1358 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz fff6654634 AliasHandler:
- remove deprecated functions get() and hasStoreAndForward()

scripts/shells/alias.php:
- ViewTask: switch to *Handler syntax
- ViewTask: display is_mailbox, goto_mailbox and on_vacation status

users/edit-alias.php:
- replace $ah->get() and $ah->hasStoreAndForward() with *Handler syntax
- remove outdated comment in header

xmlrpc.php:
- switch get() and hasStoreAndForward() to *Handler syntax

Note: the changes in xmlrpc.php are untested!


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1357 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz e4d5d4574e VacationHandler:
- use new *Handler syntax to add/remove vacation alias
  (implemented as function updateAlias() to avoid code duplication)

AliasHandler:
- setmore(): only use $oldvalues if no new on_vacation value is given
- setmore(): fix "undefined index" warning

edit.php:
- only set $values if a field is editable and displayed in the form
- do not set default values in $values
  (without those changes, the vacation alias was always removed when
  editing an alias)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1356 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz b99adf6237 PFAHandler:
- add support for LIMIT/OFFSET to getList()

AliasHandler:
- overload getList() to only return non-mailbox aliases


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1353 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 50c7044f72 AliasHandler:
- if the alias points to the mailbox, don't display the "empty goto" 
  error message


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1351 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz cb0cf81b5a AliasHandler:
- add handling for $CONF[alias_control_admin] in init()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1349 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 9b2da37d84 AliasHandler:
- setmore(): keep/(re-)add vacation and mailbox alias to goto
- hide 'goto_mailbox' if the alias does not belong to a mailbox
  (done in initStruct for $new, otherwise in init())

edit.php:
- set $form_fields and $id_field later (after $hander->init()) - needed
  for AliasHandler to decide if goto_mailbox should be displayed

With this commit, AliasHandler is feature-complete for usage with 
edit.php. We even get a "deliver to local mailbox" checkbox :-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1348 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz e66bb02b84 AliasHandler.php:
- $struct: add is_mailbox (does the alias belong to a mailbox?)
- $struct: add goto_mailbox (if the alias is a mailbox, does it point 
  to the mailbox or is it forward-only?)
- set goto_mailbox in read_from_db_postprocess()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1347 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 3fc6c84e13 AliasHandler.php:
- initStruct(): add 'on_vacation'
- read_from_db_postprocess(): split off vacation alias from $goto
  and store vacation status in on_vacation (honors the vacation alias
  only, not the details from the vacation table)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1344 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 088fef9bdb AliasHandler.php:
- override init() - change '*@domain' -> '@domain', then call parent::init()
- validate_new_id(): allow catchall ('@domain'), check only domain in this case
- create_allowed(): copy of check_alias() from functions.inc.php, with 
  superfluous { ... } removed
- remove forgotten debugging from mergeId()
- _field_goto(): 
  - allow '@domain' targets (domain-wide forward)
  - use an array to collect error messages - that avoids 'uninitialized'
    warnings and allows to easily change the join() glue if needed

Overall status:
- create-alias is now fully supported
- handling of vacation and mailbox aliases is still on my TODO list, which
  means we still need edit-alias for now


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1316 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz d39a802d00 AliasHandler now works with edit.php in many cases
(TODO: catchall handling, mailbox and vacation aliases)

AliasHandler.php
- drop unused $username
- set $domain_field
- initStruct():
  - use correct labels
  - set 'domain' field options to allowed domains
  - add (virtual) 'localpart' field
  - add comments for more virtual fields
- add webformConfig() (note: modifies $struct on $new - otherwise we 
  couldn't use the domain dropdown in the web interface)
- add mergeId to merge localpart and domain to address (called by 
  edit.php _before_ ->init)
- add validate_new_id() (doesn't work for catchall yet)
- add setmore() to 
  - fill 'domain' based on 'address'
  - convert $values[goto] from array to comma-separated string
- add read_from_db_postprocess to split goto to an array
  (TODO: handling of mailbox and vacation aliases)
- add _field_goto() validator
- add empty, commented dummy delete() that will replace the "old" 
  delete function one day
- make hasAliasRecord() private (only used internally)
- mark all "old" functions as obsolete

edit.php:
- add handling of txtl field (convert textarea to array)
- call $handler->mergeId if $id_field is editable, but not displayed 
  in form (usecase: merge localpart + domain to address)

editform.tpl:
- add handling of txtl fields (textarea, filled by array)

PFAHandler.php:
- add setmore() hook function - runs at the end of set()

AdminHandler.php:
- add a comment for 'txtl' (array of one line texts, like alias goto)




git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1311 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz da9a69dd0d AliasHandler.php:
- add initStruct() (not the final version, but works for now)
- add initMsg()
- replace $this->username with $this->id everywhere
- drop __construct() - default __construct will be used now

users/edit-alias.php, xmlrpc.php, VacationHandler.php, scripts/shells/alias.php:
- use default init sequence for AliasHandler (new, then ->init())


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1310 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz b8812686aa AliasdomainHandler.php, PFAHandler.php:
- move empty storemore() function from AliasdomainHandler to PFAHandler



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1309 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 18b8564b64 Make $struct in the *Handler classes customizeable
config.inc.php:
- add $CONF['*_struct_hook'] to modify $struct in the *Handler classes

PFAHandler.php:
- call $CONF['*_struct_hook'] hook

AdminHandler.php, AliasdomainHandler.php, DomainHandler.php:
- remove now outdated TODO notes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1303 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 6eb7e9f794 PFAHandler.php:
- encrypt passwords ("pass" fields) with pacrypt()

AdminHandler.php:
- update/remove various TODO notes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1302 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz ee33647232 setup.php
- add rewritten function create_admin() (now using AdminHandler, 
  which means 25 instead of 80 lines)
- various follow-up changes to match the rewritten function create_admin()

functions.inc.php:
- delete function create_admin() - setup.php was the last file calling it
- honor POSTFIXADMIN_SETUP in authentification_get_username() to avoid
  a redirect to login.php after creating an admin with setup.php and to
  get "SETUP.PHP" for db_log()

model/AdminHandler.php:
- add TODO: implement generate_password


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1301 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 23c08bc02e PFAHandler.php:
- store unchecked input values given to set() in $this->RAWvalues before
  running the validation functions. This is needed to make comparing 
  password and password2 possible.
  (uppercase RAW intentional to make usage harder - hopefully hard enough
  to give everybody who wants to use it some time to think over secure
  programming when working with unchecked input ;-)

AdminHandler.php:
- compare password and password2

This commit means AdminHandler is complete :-)

(Note: db_log can't handle the admin-related log actions yet.)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1297 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 3a8a738585 PFAHandler.php:
- fix field type for skipping password fields (must be 'pass', not 'password')
- implement validation of 'pass' fields with validate_password()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1293 a1433add-5e2c-0410-b055-b7f2511e0802
13 years ago
Christian Boltz 300f096025 AdminHandler.php:
- add empty no_domain_field() to disable default die() from PFAHandler
- $struct: 
  - changed 'superadmin' to normal bool field (+ TODO note)
  - changed 'password2' to be an alias of password in SELECT
  - init 'domains' default with array() and options with list_domains(),
- storemore():
  - implement storing domains in domain_admins table
  - implement storing ALL in domain_admins table for superadmins to 
    keep the database backwards-compatible with 2.3.x for now
- add read_from_db_postprocess() to convert the domains list to an array

This makes AdminHandler working with edit.php?table=admin
(Some fine-tuning at various places/files is still missing.)


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