Commit Graph

820 Commits (4a29c75938bfd1899e053aa07b8d2bc6f92096e5)
 

Author SHA1 Message Date
Christian Boltz 4a29c75938 edit-mailbox.php:
- drop superfluous "modified" field (it's default anyway)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@998 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz c75022ad50 VacationHandler.php:
- set_away() killed the existing aliases and replaced them with the vacation 
  alias instead of adding it. Fixed.
- remove array() from db_update calls for vacation table (introduced by valkum
  in r981) - the vacation table has created/modified columns since r945


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@988 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
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
14 years ago
Christian Boltz 8560012db8 For reference: the baseclass I was talking about in my previous commit
+ implementation of fetchmail with this class.

Note that those files were last edited on Aug 14 2008, so they probably
contain some outdated stuff ;-)  Nevertheless the baseclass implementation
and the comments it contains are still useful IMHO.

Feedback welcome ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@979 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 51262b7675 DomainHander: on the way to a common interface for all classes and
easy-to-edit field lists. With lots of inspiration from fetchmail.php
and a base class I started 2.5 years ago.

model/DomainHandler.php
- base on PFAHandler (see below)
- new protected variables
  - $id_field (column that contains $username)
  - $struct (field list)
  - $defaults (default values, option lists)
  - $new (switch between new and edit mode)
- change $username to protected (preparation for move to PFAHandler)
- add optional $new parameter to __construct. Targets (not yet implemented):
  - early validation of $username (domain name in this case)
  - if $new == 1, check that item does NOT exist and is a valid domain
  - else: check if item exists. error out if not.
- new function initStruct to fill $id_field, $struct, $defaults
- add():
  - use an array as parameter instead of single parameters
    Advantage: this makes it easy to add another field
  - use _inp_* base validation 
  - create default aliases only in create mode, not in edit mode
- view(): fix error message
- added various TODO notes. Some affect design questions - feedback welcome ;-)

scripts/shells/domain.php:
- change $handler->add call to array usage
- add some TODO notes
- some whitespace fixes in execute()

model/PFAHandler.php:
- new base class for *Handler classes
- contains only some generic input validation for now
- more code will be moved from DomainHandler to PFAHandler later


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@978 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 62eee67aee delete.php:
- fix various db_delete calls - use default table name, not table_by_key() result


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@977 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz d0327cbbc7 setup.php:
- make check for $CONF['configured'] more strict (=== instead of ==)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@976 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 6225e555f4 model/AliasHandler.php:
- fix comment for delete() - it no longer has a param

model/*:
- add svn $Id line


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@975 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 74fa966522 fix svn:keywords
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@974 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 240079c16f smarty.inc.php:
- set $this->template->allow_php_tag = true instead of editing 
  smarty/libs/Smarty.class.php after every smarty upgrade

added smarty/smarty_version with:
- a note about the current smarty version
- a note about additional files not part of the smarty package


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@973 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 82778dba1e Update smarty from 3.0.5 to 3.0.7
See http://smarty-php.googlecode.com/svn/trunk/distribution/change_log.txt
for a list of all changes.

New files:
libs/sysplugins/smarty_internal_get_include_path.php
libs/plugins/shared.mb_str_replace.php

Deleted files (no longer shipped with smarty):
libs/plugins/function.popup.php
libs/plugins/function.popup_init.php


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@972 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 476035efd1 Legal stuff: add notes about the licenses of the libraries we use to LICENSE.TXT
Also added smarty/COPYING.lib (contains the smarty license - LGPL3)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@971 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 3f9f4b5ee7 vacation.pl:
- add date range check to all queries

Patch by Colin Viebrock (cviebrock@SF) -
https://sourceforge.net/tracker/?func=detail&aid=3152571&group_id=191583&atid=937964

Additionally added a TODO note that we should use a function instead of
having 3 copies of the query in the code.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@970 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz acfc4e57f8 upgrade.php:
- PostgreSQL: change domain.quota, domain.maxquota and mailbox.quota to bigint

reported by oliver (n0d3 @SF), 
https://sourceforge.net/tracker/?func=detail&aid=3057081&group_id=191583&atid=937964

Note: MySQL has bigint field since r169.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@968 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz ff84852775 css/default.css:
- center main menu - based on a patch by Chris H. (dharmachris @SF)
  https://sourceforge.net/tracker/?func=detail&aid=3186087&group_id=191583&atid=937964
- some whitespace fixes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@967 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
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
14 years ago
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
14 years ago
Christian Boltz e3b25d99b4 smarty.inc.php:
- use correct variable name instead of $smarty in __construct()
- everything else in this commit: whitespace changes


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@964 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 4be543e313 adminlistadmin.tpl, adminlistdomain.tpl:
- fix undefined variables (by using $PALANG.* instead)

footer.tpl:
- remove undefined variable because the correct one is already included


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@963 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 07c21cfa07 VacationHandler.php:
- replaced deprecated split() call with explode()
  https://sourceforge.net/tracker/?func=detail&atid=937964&aid=3179951&group_id=191583


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@962 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 1de551320b DomainHandler.php:
- implement delete()

Note that this is a dummy function at the moment. It doesn't work,
it just errors out with "not implemented yet" ;-)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@961 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 2668f5a6c3 shells/domain.php: delete handling, adopted parameter changes
- adopted to changed parameters in DomainHander class
- implemented delete handling


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@960 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 562842f154 DomainHandler.php:
- return true/false instead of shell-style 0/1


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@959 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz d21bf2e82d DomainHandler.php: proofreading results: various small changes
- use $this->username for the domain name (I know the variable name is
  confusing, but I'd like to be consistent with the other classes)
- remove $domain parameter in add() and view(), use $this->username instead
- escape domain in view() for select query
- removed unused "global $config" in view()
- remove superfluous created/modified arrays in db_insert calls
- added some TODO notes
- changed db_log to 'CONSOLE' instead of $this-username for consistency
  with other classes. Long-term fix is to remove the first parameter of
  db_log and let it detect the username automatically.
- various whitespace fixes



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@958 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz a93d63a692 smarty.inc.php: interface cleanup etc.
- move initialisation of $smarty->template_dir, compile_dir and 
  config_dir into __construct() of PFASmarty class
- remove usage of /tmp/postfixadmin_templates_c/ to avoid security
  risks (symlink attacks etc.)
- remove __set, __get and __call from PFASmarty class to ensure we
  have a clearly documented interface to the template layer
- whitespace changes (mostly in select_options())
- added vim: line

See also the discussion about the r949 commit in postfixadmin-devel
for details.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@957 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz cebf126eff AliasHandler.php:
- escape $address in is_mailbox_alias()


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@956 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz e8beac17d0 index.tpl:
- footer.tpl was accidently lost in r951, added again


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


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@954 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin b0bd8cd1f5 see changeset:952 ... move php code out of template into here
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@953 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin a7942d7059 move this to common.php; i dislike inline php in templates
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@952 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin d798138d1d i prefer english... ;-)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@951 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin 43a150941b check if a variable is populated...
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@950 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin 7424cb0c1a remove strict standards issue with redefinition of smarty::assign() with different parameters than parent class; ideally I should not put the __get/__set/__call methods in here as living without them would reduce our dependency on smarty, but meh (PFASmarty should stil appear and BEHAVE like a Smarty object, it just technically is not one - it is just using one
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@949 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin cf22f1dfd4 reindent; give tMessage a default value (undefined var etc)
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@948 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
David Goodwin 834f533371 fix some undefined variables
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@947 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 515fa83809 upgrade.php: add vacation.activefrom/activeuntil even for updates from 2.3.x
- MySQL only allows one column with DEFAULT CURRENT_TIMESTAMP per table
  -> introduce {DATE} with DEFAULT 2000-01-01 as workaround
  -> GingerDog, please check if the PostgreSQL variant of {DATE} is valid
- disable upgrade_727_mysql because
  - function number is too small for upgrades from 2.3.x
  - MySQL only
  - it creates some tables PostfixAdmin doesn't use
- new function upgrade_946 to add activefrom/activeuntil fields to the
  vacation table (previously done in upgrade_727_mysql)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@946 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz fc26618140 upgrade.php: add "modified" column to vacation table, various fixes and new helper functions
- fix _pgsql_field_exists and _mysql_field_exists to work with 
  non-default table names
- new function _db_field_exists as database-independent wrapper for 
  _*_field_exists
- new function _db_add_field to add a field to a table
- new function printdebug for debug output (grey text)
- define {DATECURRENT} for timestamp fields (avoids lots of duplication)
  -> @GingerDog: please check if the PostgreSQL statement is correct!
- upgrade_945: add a 'modified' column to the vacation table
- various small changes (whitespace, comments, TODO notes etc.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@945 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Sebastian d3e68fdc8a two small bugfixes:
- syntax error
- fix commentation marks

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@944 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz fb6ee0ea9a sk.lang:
- big translation update by Ondrej Zary (rnbw @sf) - thanks!
  https://sourceforge.net/tracker/?func=detail&atid=937966&aid=3162501&group_id=191583

*.lang:
- added pViewlog_action_create_domain, pViewlog_action_delete_domain and
  pViewlog_action_edit_domain (was only in en.lang)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@942 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 412fe0fa48 UPGRADE.txt:
- renumbering headlines


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@941 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz ea6a7cef79 footer.tpl: remove escaping of $CONF[footer_link]
url-escaping $CONF[footer_link] makes the link look like
"http%3A%2F%2Fexample.com". Browsers interpret this as file name 
relative to the current domain and directory, not as full 
http://example.com URL. Removed escaping.

Thanks to jan-kruis @SF for pointing this out.
https://sourceforge.net/tracker/?func=detail&aid=3153035&group_id=191583&atid=937964


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@940 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 02391146b2 AliasHandler.php: fix false positives in is_mailbox_alias and various
small fixes and cleanups

- get(): whitespace fix
- is_mailbox_alias(): avoid false positives if $address is a mailbox,
- is_mailbox_alias(): remove disabled (commented) old code
- update(): remove unused variable $true
- delete(): removed superfluous parameter in $this->get() call
- delete(): removed outdated FIXME note


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@939 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz ccda9cd995 VacationHandler.php proofreading results: small changes and some TODO notes
- added several TODO notes
- use db_insert/db_update/db_delete instead of raw queries
- get_details(): error check first (for better readable code),
  whitespace fix
- getVacationAlias: str_replace is enough


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@938 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz fc4b51d938 various documentation updates:
INSTALL.TXT:
- added a note to read the official PostfixAdmin documentation first,
  and that "external" HOWTOs on the web are often outdated or incomplete.
  That might sound selfish, but would already have saved several users
  some time.
- updated some links
- added link to the wiki
- added hint about config.local.php
- added note about write access for templates_c directory for www-data

UPGRADE.txt
- added note about setup.php?debug=1
- added note about postfix config update (alias domains)
- added note about templates_c permissions


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@937 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 80412e4d60 list-virtual_alias.tpl: fix editing of aliases with $CONF[special_alias_control] == NO
- with special_alias_control = NO, no alias was editable.
  Fixed - only default_aliases should be locked (looks like == instead 
  of === needs to be used in smarty for bool comparison)
- merged conditions, simplified code


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@936 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Christian Boltz 0afa2957e6 config.inc.php:
- better documentation for $CONF[alias_control], $CONF[alias_control_admin]
  and $CONF[special_alias_control] because the existing comments were 
  confusing (as pointed out by libertytrek in #postfixadmin)


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@934 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Valkum f73c7cbad2 added some things to model class
added user_model.php for user handling
added user_controller.php for controlling user missgin view for output.


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@933 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
Valkum 0ca6c9f239 Done is_mailbox_alias todo. Now it checks against the database.
git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@932 a1433add-5e2c-0410-b055-b7f2511e0802
14 years ago
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
14 years ago
Christian Boltz 9aa96dabd0 (mostly) make CLI "alias delete" working
shells/alias.php:
- execute still called help() instead of __handle()

model/AliasHandler.php - delete():
- remove useless $address parameter from delete() (we have $this->username)
- added error messages
- fixed variable names for db_log

Reason for the "mostly":
The $this->is_mailbox_alias() in delete() always returns true and therefore
forbids deletion.


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