##############################################################################
# RCPFA (RoundCube-PostFixAdmin)
#
# Author: Nejc Škoberne <nejc.skoberne@infrax.si>
##############################################################################
#
#
# RCPFA is a patchet of php files which patch the RoundCube software to 
# interoperate with PostfixAdmin.
#
# Feature list and changelog:
#
# Version 1.0.4 (Nov 13 2008):
#  - fixed for RoundCube 0.2-beta 2008-09-21. Thanks to Jan Hejl who provided
#    this version.
#
# Version 1.0.3 (Jul 28 2008):
#  - there was a bug which caused vacation not to work properly after there
#    were some senders already notified - after turning vacation off and then
#    back on, entries from vacation_notification would not be purged
#  - PostfixAdmin's md5crypt encryption type now works
#  - WARNING: rcpfa 1.0.3 does not work with latest SVN revisions any more.
#    You should use 0.2-alpha or later revision (1531 works for sure, I don't
#    know which revision exactly made rcpfa incompatible with roundcube).
#    However, since I'm busy with other things at the moment, I guess I'll
#    wait for the next official release (will it be beta?) and then update
#    the patchset accordingly.
#
# Version 1.0.2 (Jun 16 2008):
#  - vacation notification didn't work - the script didn't update the alias,
#    only the record in vacation table; for vacation to work, there is also
#    a new parameter pfa_autoreply_domain in main.inc.php, which must be set
#    properly (as in PostfixAdmin's config file)
#  - fixed references to RoundCube - the latest version is 0.2-alpha, not
#    2.0.0alpha - sorry for the mess
#
# Version 1.0.1 (Jun 16 2008):
#  - fix this installation file (it threw an error that diff.diff is missing,
#    which is OK, because we don't need this file)
#  - it is confirmed that the patchset patches the 0.2-alpha version of RC
#    nicely, I have not tested if it works, though
#
# Version 1.0 (Jun 15 2008):
#  - automatically copy user full name from PostfixAdmin database and 
#    preconfigured organization into the default identity
#  - manage vacation settings in RoundCube
#  - change password in RoundCube
#  - manage forwarding settings in RoundCube
#  - the interface is very similar to PostfixAdmin's
#  - the patchset was tested on RoundCube from SVN (rev. 1531) but should also 
#    work at least on RoundCube 0.2-alpha.
#
# This is a very primitive installation script.
#
# First, you should make sure that you already have db.inc.php and main.inc.php
# config files in your config subdir of RoundCube root directory. If you don't
# have them, you can just copy the default files which come with RoundCube
# (they have .dist extension).
#
# Then you should uncompress this package into a Roundcube root directory.
# After uncompression, new directory "rcpfa-x.x.x" should appear. Then you 
# should do something like:
#
# $ cd rcpfa-x.x.x
# $ sh INSTALL.TXT
#
# If you prefer, you can also execute the steps below by hand.
#
# After you have patched the RoundCube, have a look at it's configuration
# files main.inc.php and db.inc.php - in the end of both you should find
# additional sections for PostfixAdmin configuration.
#
# Please report bugs and feature requests via e-mail to <nejc@skoberne.net>.
# If you find these patches useful as I do, you can also check my wishlist
# at https://www.amazon.com/gp/registry/wishlist/3V7ZRMUJT59L3. :)
#
##############################################################################

cp code/forwarding.html ../skins/default/templates
cp code/password.html ../skins/default/templates
cp code/vacation.html ../skins/default/templates
cp code/pfa_forwarding.inc ../program/steps/settings
cp code/pfa_password.inc ../program/steps/settings
cp code/pfa_vacation.inc ../program/steps/settings
cp code/pfa.php ../program/include

patch -d .. -p1 < diffs/app.js.diff
patch -d .. -p1 < diffs/db.inc.php.diff
patch -d .. -p1 < diffs/func.inc.diff
patch -d .. -p1 < diffs/index.php.diff
patch -d .. -p1 < diffs/labels.inc.diff
patch -d .. -p1 < diffs/main.inc.diff
patch -d .. -p1 < diffs/main.inc.php.diff
patch -d .. -p1 < diffs/messages.inc.diff
patch -d .. -p1 < diffs/rcube_user.php.diff
patch -d .. -p1 < diffs/settingstabs.html.diff
