0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-20 03:36:20 +02:00
Commit Graph

283 Commits

Author SHA1 Message Date
Christian Boltz
c2ccffb76c functions.inc.php:
- mailbox_postdeletion(): use Config::read instead of global $CONF


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1522 a1433add-5e2c-0410-b055-b7f2511e0802
2013-10-03 18:35:30 +00:00
Christian Boltz
73a793433e moved the following functions from functions.inc.php to MailboxHandler.php:
- check_quota ()
- allowed_quota()
- mailbox_postcreation()
- mailbox_postedit()
- create_mailbox_subfolders()

The code was moved without any changes, except
- added leading whitespace
- removed "TODO: move to MailboxHandler" ;-)


MailboxHandler:
- change function calls for moved functions


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1515 a1433add-5e2c-0410-b055-b7f2511e0802
2013-08-07 20:05:18 +00:00
Christian Boltz
ecc84a1486 functions.inc.php:
check_quota()
  mailbox_postcreation()
  mailbox_postedit()
  create_mailbox_subfolders()
  - use Config::read() / Config::bool() instead of $CONF
  - update comment header
  - some minor changes to make the code better readable



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1514 a1433add-5e2c-0410-b055-b7f2511e0802
2013-08-07 19:34:17 +00:00
Christian Boltz
414c05e678 functions.inc.php:
- db_where_clause(): wrap condition in "(...)"


model/PFAHandler.php:
- read_from_db(): wrap condition in "(...)"


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1493 a1433add-5e2c-0410-b055-b7f2511e0802
2013-06-23 20:02:05 +00:00
Christian Boltz
a07b822906 functions.inc.php:
- remove unused functions:
  - authentication_is_admin()
  - authentication_is_user()
  - check_string()
  - admin_exist()
  - domain_exist()
- add various TODO notes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1482 a1433add-5e2c-0410-b055-b7f2511e0802
2013-06-23 14:59:55 +00:00
Christian Boltz
79403ad709 functions.inc.php:
- delete unused function get_mailbox_properties()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1481 a1433add-5e2c-0410-b055-b7f2511e0802
2013-06-23 14:38:22 +00:00
Christian Boltz
2cbbac134f functions.inc.php:
- replace boolconf() calls with Config::bool()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1474 a1433add-5e2c-0410-b055-b7f2511e0802
2013-06-06 20:53:37 +00:00
Christian Boltz
71200c1049 functions.inc.php:
- check_email: mention the invalid mail address in errormessage
  (needs text change)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1470 a1433add-5e2c-0410-b055-b7f2511e0802
2013-06-05 23:03:03 +00:00
Christian Boltz
b15319c21a functions.inc.php, model/Config.php:
- move boolconf() to Config::bool()
  boolconf() will stay for backwards compability, but new code
  should use Config::bool()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1467 a1433add-5e2c-0410-b055-b7f2511e0802
2013-06-05 20:35:30 +00:00
Christian Boltz
66ab8fb290 functions.inc.php:
- db_log(): allow delete_admin action


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1455 a1433add-5e2c-0410-b055-b7f2511e0802
2013-04-27 19:53:09 +00:00
Christian Boltz
9c92eef2ff functions.inc.php:
- remove some unused "global $CONF"
- replace some $CONF usage with Config::read() or boolconf()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1453 a1433add-5e2c-0410-b055-b7f2511e0802
2013-04-01 21:59:56 +00:00
Christian Boltz
70978e09a4 functions.inc.php:
- check_domain(), check_email(): 
  use Lang::read and Config::read instead of global variables 
  (global variables, at least $PALANG, don't seem to work with CLI)
- boolconf(): 
  - use Config::read instead of global $CONF
  - drop isset() check - doesn't make sense when using Config::read


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1452 a1433add-5e2c-0410-b055-b7f2511e0802
2013-04-01 21:51:29 +00:00
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
2013-04-01 21:22:30 +00:00
Christian Boltz
68390b0201 functions.inc.php
- allowed_quota: if $CONF[quota] == NO, just return 0 (unlimited)

list-virtual.php:
- only eval_size($limit['maxquota']) if $CONF[quota] == YES
  ($limit['maxquota'] is not set if $CONF[quota] == NO)

Both issues (which caused PHP warnings) were found by TigerP on IRC


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1445 a1433add-5e2c-0410-b055-b7f2511e0802
2013-03-23 19:32:48 +00:00
Christian Boltz
74deef8221 functions.inc.php:
- validate_password(): use Config::read and Lang::read instead of 
  $CONF and $PALANG


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1439 a1433add-5e2c-0410-b055-b7f2511e0802
2013-03-03 00:34:53 +00:00
Christian Boltz
b4823b9e04 Finally replace create-mailbox.php with edit.php?table=mailbox :-)
configs/menu.conf:
- change url_create_mailbox to edit.php?table=mailbox

templates/list-virtual.tpl:
- replace hardcoded create-mailbox.php with {#url_create_mailbox#}

functions.inc.php:
- delete functions that are now part of MailboxHandler:
  - check_mailbox()
  - multiply_quota()
- add some TODO notes

config.inc.php:
- rewrite a comment that referenced create-mailbox.php

create-mailbox.php:
- delete - no longer needed


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1433 a1433add-5e2c-0410-b055-b7f2511e0802
2013-02-19 23:08:01 +00:00
Christian Boltz
8d2e570c03 functions.inc.php:
- _flash_string(): move return outside the foreach so that multiple
  messages can be displayed


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1430 a1433add-5e2c-0410-b055-b7f2511e0802
2013-02-19 22:22:59 +00:00
Christian Boltz
7a7403aa76 functions.inc.php:
- check_quota(): first check if enforcing quotas is disabled via $CONF[quota]


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1413 a1433add-5e2c-0410-b055-b7f2511e0802
2012-12-28 22:34:13 +00:00
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
2012-06-02 22:13:27 +00:00
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
2012-05-28 20:05:48 +00:00
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
2012-05-28 18:07:33 +00:00
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
2012-05-28 17:43:39 +00:00
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
2012-05-28 17:27:17 +00:00
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
2012-05-27 19:06:37 +00:00
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
2012-05-13 21:09:03 +00:00
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
2012-05-11 23:12:03 +00:00
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
2012-05-07 22:53:04 +00:00
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
2012-04-29 14:39:41 +00:00
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
2012-04-29 13:34:59 +00:00
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
2012-04-15 20:46:29 +00:00
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
2012-04-15 18:58:18 +00:00
Christian Boltz
b0277b6c03 functions.inc.php
- new function remove_from_array()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1343 a1433add-5e2c-0410-b055-b7f2511e0802
2012-02-03 23:43:45 +00:00
Christian Boltz
4e5bd47183 functions.inc.php:
- pacrypt(): escape_string() $salt for mysql_encrypt to be on the safe side


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1332 a1433add-5e2c-0410-b055-b7f2511e0802
2012-01-15 11:22:01 +00:00
Christian Boltz
19b9535e43 functions.inc.php:
- PHP around 5.3.8 includes hex2bin as native function - http://php.net/hex2bin
  therefore we have to wrap our function (which fortunately gives the same
  results) with function_exists().
  Reported by MadOtis on #postfixadmin



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1328 a1433add-5e2c-0410-b055-b7f2511e0802
2012-01-11 18:40:58 +00:00
David Goodwin
cb640c87c1 fix sql injection in pacrypt() when mysql_crypt is in use; see previous commits etc esp in the 2.3 branch
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1327 a1433add-5e2c-0410-b055-b7f2511e0802
2012-01-10 23:03:38 +00:00
Christian Boltz
e719c6c4dd create-alias.php:
- deleted, obsoleted by edit.php?table=alias

functions.inc.php:
- drop function check_alias() - it was only used by create-alias.php
  (AliasHandler has a similar function create_allowed(), which is a
  copy of check_alias() with superfluous {...} removed)

configs/menu.conf
- replace create-alias.php with edit.php?table=alias
- append "?" to url_create_mailbox to avoid temporary change in menu.tpl
  (create-mailbox is the only one which still needs ? instead of &)

templates/list-virtual.tpl:
- use {#url_create_alias#} instead of hardcoded create-alias.php

templates/menu.tpl:
- $url_domain: url-escape domain, use & instead of ?



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1317 a1433add-5e2c-0410-b055-b7f2511e0802
2012-01-10 00:30:01 +00:00
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
2011-12-20 01:06:49 +00:00
Christian Boltz
b335abf02e functions.inc.php - db_log():
- allow log actions create_admin and edit_admin
- add edit_admin_state and delete_admin as comment/reminder that they 
  should also be logged

*.lang:
- add text for the new "create admin" and "edit admin" log actions


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1298 a1433add-5e2c-0410-b055-b7f2511e0802
2011-12-19 23:40:34 +00:00
Christian Boltz
3baf1a61c9 functions.inc.php:
- db_delete(): allow to specify additional conditions for the WHERE clause


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1285 a1433add-5e2c-0410-b055-b7f2511e0802
2011-11-27 21:24:29 +00:00
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
2011-11-26 01:09:38 +00:00
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
2011-11-13 23:11:35 +00:00
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
2011-11-12 20:44:35 +00:00
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
2011-11-12 19:48:27 +00:00
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
2011-10-29 22:58:08 +00:00
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
2011-10-25 21:28:55 +00:00
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
2011-10-24 23:09:08 +00:00
Christian Boltz
7b15c4b47d functions.inc.php:
- pacol(): use Lang::read instead of global $PALANG (which is undefined
  when called from a *Handler class)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1234 a1433add-5e2c-0410-b055-b7f2511e0802
2011-10-24 22:06:44 +00:00
Christian Boltz
7f9d947e8f model/DomainHandler.php:
- use a new SELECT query syntax (sub-SELECTs) that gets all needed
  information (including alias count, mailbox count and total quota)
  in one query and is fast as light.
  Better don't ask how long it took me to write this query, and I
  seriously hope it works with postgresql. Otherwise...!
- add alias_count, mailbox_count and total_quota (including the required
  SQL magic) to $struct
- add support for funny[tm] query tricks in $struct:
  - replacement for field name in SELECT statement
  - additional SQL after the FROM xy clause - useful for JOINs
- new function getList($condition) to get a list of domains
- order SELECT results by $this->id_field (needed for getList)
- add comment about the values used in $struct[*][type]

functions.inc.php:
- add two more optional parameters to pacrypt(): $select and $extrafrom

scripts/shells/domain.php:
- display number of existing aliases and mailboxes
- display quota sum



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1230 a1433add-5e2c-0410-b055-b7f2511e0802
2011-10-22 22:49:01 +00:00
Christian Boltz
429ef27031 functions.inc.php:
- new function db_where_clause($condition, $struct) to create a WHERE clause.
  bool values are converted with db_get_boolean() based on $struct

model/DomainHandler.php - view():
- build WHERE clause with db_where_clause()
- new array $colformat for columns which need special handling in the field list
  (that's more readable than tons of elseif on the long term, and allows easier
  customization (hook/$CONF value?))



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1228 a1433add-5e2c-0410-b055-b7f2511e0802
2011-10-22 11:12:03 +00:00
Christian Boltz
7ed7c67fbe functions.inc.php - smtp_mail():
- error_log() the error message if fsockopen() fails


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1227 a1433add-5e2c-0410-b055-b7f2511e0802
2011-10-20 12:13:39 +00:00
Christian Boltz
53d720a569 functions.inc.php:
- db_get_boolean(): allow 0 and 1 as parameters, not only boolean true/false


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1222 a1433add-5e2c-0410-b055-b7f2511e0802
2011-10-19 15:25:33 +00:00
Christian Boltz
da21a4cae2 functions.inc.php:
- new function db_boolean_to_int() to convert boolean values from the 
  database to integer (0 or 1)
- db_get_boolean(): error out on unknown $CONF[database_type]


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1208 a1433add-5e2c-0410-b055-b7f2511e0802
2011-10-16 22:19:55 +00:00
Christian Boltz
d6d4fb4748 functions.inc.php - create_admin()
- check password with validate_password()
- cleanup the handling of the success message

This fixes 50% of
https://sourceforge.net/tracker/?func=detail&aid=1951979&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1193 a1433add-5e2c-0410-b055-b7f2511e0802
2011-09-25 18:53:58 +00:00
Christian Boltz
69b3df10e4 config.inc.php
- new config option $CONF['password_validation'] - array with regular
  expressions to check if a password is valid/good enough.
  The default configuration enforces:
  - minimum length 5 characters/digits/whatever
  - at least 2 characters
  - at least 2 digits
- removed $CONF['min_password_length'] - it's now handled in /.{5}/ in
  $CONF['password_validation']

functions.inc.php
- new function validate_password to check a given password against
  $CONF['password_validation']
- generate_password: generated password is always 8 chars long
  (instead of $CONF['min_password_length'])

edit-admin.php, users/password.php, edit-mailbox.php, setup.php:
- use validate_password instead of $CONF['min_password_length']

This implements
https://sourceforge.net/tracker/?func=detail&aid=1785513&group_id=191583&atid=937967


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1192 a1433add-5e2c-0410-b055-b7f2511e0802
2011-09-25 18:39:20 +00:00
Christian Boltz
9f2a0db106 create_admin() cleanup
functions.inc.php:
- create_admin(): use db_insert instead of INSERT queries
  (this includes automatic escaping of all values)

create-admin.php:
- use safepost instead of isset($_POST[...])
- don't escape_string post values - it's done inside create_admin now
- remove superfluous emptying of empty $tDomains for GET
- allow htmlentities-escaping for pAdminCreate_admin_username_text
- some whitespace / linebreak changes

setup.php:
- load config.inc.php only once (loading it twice will break if custom
  hook functions exist in config.*.php - "can't redefine function ...")
- use safepost instead of isset($_POST[...])
- don't escape_string post values - it's done inside create_admin now
- escape $tUsername with htmlentities() instead of escape_string



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1190 a1433add-5e2c-0410-b055-b7f2511e0802
2011-09-24 17:04:15 +00:00
Christian Boltz
bd4889a7c2 functions.inc.php - check_email():
- replace $CONF[vacation_domain] only at the end of the mail address


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1188 a1433add-5e2c-0410-b055-b7f2511e0802
2011-09-24 11:49:14 +00:00
Christian Boltz
0403a0a55a functions.inc.php - check_owner():
- escape_string() $username and $domain to prevent SQL injections
- add a TODO


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1171 a1433add-5e2c-0410-b055-b7f2511e0802
2011-08-21 20:58:20 +00:00
Christian Boltz
0656852d4e functions.inc.php:
- new function allowed_quota to get the allowed maximum quota for a mailbox.
  Based on a patch by wvolz (wvolz@SF), but with several enhancements/changes.
  https://sourceforge.net/tracker/index.php?func=detail&aid=2856577&group_id=191583&atid=937966
- added a TODO note

edit-mailbox.php:
- get maximum allowed quota via allowed_quota() instead of just using
  the maxquota of the domain


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1156 a1433add-5e2c-0410-b055-b7f2511e0802
2011-07-31 20:33:46 +00:00
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
2011-07-29 22:06:52 +00:00
Christian Boltz
d660270ef9 functions.inc.php
- changed array item name in comment for create_admin()

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1106 a1433add-5e2c-0410-b055-b7f2511e0802
2011-07-22 20:17:17 +00:00
Christian Boltz
0bc0c29a77 functions.inc.php:
- create_admin():
  - renamed some internal variables
  - removed a variable setting that was always overwritten in the next line
  - disabled setting a var to $PALANG['pAdminCreate_admin_username_text']

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1103 a1433add-5e2c-0410-b055-b7f2511e0802
2011-07-21 22:47:53 +00:00
Christian Boltz
28cce0ca37 config.inc.php
- change default of $CONF['admin_email'] to '' and updated the comment.
  IMPORTANT: If set, this will be used as mail sender for all mails
  (2.3.x used the currently logged admin's username in most cases).
  $CONF['admin_email'] = '' will match the 2.3.x behaviour.

functions.inc.php:
- new function smtp_get_admin_email() to get mail sender address
  ($CONF[admin_email] or currently logged in admin if not set)
- changes compared to Dale's patch: 
  - added @return in comment
  - switched to /** comment style

This commit is part of the huge cleanup patch by Dale Blount (lnxus@SF),
https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3370510&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1093 a1433add-5e2c-0410-b055-b7f2511e0802
2011-07-19 21:12:25 +00:00
Christian Boltz
43bde95b57 functions.inc.php - pacrypt():
- if dovecotpw does not give the expected output, read stderr and write
  it to error_log()

This would have made the debugging session I just had with makomi on IRC
about an hour shorter ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1071 a1433add-5e2c-0410-b055-b7f2511e0802
2011-06-05 20:23:04 +00:00
Christian Boltz
3330e20b81 functions.inc.php - gen_show_status()
- do not leave the while loop with break - this could hide some
  undeliverable alias targets from being flagged if another alias
  target points to a domain in $CONF[show_undeliverable_exceptions]
- do not add a blank $CONF[show_status_text] if 
  $CONF[show_undeliverable] is disabled - it only wastes space ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1069 a1433add-5e2c-0410-b055-b7f2511e0802
2011-06-02 23:13:34 +00:00
Christian Boltz
b6cf638b4e functions.inc.php - gen_show_status():
don't show vacation_domain as undeliverable + various code cleanup

- don't show the vacation domain as undeliverable
  In theory this should already have worked already, but $stat_vacdomain
  missed the first letter of the domain ("xample.com" instead of
  "example.com") which broke it.
  Fixed by using $stat_domain, which has the same content anyway.
  This fixes part (2) of
  https://sourceforge.net/tracker/?func=detail&aid=1951926&group_id=191583&atid=937967
- generate the regex for $CONF[recipient_delimiter] at the start of the
  function. Besides saving some CPU cycles, this makes the code more
  readable.
- generate $stat_domain earlier and in a regex-free way
- drop $stat_catchall - it's nothing else than @ + $stat_domain
- use in_array() to check $CONF[show_undeliverable_exceptions] instead
  of a while loop



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1068 a1433add-5e2c-0410-b055-b7f2511e0802
2011-06-02 22:53:40 +00:00
Christian Boltz
b323c8d25c functions.inc.php:
- lots of whitespace changes

old:
    foo
    {

new:
	foo {


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1067 a1433add-5e2c-0410-b055-b7f2511e0802
2011-06-02 20:51:12 +00:00
Christian Boltz
9a1317edc9 functions.inc.php:
- check_quota(): whitespace changes only


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1066 a1433add-5e2c-0410-b055-b7f2511e0802
2011-05-31 22:52:51 +00:00
Christian Boltz
62261f54ae functions.inc.php: fix check_quota() to handle unlimited maxquota
- explicitely check for unlimited maxquota when checking if 
  $quota > $limit[maxquota]. Without this, $quota was always
  considered as being too big (not surprising, everything is >0 ;-)
  This fixes https://sourceforge.net/tracker/?func=detail&aid=3306926&group_id=191583&atid=937964
  (caused by domain quota patch, therefore not affecting 2.3.x)
- replaced setting $rval with return in some cases if the decision is
  final without needing to check domain quota
- added lots of comments to make understanding the function easier



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1065 a1433add-5e2c-0410-b055-b7f2511e0802
2011-05-31 22:50:22 +00:00
Christian Boltz
af6a1b6626 Add support for domain-level quota (total quota for a domain)
Based on a patch from W. Rossmann (W. Rossmann@SF),
https://sourceforge.net/tracker/index.php?func=detail&aid=2974928&group_id=191583&atid=937966
with some modifications, cleanup and adoptions to trunk (especially templates)

config.inc.php:
- new config option $CONF['domain_quota'] to enable/disable domain-level
  quota (default: enabled)
- new config option $CONF['domain_quota_default'] (default: 2 GB)

functions.inc.php - check_quota():
- add code to check the quota sum on a domain
- add optional parameter $username (to exclude that username from quota
  calculation, used by edit-mailbox)

edit-domain.php, create-domain.php,
admin_edit-domain.tpl, admin_create-domain.tpl:
- add input field and handling for domain-level quota

list-domain.php, overview-get.tpl, adminlistdomain.tpl:
- display allocated and allowed domain quota
- beautify quota and max_quota fields - display "unlimited" instead of "-1"

edit-mailbox.php:
- hand over username to check_quota()



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1042 a1433add-5e2c-0410-b055-b7f2511e0802
2011-04-19 20:18:46 +00:00
Christian Boltz
f503ba1098 functions.inc.php,
- db_delete(): if no row was deleted, return 0 (not true)
  This should not affect any existing code, but makes more sense
  for future usage.
- whitespace changes in db_delete()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1035 a1433add-5e2c-0410-b055-b7f2511e0802
2011-04-10 22:12:56 +00:00
Christian Boltz
736074ec12 list-virtual.php: use create_page_browser().
This will speed up pagebrowser creation by about 300 times.

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

It also brings back the pagebrowser in search mode and therefore fixes
https://sourceforge.net/tracker/?func=detail&aid=2782818&group_id=191583&atid=937964

Detailed changes:
- create separate query parts for pagebrowser creation
  (without SELECT $fieldlist and LIMIT clause)
- create pagebrowser arrays with create_page_browser()
- cNav_bar class: parameter cleanup in constructor: use count() instead of 
  relying on external counting
- change cNav_bar calls accordingly


functions.inc.php:
- remove pagebrowser generation from get_domain_properties()
  (no longer needed, obsoleted by create_page_browser)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1034 a1433add-5e2c-0410-b055-b7f2511e0802
2011-04-10 20:19:17 +00:00
Christian Boltz
799cd9c2f3 functions.inc.php:
- create_page_browser(): added queries for PgSQL (untested!)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1033 a1433add-5e2c-0410-b055-b7f2511e0802
2011-04-10 19:20:31 +00:00
Christian Boltz
cfd1be04b2 functions.inc.php:
fully working MySQL version of create_page_browser()

- force $page_size to int and die() if it is < 2
- dropped $item_count parameter - the function now counts itsself
- include last row in the query
- return empty array (= no pagebrowser) if all rows fit in one page
- PgSQL queries are still on my TODO list


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1030 a1433add-5e2c-0410-b055-b7f2511e0802
2011-04-10 16:30:49 +00:00
Christian Boltz
63146720d4 functions.inc.php:
- generate_password(): generate more secure random password

Based on a patch from Pierre Fagrell (mrfrenzy@SF),
https://sourceforge.net/tracker/?func=detail&aid=2958698&group_id=191583&atid=937964
(with some modifications)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1026 a1433add-5e2c-0410-b055-b7f2511e0802
2011-04-10 14:16:17 +00:00
Christian Boltz
67069e07f8 functions.inc.php:
- new function create_page_browser()

Function to create the page browser index ("a-c, d-h, ...") with light
speed (at least when compared with the current code that can take several
minutes(!) for people with lots of mailboxes or aliases).

At the moment, it only works with MySQL, has several big TODO notes 
(including notices how to implement the PostgreSQL query) and is not
yet actively used.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1022 a1433add-5e2c-0410-b055-b7f2511e0802
2011-04-09 22:37:11 +00:00
Christian Boltz
d66262f00e Remove usage of $CONF['postfix_admin_url'] in various Location: headers
to avoid problems with wrong values of $CONF['postfix_admin_url'].

https://sourceforge.net/tracker/?func=detail&atid=937964&aid=3039042&group_id=191583
contains the technical details and reasons.

Note: $CONF['postfix_admin_url'] is still used at some places that are
a bit harder to change.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1021 a1433add-5e2c-0410-b055-b7f2511e0802
2011-04-09 22:09:37 +00:00
Valkum
179f195bf1 *fixed db_insert - duplicate $timestamp
*fixed VacationHandler.php
*changed edit-vacation to us VacationHandler
*added todopoint to upgrade.php
*fixed problem in AliasHandler


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@981 a1433add-5e2c-0410-b055-b7f2511e0802
2011-03-06 02:14:10 +00:00
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
2011-02-15 22:20:27 +00:00
Christian Boltz
ba8fc89347 Preparation for removing the $username parameter from db_log()
(will be detected by authentication_get_username() instead)

scripts/postfixadmin-cli.php:
- define ("POSTFIXADMIN_CLI", 1) (we have no session running and need a
  way to tell authentication_get_username() that this is a CLI access)

functions.inc.php:
- authentication_get_username(): check for POSTFIXADMIN_CLI constant,
  return 'CLI' if set
  (hmmm, do we need a similar thing for XMLRPC?)
- db_log(): override $username parameter with authentication_get_username()
  (removing it from function parameters will be my next big commit)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@965 a1433add-5e2c-0410-b055-b7f2511e0802
2011-02-15 21:59:03 +00:00
Christian Boltz
4a2b40e100 changed db_update parameters for the most common usecase "WHERE col=value" -
column and value are separate parameters now

functions.inc.php:
- changed function db_update() parameters - column name and value for the WHERE
  condition are now two separate parameters. This means we don't need to
  escape_string(), add quotes etc. for most UPDATE queries.
  Example call: db_update('alias', 'address', $this->username, $values_array)
- the previous db_update() is now called db_update_q()

model/UserHandler.php:
- changed db_update call to the new parameters
- removed now unused variables
- renamed $username to $E_username
- call pacrypt directly when setting the $set array, no need for $new_db_password

model/AliasHandler.php
- changed db_update call to the new parameters

edit-mailbox.php
- switched to db_update_q()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@931 a1433add-5e2c-0410-b055-b7f2511e0802
2010-12-31 20:13:53 +00:00
Christian Boltz
93d80797ea functions.inc.php: last commit missed some changes to db_log():
- sorted $action_list to make it more readable
- cleanup


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@910 a1433add-5e2c-0410-b055-b7f2511e0802
2010-12-25 22:59:11 +00:00
Christian Boltz
900615a5ec functions.inc.php: various improvements while working on UserHandler.php
- smtp_mail(): added another (currently optional) parameter.
  It can now be called with subject and body, no need to build the mail
  header in every script that needs to send a mail.
- db_delete() did not use table_by_key. Fixed, backport queued for 
  2.3 branch
- db_insert() now has array(created,modified) as default for timestamp 
  columns so that most calls can be done without that parameter
- db_update() now has array(modified) as default for timestamp column
  so that most calls can be done without that parameter
- new functions db_begin / db_commit / db_rollback - BEGIN / COMMIT / 
  ROLLBACK wrapped in a check for $CONF['database_type'] == "pgsql".
  One more step to get rid of database-specific code in all files.
- db_log(): 
  - migrated to db_insert. This should also fix some missing quoting.
  - sorted $action_list to make it more readable
  - backport queued for 2.3 branch for both changes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@907 a1433add-5e2c-0410-b055-b7f2511e0802
2010-12-25 22:04:16 +00:00
Christian Boltz
623d992091 functions.inc.php:
- check_domain(): don't trim() the domain - whitespace is an error.
  This catches "foo@ domain.com" that wasn't catched before.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@902 a1433add-5e2c-0410-b055-b7f2511e0802
2010-12-25 14:57:35 +00:00
Christian Boltz
512c9bfb44 functions.inc.php:
- replaced deprecated split() call with preg_split()
  https://sourceforge.net/tracker/?func=detail&aid=3060495&group_id=191583&atid=937964
- added hint about probably missing php5-* packages in error messages if 
  database functions don't exist



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@892 a1433add-5e2c-0410-b055-b7f2511e0802
2010-12-15 23:17:08 +00:00
Christian Boltz
4c912f1da8 list-virtual.php:
- hand over $search to smarty templates

templates/list-virtual_alias.tpl, templates/list-virtual_alias_domain.tpl:
- add search result highlighting

templates/list-virtual_mailbox.tpl:
- add search result highlighting
- move output of "Mailbox" / "Forward only" outside the foreach loop
  (was displayed once per mailbox alias target)

css/default.css:
- add style for ".searchresult"



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@868 a1433add-5e2c-0410-b055-b7f2511e0802
2010-09-26 23:14:42 +00:00
Christian Boltz
c070a61ef2 functions.inc.php
- remove obsolete unlink($tmpfile) that was re-introduced by smarty merge


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@785 a1433add-5e2c-0410-b055-b7f2511e0802
2009-12-05 00:13:29 +00:00
Christian Boltz
3922f6fece after an hour of debugging with Han on #postfixadmin...
functions.inc.php:
- added error message if the check_owner query returns more than one result.
  This can happen with old databases (pre-2.3) where the domain_admins table
  contains "ALL" _and_ a domain for a superadmin - which results in the
  superadmin not able to edit mailboxes etc. for this domain.
  (Error message not translatable - this is a corner case.)

list-virtual.php:
- add "invalid parameter" error message before redirecting to list-domain
  if the user doesn't have permissions for a domain


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@778 a1433add-5e2c-0410-b055-b7f2511e0802
2009-11-30 12:48:25 +00:00
Sebastian
b1287d97e2 - big merge of Postfixadmin smarty into trunk
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@757 a1433add-5e2c-0410-b055-b7f2511e0802
2009-11-05 14:55:39 +00:00
Christian Boltz
188aa2bd5c functions.inc.php:
- handle dovecot passwords without any tempfile (to prevent safe_mode issues)
  Changed based on a patch from Aleksandr @SF,
  https://sourceforge.net/tracker/?func=detail&atid=937966&aid=2890471&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@752 a1433add-5e2c-0410-b055-b7f2511e0802
2009-11-02 18:46:48 +00:00
Christian Boltz
6220b6d85c after a long weekend...
list-virtual.php:
- merge search functionality into list-virtual.php (even more performant
  for domain admins now - search.php checked domain ownership after
  querying all domains...)
  (Use list-virtual.php?search=searchterm to test searching)
- allow to display mailbox alias targets in mailbox list
  Fields added to the mailbox list array:
  * goto_mailbox (mailbox (=1) or forward-only (=0))
  * goto_other (array with aliases not pointing to the mailbox)
  * (vacation alias is skipped)
  open question: is $display_mailbox_aliases = boolconf('special_alias_control')
  correct? I'm slightly confused with alias_control, alias_control_admin
  and special_alias_control...
- build mailbox query step by step instead of having several variants
  which overlap 90% (and include a high bug potential, as already
  demonstrated by me ;-)

templates/list-virtual.php
- added search result highlighting
- added displaying of mailbox aliases (goto_mailbox and goto_other)
- removed ?domain= parameter for edit-alias.php, other edit-*.php have
  to follow (otherwise we'll have to extract the domain from the address
  to avoid incorrect parameters in search mode)

functions.inc.php
- added db_in_clause() which builds a "field in(x, y)" clause for
  database queries



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@751 a1433add-5e2c-0410-b055-b7f2511e0802
2009-11-02 00:24:40 +00:00
Christian Boltz
7c890a49ea postfixadmin 2.3 final(ly) :-)
- updating version number in various places


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@739 a1433add-5e2c-0410-b055-b7f2511e0802
2009-10-25 14:39:28 +00:00
Christian Boltz
04b272472d support for displaying quota (dovecot 1.1 and 1.2 format)
upgrade.php
- create quota and quota2 table (upgrade_729)
- create the triggers required by dovecot (upgrade_730_pgsql)

list-virtual.php
- updated to work with both quota tables
  Patch by Varren Volz, https://sourceforge.net/tracker/?func=detail&amp;aid=2867629&amp;group_id=191583&amp;atid=937966
- changed query for 1.1 quota table to 
      WHERE [...] AND  (  $table_quota.path='quota/storage' OR $table_quota.path IS NULL  )
  This fixes https://sourceforge.net/tracker/?func=detail&aid=2794247&group_id=191583&atid=937964
  (users not shown when initial email is not sent)

config.inc.php, functions.php
- new config option $CONF['new_quota_table'] (YES means dovecot 1.2 format)
- set variables for new quota2 table

DOCUMENTS/DOVECOT.txt
- added note that quota table is automatically created
- added note about different quota tables for dovecot 1.0/1.1 and >= 1.2


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@730 a1433add-5e2c-0410-b055-b7f2511e0802
2009-10-18 22:43:13 +00:00
David Goodwin
93b4d3e71a functions.inc.php: allow for port specification for PostgreSQL
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@717 a1433add-5e2c-0410-b055-b7f2511e0802
2009-09-01 14:01:44 +00:00
David Goodwin
c4002d5e0b functions.inc.php: fix as per Geoff Shangs report via email
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@710 a1433add-5e2c-0410-b055-b7f2511e0802
2009-08-21 10:49:57 +00:00
David Goodwin
814539fe50 fix db_get_boolean behaviour - postgres returns "t" or "f" - and also accepts this
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@700 a1433add-5e2c-0410-b055-b7f2511e0802
2009-08-04 20:41:24 +00:00
David Goodwin
d487507e8e functions.inc.php: support base64 encoded sha1 passwords (flavour=SHA); thanks to mez@sourceguru.net
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@698 a1433add-5e2c-0410-b055-b7f2511e0802
2009-08-01 05:07:20 +00:00
Christian Boltz
e46f73fed2 functions.inc.php
- replace ereg (introduced in r693) with preg_match


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@696 a1433add-5e2c-0410-b055-b7f2511e0802
2009-07-28 23:00:48 +00:00
David Goodwin
345de9214c bump up to 2.3rc7
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@694 a1433add-5e2c-0410-b055-b7f2511e0802
2009-07-27 21:13:02 +00:00
David Goodwin
f1fc057f43 fix crypt() usage - see https://sourceforge.net/tracker/?func=detail&aid=2814820&group_id=191583&atid=937964 ; thanks for the patch
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@693 a1433add-5e2c-0410-b055-b7f2511e0802
2009-07-27 21:06:05 +00:00
David Goodwin
8200ef4788 ready for 2.3rc6
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@689 a1433add-5e2c-0410-b055-b7f2511e0802
2009-07-20 19:08:43 +00:00
David Goodwin
9af0d53318 functions.inc.php: stupid syntax error; thanks David Verdier
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@686 a1433add-5e2c-0410-b055-b7f2511e0802
2009-07-13 13:27:44 +00:00
David Goodwin
36ae454ff5 remove ereg stuff
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@683 a1433add-5e2c-0410-b055-b7f2511e0802
2009-07-10 21:05:16 +00:00
David Goodwin
4f88abb0fd remove pointless ereg stuff
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@680 a1433add-5e2c-0410-b055-b7f2511e0802
2009-07-10 20:58:33 +00:00
David Goodwin
c137191ed7 lets try and get rc5 up and around
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@661 a1433add-5e2c-0410-b055-b7f2511e0802
2009-05-20 20:24:23 +00:00
Christian Boltz
7480181a18 functions.inc.php:
- gen_show_status(): honor recipient_delimiter in POP/IMAP check


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@657 a1433add-5e2c-0410-b055-b7f2511e0802
2009-05-14 19:16:00 +00:00
Christian Boltz
a9d9e3d96a reverting most changes from SVN r572 aka
https://sourceforge.net/tracker/index.php?func=detail&aid=2567466&group_id=191583&atid=937966
because 
- it undermines the $CONF[*alias_control*] settings more or less - 
  mailbox aliases with non-default targets are always shown in 
  the "Aliases" section - see comment from 2009-05-04 on 
  https://sourceforge.net/tracker/?func=detail&aid=1902476&group_id=191583&atid=937964
- it introduced some "funny" bugs - a nice example is
  http://sourceforge.net/tracker/?func=detail&aid=2786284&group_id=191583&atid=937964

Files / sections affected by the revert:
- list-virtual.php: all numbers (alias count etc.) correct?
  (the changes in this file are the largest ones)
- functions.inc.php: SQL queries in get_domain_properties()
- delete.php: the only change since r572 affected code that was inserted 
  in r572 (and is now deleted again) - nothing should break here
- create-alias.php: had no changes since r572 - therefore nothing should 
  break here

Exceptions (not reverted):
- edit-alias: this change looks useful (hide mailbox alias target from 
  admins if they don't have permissions to change it). The actual code 
  has changed in the meantime, but the functionality stays.
  Additionally, reverting this would be very hard or throw useful later 
  changes away.
  BUT: shouldn't the page completely forbid to edit a mailbox alias if
  the admin doesn't have permissions for it?
- functions.inc.php: comment for pacrypt() ;-)
- linebreaks in long SQL queries

Please check if everything is still working as expected (especially the domain
list and the virtual list) - I did only some quick tests.



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@652 a1433add-5e2c-0410-b055-b7f2511e0802
2009-05-07 23:23:21 +00:00
Christian Boltz
9102b62a6e functions.inc.php:
- gen_show_status(): add support for recipient_delimiter when checking aliases
  This implements part (8) of 
  https://sourceforge.net/tracker/?func=detail&aid=1951926&group_id=191583&atid=937967

config.inc.php:
- add new setting $CONF['recipient_delimiter']


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@650 a1433add-5e2c-0410-b055-b7f2511e0802
2009-05-03 17:23:48 +00:00
David Goodwin
bb43fdd088 functions.inc.php: reindent
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@641 a1433add-5e2c-0410-b055-b7f2511e0802
2009-04-22 14:49:52 +00:00
David Goodwin
08e54eead9 update documentation; get ready for a 2.3rc4 release
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@634 a1433add-5e2c-0410-b055-b7f2511e0802
2009-04-18 20:19:16 +00:00
David Goodwin
96985c965f debian/changelog, function.inc.php, CHANGELOG.TXT : 2.3 rc3 is almost here
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@613 a1433add-5e2c-0410-b055-b7f2511e0802
2009-04-06 19:59:11 +00:00
David Goodwin
7f4973c899 functions.inc.php: bump version number
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@591 a1433add-5e2c-0410-b055-b7f2511e0802
2009-03-19 19:53:05 +00:00
David Goodwin
c384984362 2.3rc1
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@588 a1433add-5e2c-0410-b055-b7f2511e0802
2009-03-18 19:54:34 +00:00
Christian Boltz
af702c05e1 functions.inc.php, function pacrypt:
- added dovecotpw encryption support (patch from cmuelle8 (trendypack) + some fixes 
  from me, see tracker for details)
  https://sourceforge.net/tracker2/?func=detail&aid=2607332&group_id=191583&atid=937966
- replaced most "if" with "elseif" to be able to check for invalid $CONF[encrypt] settings
- added error check/message for invalid $CONF[encrypt] settings

config.inc.php:
- $CONF[encrypt]: added description for dovecot:xy
- added new $CONF['dovecotpw'] setting (path to dovecotpw binary)



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@580 a1433add-5e2c-0410-b055-b7f2511e0802
2009-03-13 23:32:20 +00:00
David Goodwin
8b4e513701 see https://sourceforge.net/tracker/index.php?func=detail&aid=2567466&group_id=191583&atid=937966 - allow adding of an alias even if a mailbox already exists (e.g. allowing you to do keep+forward)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@572 a1433add-5e2c-0410-b055-b7f2511e0802
2009-03-08 21:16:41 +00:00
David Goodwin
8eafea4617 see https://sourceforge.net/tracker/index.php?func=detail&aid=2581010&group_id=191583&atid=937964 - thanks dystopian
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@567 a1433add-5e2c-0410-b055-b7f2511e0802
2009-02-16 12:40:15 +00:00
Christian Boltz
68943a5477 functions.inc.php
- added comment about courier-authlib supporting only two-character salt
  (see mail from Jan Röhrich in postfixadmin-devel about r560)
- fixed vim: line - functions.inc.php uses 4 spaces
- replaced "else if" with "elseif"
- replaced tabs with spaces


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@564 a1433add-5e2c-0410-b055-b7f2511e0802
2009-02-09 19:11:43 +00:00
Jan Roehrich
12dc358ad0 functions.inc.php:
-  fixed some remarks in pacrypt

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@562 a1433add-5e2c-0410-b055-b7f2511e0802
2009-02-04 21:05:08 +00:00
Christian Boltz
48f3be29bf CHANGELOG.TXT:
- updated with latest changes

functions.inc.php
- whitespace fixes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@561 a1433add-5e2c-0410-b055-b7f2511e0802
2009-02-03 21:02:04 +00:00
Jan Roehrich
e218b81af2 config.inc.php:
- Added configuration for courier authlib authentication flavors

function.inc.php:
- changed pa_crypt to make it handle courier authlib authentication flavors

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@560 a1433add-5e2c-0410-b055-b7f2511e0802
2009-02-03 17:50:13 +00:00
David Goodwin
eb186193d4 functions.inc.php: remove dev comment (echo of sql)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@538 a1433add-5e2c-0410-b055-b7f2511e0802
2009-01-20 20:42:53 +00:00
David Goodwin
a1a81c9823 config.inc.php, functions.inc.php - add support for mysql_encrypt method for password encrpytion - useful for pam integration, apparently - see https://sourceforge.net/tracker/?func=detail&atid=937966&aid=1793352&group_id=191583
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@525 a1433add-5e2c-0410-b055-b7f2511e0802
2009-01-15 14:32:43 +00:00
David Goodwin
23afeac839 functions.inc.php / CHANGELOG.txt - bump version numbers etc
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@524 a1433add-5e2c-0410-b055-b7f2511e0802
2009-01-15 12:27:55 +00:00
David Goodwin
1193e752ac functions.inc.php: reindent
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@520 a1433add-5e2c-0410-b055-b7f2511e0802
2009-01-15 12:24:36 +00:00
David Goodwin
049a9ecc96 merge patch for dovecot quota viewing - see https://sourceforge.net/tracker/index.php?func=detail&aid=2060309&group_id=191583&atid=937966 - thank you shario; sorry it took so long to merge!
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@518 a1433add-5e2c-0410-b055-b7f2511e0802
2009-01-15 11:38:11 +00:00
David Goodwin
723090d6d0 add patch for domain postcreation script; see https://sourceforge.net/tracker/index.php?func=detail&aid=2508593&group_id=191583&atid=937966
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@516 a1433add-5e2c-0410-b055-b7f2511e0802
2009-01-15 11:19:51 +00:00
Christian Boltz
0411a11b4c functions.inc.php
- gen_show_status(): "probably undeliverable" marker now honors catchall 
  aliases and no longer marks aliases pointing to a catchall as invalid
  https://sourceforge.net/tracker/index.php?func=detail&aid=2013772&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@480 a1433add-5e2c-0410-b055-b7f2511e0802
2008-11-12 22:07:50 +00:00
Christian Boltz
0dc5163eb1 functions.inc.php:
- check_email requires global $PALANG


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@475 a1433add-5e2c-0410-b055-b7f2511e0802
2008-11-11 22:11:52 +00:00
Christian Boltz
75c5c62ed0 config.inc.php, functions.inc.php, templates/list-virtual.php:
- dropped $CONF['show_custom_count'], it can easily be calculated with
  count($CONF['show_custom_domains']). This fixes part (6) of
  https://sourceforge.net/tracker2/?func=detail&aid=1951926&group_id=191583&atid=937967

config.inc.php:
- added some comments explaining $CONF['show_undeliverable_exceptions'] 
  and $CONF['show_custom_domains']


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@471 a1433add-5e2c-0410-b055-b7f2511e0802
2008-11-01 20:15:46 +00:00
David Goodwin
45b2df237c functions.inc.php: fix alias creation - 0 & -1 confusion again
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@459 a1433add-5e2c-0410-b055-b7f2511e0802
2008-09-04 12:47:02 +00:00
David Goodwin
60d1b54aaa functions.inc.php: Fix mailbox check_mailbox() routine - if the domain has 0 for mailbox count it should allow unlimited mailboxes (not disable - which is -1)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@455 a1433add-5e2c-0410-b055-b7f2511e0802
2008-09-01 19:20:23 +00:00
David Goodwin
c81376bb1d patch from https://sourceforge.net/tracker/index.php?func=detail&aid=2059427&group_id=191583&atid=937964 ; thanks
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@449 a1433add-5e2c-0410-b055-b7f2511e0802
2008-08-19 20:00:50 +00:00
David Goodwin
ccc1b90236 imap-prefix patch - see https://sourceforge.net/tracker/index.php?func=detail&aid=2049852&group_id=191583&atid=937964 , apparently useful for courier
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@444 a1433add-5e2c-0410-b055-b7f2511e0802
2008-08-14 18:58:13 +00:00
Christian Boltz
3e5549bfad functions.inc.php:
- move DNS checks from check_email() to check_domain()
- add clear error message on non-resolvable domains (using flash_error() -
  this is probably not the best solution, but better than nothing)
- made error messages translatable

create-domain.php:
- avoid duplicated call to check_domain (to avoid duplicated error message)
- domains are now DNS-checked on creation - see the changes in check_domain()
  in functions.inc.php

languages/*:
- added error messages for the above changes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@429 a1433add-5e2c-0410-b055-b7f2511e0802
2008-07-29 23:18:40 +00:00
David Goodwin
544c7ebe82 functions.inc.php: reindent (as per inline vim settings) and add in flash_error calls when validating an email address (I suspect the strings need changing as per translation issues)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@426 a1433add-5e2c-0410-b055-b7f2511e0802
2008-07-29 19:32:32 +00:00
Christian Boltz
5fa76d73d9 config.inc.php + all files related to alias domains
- added $CONF['alias_domain'] switch to disable alias domains
  (includes lots of whitespace changes in list-virtual.php)

functions.php:
- added some comments to boolconf()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@419 a1433add-5e2c-0410-b055-b7f2511e0802
2008-07-27 19:06:55 +00:00
Christian Boltz
711df82fc8 function.inc.php
- new function boolconf() for easier handling of boolean $CONF settings


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@418 a1433add-5e2c-0410-b055-b7f2511e0802
2008-07-27 18:48:41 +00:00
Christian Boltz
532675ab3b functions.php
- removed (now) unused function table_by_pos
  I'm quite sure we won't need it again, basically it answered questions 
  like "what's the 3rd table in $CONF['database_tables']?"


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@407 a1433add-5e2c-0410-b055-b7f2511e0802
2008-07-18 23:21:59 +00:00
Christian Boltz
add0c86cad Applied patch from Michiel van Baak (mvanbaak)
https://sourceforge.net/tracker/index.php?func=detail&aid=1923030&group_id=191583&atid=937966
- added quota parameter in mailbox_postcreation() hook
- new hook to update the quota after editing a mailbox

Modifications to the patch:
- made $quota an required parameter in the mailbox_postedit and 
  mailbox_postcreation functions
- the scripts always get the quota as 4th parameter. In case $quota 
  is <= 0, it is set to 0.


config.inc.php:
- new option $CONF['mailbox_postedit_script']

edit-mailbox.php:
- call mailbox_postedit() after editing the mailbox

functions.inc.php:
- added $quota parameter to mailbox_postcreation()
- new function mailbox_postedit()

create-mailbox.php:
- added $quota parameter on mailbox_postcreation() call


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@373 a1433add-5e2c-0410-b055-b7f2511e0802
2008-05-25 21:19:58 +00:00
Christian Boltz
919638efdf create-mailbox.php:
- create subfolders _after_ sending the welcome mail

functions.inc.php:
- sleep(1) before creating subfolders for a newly created mailbox

This fixes subfolder creation when courier is used.
https://sourceforge.net/tracker/?func=detail&atid=937964&aid=1970684&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@369 a1433add-5e2c-0410-b055-b7f2511e0802
2008-05-25 19:33:43 +00:00
David Goodwin
370e8fef6c inital merge of lenix's patch for domain aliasing; I think list-virtual.php needs some attention, but I've run out of time right now; upgrade.php has been updated to create the tables correctly (tested on pgsql and mysql); functionality or php scripts not tested yet
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@363 a1433add-5e2c-0410-b055-b7f2511e0802
2008-05-21 21:05:48 +00:00
David Goodwin
98e9da8ea5 functions.inc.php: 2.2.0....
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@355 a1433add-5e2c-0410-b055-b7f2511e0802
2008-04-29 14:39:39 +00:00
David Goodwin
0d559f2d57 functions.inc.php: checkdnsrr may not exist; try and be graceful
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@353 a1433add-5e2c-0410-b055-b7f2511e0802
2008-04-26 22:02:49 +00:00
David Goodwin
2f220c9b32 functions.inc.php: fix urls
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@311 a1433add-5e2c-0410-b055-b7f2511e0802
2008-03-08 21:23:24 +00:00
Greg
9f7d4f14e9 simplification and (hopefully) bug free fix for POP/IMAP box marking
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@310 a1433add-5e2c-0410-b055-b7f2511e0802
2008-03-07 18:38:22 +00:00
Greg
880881c2a2 fixed an error that would not identify POP/IMAP accounts when a mailbox forwards to other destinations as well.
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@308 a1433add-5e2c-0410-b055-b7f2511e0802
2008-03-04 22:02:20 +00:00
Christian Boltz
95057caa43 functions.inc.php:
- check_language(): use global $supported_languages so that we don't 
  have to maintain the list of supported languages at different places
  (this finally enables users to choose japanese language at login)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@307 a1433add-5e2c-0410-b055-b7f2511e0802
2008-03-02 22:17:39 +00:00
Christian Boltz
e16334361c functions.inc.php
- fixed wrong comment about check_language parameter


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@283 a1433add-5e2c-0410-b055-b7f2511e0802
2007-12-30 20:16:07 +00:00
Christian Boltz
f217f0c1bb Summary: Added language selector to login form
functions.inc.php:
- function check_language
  - new optional parameter $use_post (needed by login.php)
  - check for language cookie
  - check for $_POST['lang']
  - removed substr() call because it made pt-br translation unuseable
- new function language_selector
  - returns a HTML dropdown language selector
- new function safecookie
  - similar to safeget, but for cookies

templates/login.php, templates/users_login.php:
- display language selector dropdown

login.php, users/login.php:
- check for selected language
- set cookie if user selected non-default language

languages/language.php: (NEW FILE)
- list of supported languages
- language names taken from phpMyAdmin login form

common.php:
- include languages/language.php
 


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@280 a1433add-5e2c-0410-b055-b7f2511e0802
2007-12-30 01:32:33 +00:00
Christian Boltz
5f7dcc18d5 functions.inc.php
- allow longer TLDs (.museum, .travel)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@214 a1433add-5e2c-0410-b055-b7f2511e0802
2007-11-12 01:26:01 +00:00
Christian Boltz
a00d456084 functions.inc.php
- encode_header(): made charset parameter optional, defaults to utf-8
- db_delete(): escape_string() $where and $delete

create-mailbox.php:
- always encode mail header and insert Content-Type etc. headers
  (previous code never did this, $PALANG['charset'] is not set in any
  language. so this code part was never used)

sendmail.php:
- always encode mail header and insert Content-Type etc. headers
  (had the same bug as create-mailbox.php)
- merge GET and POST

These changes fix
http://sourceforge.net/tracker/index.php?func=detail&aid=1811214&group_id=191583&atid=937964



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@199 a1433add-5e2c-0410-b055-b7f2511e0802
2007-11-04 22:52:16 +00:00