Commit Graph

1270 Commits (5f94773ae44af083525e5cdf1c2d21e4a9494252)
 

Author SHA1 Message Date
Christian Boltz b2026a4bb1 README.Debian:
- add "Integration with Postfix, Dovecot etc." section
  (mostly copied from INSTALL.TXT)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1409 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz d136b5d466 shells/mailbox.php / AddTask:
- move counting params into if (!empty($this->args[0])) block
  (the previous commit broke interactive mode)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1408 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz c3cc667caf scripts/shells/mailbox.php:
- update add, delete and password tasks to use new MailboxHandler syntax
- (roughly) check number of cmdline arguments for add

Reported by mkathuria at
http://sourceforge.net/projects/postfixadmin/forums/forum/676076/topic/5396581


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1407 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 299cde311d config.inc.php:
- changed some defaults as discussed on the mailinglist:
  - $CONF['database_type'] = 'mysqli';
  - $CONF['dovecotpw'] = "/usr/sbin/doveadm pw"; 
    $CONF['new_quota_table'] = 'YES'; (for dovecot 2)
  - $CONF['domain_path'] = 'YES'; $CONF['domain_in_mailbox'] = 'NO';
    (results in domain.tld/username/ maildirs)
  - $CONF['alias_control'] = 'YES'; $CONF['alias_control_admin'] = 'YES';
  - $CONF['backup'] = 'NO';
  - $CONF['show_status']='YES'; $CONF['show_status_key']='YES';
    $CONF['show_undeliverable']='YES'; $CONF['show_popimap']='YES';
    $CONF['show_undeliverable_exceptions']- "gmail.com" removed


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1406 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 0f672c7fb7 config.inc.php:
- $CONF[encrypt]: add warning about salted dovecot:* methods


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1403 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz f317ab41a7 footer.tpl:
- replace link to postfixadmin.com with postfixadmin.sf.net


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1401 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 4dfe1db68e vacation.pl:
- fix typo (reported by Jan Kruis on the mailinglist)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1400 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz ae61ee180f functions.inc.php:
- check_owner(): with AdminHandler, we can get 2 results (ALL + a domain).
  Relax the check to accept this case.



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1399 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz a63b80fb23 create-mailbox.php:
- do not escape the password coming from $_POST. Fixes
  https://sourceforge.net/tracker/index.php?func=detail&aid=3094804&group_id=191583&atid=937964 


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1398 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 17911b75d2 functions.inc.php:
- pacrypt(): no longer escape_string() the result. This fixes
  https://sourceforge.net/tracker/index.php?func=detail&aid=3094804&group_id=191583&atid=937964

create-mailbox.php, password.php:
- escape_string() the pacrypt() result

login.php:
- simplify code to require one query less (this also removes the need 
  to escape_string() the password)

I also checked the other files using pacrypt() - they don't need 
escaping or already do it.



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1397 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 57b28f1ae2 config.inc.php:
- remove the (now superfluous) $CONF['postfix_admin_url'] config option

debian/patches/db_credentials:
- remove the section that sets $CONF['postfix_admin_url']

functions.inc.php - authentication_require_role():
- also remove $CONF['postfix_admin_url'] from comments
- remove the './' part from the redirect

Combined with the previous two commits, this fixes
https://sourceforge.net/tracker/?func=detail&aid=3039042&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1396 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 89ffcbf25f smarty.inc.php:
- replace (last) usage of $CONF['postfix_admin_url'] with $rel_path
  (relative path to CSS etc., set to '../' in users/*)

users/*.php:
- set $rel_path to '../'

https://sourceforge.net/tracker/?func=detail&aid=3039042&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1395 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 40011a1a98 functions.inc.php:
- authentication_require_role(): no longer use $CONF['postfix_admin_url']
  https://sourceforge.net/tracker/?func=detail&aid=3039042&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1394 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 a6a3483569 Some things are easier than you might think...
functions.inc.php:
- create_page_browser(): Fix count() query for pgsql. Fixes
  https://sourceforge.net/tracker/?func=detail&aid=3292648&group_id=191583&atid=937964
- surprise: the query to actually generate the pagebrowser already works 
  with pgsql :-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1392 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 47bc9bb2ad upgrade.php:
- _pgsql_field_exists(), _mysql_field_exists():
  Those functions are always called with the expanded table name - don't
  expand it twice. (The better solution would be to change all calling
  code to provide non-expanded tablenames, but that's more work.)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1391 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz a211a95c39 functions.inc.php:
- check_email(): don't trim() mail address to avoid that aliases
  starting with a space are allowed. This fixes
  https://sourceforge.net/tracker/?func=detail&aid=3066059&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1390 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
David Goodwin 05d502558f add a friendly from address to vacation messages; probably needs more work to beautify it though...; change error handling if we cannot send the reply to be hopefully more robust
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1389 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 954b18c169 functions.inc.php
- create_page_browser(): revert r1387 and...
- db_query(): ...replace it with the correct fix ;-) (avoid mysqli 
  reconnects)

The problem was that db_query() used is_resource() to check if we
already have a database connection, but a mysqli connection is an
object, not a resource.
This resulted in a new database connection for each query. Therefore
mysqli "forgot" the value of SET @row before executing the following
SELECT query (which used a new mysqli connection).

The fix is to also check with is_object() to avoid mysqli reconnects.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1388 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 182c67e1cd functions.inc.php:
- create_page_browser(): include MOD(idx.row, $page_size) in outer SELECT.
  This is needed on some MySQL setups which otherwise return an empty set.

Thanks to f-dens_ on IRC for helping to debug it.



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1387 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 102cb4ed50 functions.inc.php:
- change list_admins() to use AdminHandler (code from list-admin.php)
  Note: this changes the return value format to include all details, 
  not only the usernames. Use array_keys(list_admins()) if you need
  the previous return format.
 
list-admin.php:
- replace code with a list_admins() call

list-domain.php:
- adopt to new list_admins() return value



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1386 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
Christian Boltz 4635480afd de.lang, it.lang:
- replace htmlentities with the actual character


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1381 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz ded2dcb640 templates/list-virtual_alias.tpl:
- use edit.php to enable/disable aliases (instead of edit-active.php)
- merge/simplify conditions for "editable"/check_alias_owner
- use {#url_create_alias#} instead of hardcoded edit.php
- some whitespace changes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1380 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz ebc3536a2e edit.php:
- hand over $handler->errormsg to flash_error() as array (avoids 
  various foreach or join calls)
- drop variable $mode, instead set smarty $mode directly based on $new
- comment updates


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1379 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz b3cdbfe88a functions.inc.php:
- _flash_string(): also accept an array of messages, not only a string
- comment updates for _flash_info() and flash_error() to reflect this change


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1378 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz a9f252baea functions.inc.php:
- delete unused function db_boolean_to_int()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1377 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Norman Messtorff f535a0f66f Updating trunk also to current Debian packaging...
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1376 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
David Goodwin 87f33d95ae patch from Jan Kruis - see http://sourceforge.net/tracker/?func=detail&aid=3520749&group_id=191583&atid=937966 (Tracker id 3520749) ; thank you!
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1374 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
David Goodwin 76efcb2c47 merge of patch from maharaja - delete old vacation_notifications - see https://sourceforge.net/tracker/?func=detail&aid=3323227&group_id=191583&atid=937966
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1372 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
David Goodwin 3d3d61963b vacation.pl: refactor duplicated sql into a function (check_for_vacation($x)) - thanks to jan kruis for submitting this - see https://sourceforge.net/tracker/?func=detail&aid=3507319&group_id=191583&atid=937966
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1371 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
David Goodwin d5803088aa vacation.pl: merge in patch from ichier (thank you) - see patch 3371641 - https://sourceforge.net/tracker/?func=detail&aid=3371641&group_id=191583&atid=937966
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1370 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 3b920fc442 functions.inc.php:
- remove_from_array() was accidently wrapped by 
  if (!function_exists('hex2bin'))


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1369 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz 31b94156c4 functions.inc.php:
- delete leftover comment from (long time deleted) function create_admin()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1368 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 4b7929626a *.lang:
- new text: pViewlog_action_edit_vacation (log entry for "edit vacation")
- new text super_admin_desc (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@1365 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 489f7a4155 templates/list-virtual_alias_domain.tpl,
templates/list-virtual_alias.tpl:
- remove limit={$current_limit|escape:"url"} which isn't set anywhere


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1363 a1433add-5e2c-0410-b055-b7f2511e0802
12 years ago
Christian Boltz e60ede3fbf list-virtual:
- if used quota is unknown, display "unknown" instead of "undefined index"


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1362 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