diff --git a/broadcast-message.php b/broadcast-message.php index 310ab2be..5b10e918 100644 --- a/broadcast-message.php +++ b/broadcast-message.php @@ -38,6 +38,8 @@ $smtp_from_email = smtp_get_admin_email(); if ($_SERVER['REQUEST_METHOD'] == "POST") { + if (safepost('token') != $_SESSION['PFA_token']) die('Invalid token!'); + if (empty($_POST['subject']) || empty($_POST['message']) || empty($_POST['name'])) { $error = 1; diff --git a/common.php b/common.php index 26ef9398..28bea047 100644 --- a/common.php +++ b/common.php @@ -22,6 +22,7 @@ if(!defined('POSTFIXADMIN')) { # already defined if called from setup.php if (!defined('POSTFIXADMIN_CLI')) { // this is the default; see also https://sourceforge.net/p/postfixadmin/bugs/347/ session_cache_limiter('nocache'); + session_name('postfixadmin_session'); session_start(); if (defined('POSTFIXADMIN_LOGOUT')) { diff --git a/debian/README.Debian b/debian/README.Debian index 9817bdbc..10ba713f 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -6,17 +6,6 @@ http://youserver/postfixadmin/setup.php works. This should guide you through the appropriate process. -Integration with Postfix, Dovecot etc. -====================================== - -Now that PostfixAdmin is working, you need to do some configuration -in Postfix, Dovecot etc. so that they use the domains, mailboxes and -aliases you setup in PostfixAdmin. - -The files in /usr/share/doc/postfixadmin/ directory explain which -settings you need to do/change. - - Recommended and Suggested Packages ================================== - Postfix diff --git a/debian/README.txt b/debian/README.txt index 0833c420..2aa45cc5 100644 --- a/debian/README.txt +++ b/debian/README.txt @@ -12,8 +12,10 @@ postfixadmin project), do the following : 1. Update debian/changelog; include your email address in the last change (this is used to determine a gpg key to use) -2. dpkg-buildpackage -rfakeroot +2. debian/rules prep -3. Look in ../ at the shiny .deb / .tar.gz +3. dpkg-buildpackage -rfakeroot -4. Profit. +4. Look in ../ at the shiny .deb / .tar.gz + +5. Profit. diff --git a/debian/apache.conf b/debian/apache/postfixadmin.conf similarity index 100% rename from debian/apache.conf rename to debian/apache/postfixadmin.conf diff --git a/debian/changelog b/debian/changelog index 91a0b9c3..c182dfdf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +postfixadmin (2.93-2) unstable; urgency=low + + * Replace debian/ using Debian v2.3.7-2. See Debian's #821643 + * This adds : PHP7 and Apache 2.4 support. + + -- David Goodwin Sun, 22 May 2016 19:41:01 +0100 + postfixadmin (2.93-1) unstable; urgency=low * New upstream release (effectively beta3 for v3.0) diff --git a/debian/control b/debian/control index cbb5918e..861cf7cf 100644 --- a/debian/control +++ b/debian/control @@ -2,23 +2,23 @@ Source: postfixadmin Section: admin Priority: optional Maintainer: Norman Messtorff -Build-Depends: debhelper (>= 7), po-debconf -Standards-Version: 3.9.3 -XS-Vcs-Svn: https://postfixadmin.svn.sourceforge.net/svnroot/postfixadmin/trunk -XS-Vcs-Browser: https://postfixadmin.svn.sourceforge.net/svnroot/postfixadmin/trunk +Uploaders: Gaudenz Steinlin , Christoph Martin +Build-Depends: debhelper (>= 7), po-debconf, dh-apache2 +Standards-Version: 3.9.5 +Vcs-Git: git://anonscm.debian.org/collab-maint/postfixadmin.git +Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/postfixadmin.git Homepage: http://postfixadmin.sourceforge.net Package: postfixadmin Architecture: all -Depends: debconf (>= 0.5), dbconfig-common, wwwconfig-common, apache2 | lighttpd | httpd, libapache2-mod-php5 | php5-cgi | php5, php5-cli, php5-imap, php5-mysql | php5-mysqlnd | php5-pgsql, mysql-client | postgresql-client | mariadb-client, ${misc:Depends} -Recommends: postfix-mysql | postfix-pgsql, mysql-server | postgresql-server | mariadb-server -Suggests: dovecot-common | courier-authlib-mysql | courier-authlib-postgresql +Depends: debconf (>= 0.5), dbconfig-common, wwwconfig-common, apache2 | lighttpd | httpd, libapache2-mod-php | php-cgi | php, php-imap, php-mysql | php-pgsql | php-mysqlnd | php-sqlite3, mysql-client | postgresql-client, ${misc:Depends} +Recommends: postfix-mysql | postfix-pgsql, virtual-mysql-server | postgresql | sqlite, zendframework, dovecot-core | courier-authlib-mysql | courier-authlib-postgresql, php-cli Description: Virtual mail hosting interface for Postfix Postfixadmin is a web interface to manage virtual users and domains - for a Postfix mail transport agent. It supports Virtual mailboxes, + for a Postfix mail transport agent. It supports Virtual mailboxes, aliases, forwarders and vacation. . - Postfixadmin allows administrators to delegate account handling + Postfixadmin allows administrators to delegate account handling to domain administrators and allows users to login and change their own settings (e.g. forwarders, vacation, passwords etc). . diff --git a/debian/lighttpd.conf b/debian/lighttpd/90-postfixadmin.conf similarity index 100% rename from debian/lighttpd.conf rename to debian/lighttpd/90-postfixadmin.conf diff --git a/debian/patches/db_credentials b/debian/patches/0001-db_credentials.patch similarity index 70% rename from debian/patches/db_credentials rename to debian/patches/0001-db_credentials.patch index 831f3345..8c299328 100644 --- a/debian/patches/db_credentials +++ b/debian/patches/0001-db_credentials.patch @@ -1,25 +1,31 @@ -Description: This patch sets the dbconfig placeholders in config.inc.php. -Forwarded: not-needed -Author: Norman Messtorff -Last-Update: 2012-05-28 +From: Norman Messtorff +Date: Sun, 23 Mar 2014 17:40:30 +0100 +Subject: db_credentials + +--- + config.inc.php | 19 ++++++++++++------- + 1 file changed, 12 insertions(+), 7 deletions(-) Index: postfixadmin/config.inc.php =================================================================== ---- postfixadmin.orig/config.inc.php 2015-09-26 15:03:05.000000000 +0100 -+++ postfixadmin/config.inc.php 2015-09-26 15:03:16.000000000 +0100 -@@ -15,6 +15,11 @@ +--- a/config.inc.php ++++ b/config.inc.php +@@ -15,6 +15,14 @@ * Contains configuration options. */ -+// This loads the automatic generated DB credentials from /etc/postfixadmin/dbconfig.inc.php -+require_once('/etc/postfixadmin/dbconfig.inc.php'); -+if (!isset($dbserver) || empty($dbserver)) ++ ++// Debian: This loads the automatic generated DB credentials from ++// /etc/postfixadmin/dbconfig.inc.php ++require_once('dbconfig.inc.php'); ++if (!isset($dbserver) || empty($dbserver)) { + $dbserver='localhost'; ++} + /***************************************************************** * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * You have to set $CONF['configured'] = true; before the -@@ -22,7 +27,7 @@ +@@ -22,7 +30,7 @@ * Doing this implies you have changed this file as required. * i.e. configuring database etc; specifying setup.php password etc. */ @@ -28,10 +34,10 @@ Index: postfixadmin/config.inc.php // In order to setup Postfixadmin, you MUST specify a hashed password here. // To create the hash, visit setup.php in a browser and type a password into the field, -@@ -80,11 +85,11 @@ - // mysql = MySQL 3.23 and 4.0, 4.1 or 5 +@@ -81,11 +89,11 @@ // mysqli = MySQL 4.1+ or MariaDB // pgsql = PostgreSQL + // sqlite = SQLite 3 -$CONF['database_type'] = 'mysqli'; -$CONF['database_host'] = 'localhost'; -$CONF['database_user'] = 'postfix'; @@ -45,3 +51,5 @@ Index: postfixadmin/config.inc.php // If you need to specify a different port for a MYSQL database connection, use e.g. // $CONF['database_host'] = '172.30.33.66:3308'; // If you need to specify a different port for POSTGRESQL database connection + + diff --git a/debian/patches/series b/debian/patches/series index 96306ea7..45264b7b 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1 @@ -db_credentials +0001-db_credentials.patch diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in deleted file mode 100644 index cef83a34..00000000 --- a/debian/po/POTFILES.in +++ /dev/null @@ -1 +0,0 @@ -[type: gettext/rfc822deb] templates diff --git a/debian/po/cs.po b/debian/po/cs.po deleted file mode 100644 index a8ac8a45..00000000 --- a/debian/po/cs.po +++ /dev/null @@ -1,32 +0,0 @@ -# Czech PO debconf template translation of postfixadmin. -# Copyright (C) 2012 Michal Simunek -# This file is distributed under the same license as the postfixadmin package. -# Michal Simunek , 2012. -# -msgid "" -msgstr "" -"Project-Id-Version: postfixadmin 2.3.5-1\n" -"Report-Msgid-Bugs-To: postfixadmin@packages.debian.org\n" -"POT-Creation-Date: 2008-10-27 22:14+0100\n" -"PO-Revision-Date: 2012-04-13 18:31+0200\n" -"Last-Translator: Michal Simunek \n" -"Language-Team: Czech \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "Web server to reconfigure automatically:" -msgstr "Automaticky přenastavit webový server:" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "" -"Please choose the web server that should be automatically configured to run " -"postfixadmin." -msgstr "" -"Zvolte si prosím webový server, který se má automaticky nastavit ke " -"spuštění postfixadmin." diff --git a/debian/po/da.po b/debian/po/da.po deleted file mode 100644 index 7bc115f0..00000000 --- a/debian/po/da.po +++ /dev/null @@ -1,34 +0,0 @@ -# Danish translation postfixadmin. -# Copyright (C) 2012 postfixadmin & nedenstående oversættere. -# This file is distributed under the same license as the postfixadmin package. -# Joe Hansen , 2012. -# -msgid "" -msgstr "" -"Project-Id-Version: postfixadmin\n" -"Report-Msgid-Bugs-To: postfixadmin@packages.debian.org\n" -"POT-Creation-Date: 2008-10-27 22:14+0100\n" -"PO-Revision-Date: 2012-04-11 19:21+0100\n" -"Last-Translator: Joe Hansen \n" -"Language-Team: Danish \n" -"Language: da\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "Web server to reconfigure automatically:" -msgstr "Internetserver at rekonfigurere automatisk:" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "" -"Please choose the web server that should be automatically configured to run " -"postfixadmin." -msgstr "" -"Vælg venligst internetserveren som automatisk skal konfigureres til at " -"køre postfixadmin." - diff --git a/debian/po/de.po b/debian/po/de.po deleted file mode 100644 index d5ac0a2f..00000000 --- a/debian/po/de.po +++ /dev/null @@ -1,32 +0,0 @@ -# German translation of debconf templates for postfixadmin. -# Copyright (C) 2012 Holger Wansing -# This file is distributed under the same license as the postfixadmin package. -# Holger Wansing , 2012. -# -msgid "" -msgstr "" -"Project-Id-Version: postfixadmin 2.3.5-1\n" -"Report-Msgid-Bugs-To: postfixadmin@packages.debian.org\n" -"POT-Creation-Date: 2008-10-27 22:14+0100\n" -"PO-Revision-Date: 2012-04-10 21:19+0200\n" -"Last-Translator: Holger Wansing \n" -"Language-Team: German \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "Web server to reconfigure automatically:" -msgstr "Webserver, der automatisch neu konfiguriert werden soll:" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "" -"Please choose the web server that should be automatically configured to run " -"postfixadmin." -msgstr "" -"Bitte wählen Sie den Webserver, der automatisch konfiguriert werden soll, um " -"Postfixadmin auszuführen." diff --git a/debian/po/es.po b/debian/po/es.po deleted file mode 100644 index 9c1bbe93..00000000 --- a/debian/po/es.po +++ /dev/null @@ -1,53 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# -# Changes: -# - Initial translation -# Matías Bellone , 2012 -# -# Traductores, si no conocen el formato PO, merece la pena leer la -# documentación de gettext, especialmente las secciones dedicadas a este -# formato, por ejemplo ejecutando: -# info -n '(gettext)PO Files' -# info -n '(gettext)Header Entry' -# -# Equipo de traducción al español, por favor, lean antes de traducir -# los siguientes documentos: -# -# - El proyecto de traducción de Debian al español -# http://www.debian.org/intl/spanish/ -# especialmente las notas de traducción en -# http://www.debian.org/intl/spanish/notas -# -# - La guía de traducción de po's de debconf: -# /usr/share/doc/po-debconf/README-trans -# o http://www.debian.org/intl/l10n/po-debconf/README-trans -# -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: postfixadmin@packages.debian.org\n" -"POT-Creation-Date: 2008-10-27 22:14+0100\n" -"PO-Revision-Date: 2012-04-15 04:27:00+00:00\n" -"Last-Translator: Matías Bellone \n" -"Language-Team: Debian Spanish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "Web server to reconfigure automatically:" -msgstr "Servidor web a reconfigurar automáticamente:" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "" -"Please choose the web server that should be automatically configured to run " -"postfixadmin." -msgstr "" -"Seleccione el servidor web que deberá ser configurado automáticamente " -"para ejecutar «postfixadmin»." diff --git a/debian/po/fr.po b/debian/po/fr.po deleted file mode 100644 index 11223fb6..00000000 --- a/debian/po/fr.po +++ /dev/null @@ -1,35 +0,0 @@ -# Translation of postfixadmin debconf template to French. -# Copyright (C) 2012 Debian French l10n team -# This file is distributed under the same license as the postfixadmin package. -# Translators: -# Christian Perrier , 2012. -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: postfixadmin@packages.debian.org\n" -"POT-Creation-Date: 2008-10-27 22:14+0100\n" -"PO-Revision-Date: 2012-04-07 19:46+0200\n" -"Last-Translator: Christian Perrier \n" -"Language-Team: French \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: fr\n" -"X-Generator: Lokalize 1.2\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "Web server to reconfigure automatically:" -msgstr "Serveur web à reconfigurer automatiquement :" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "" -"Please choose the web server that should be automatically configured to run " -"postfixadmin." -msgstr "" -"Veuillez choisir le serveur web qui doit être configuré automatiquement pour " -"exécuter postfixadmin." diff --git a/debian/po/it.po b/debian/po/it.po deleted file mode 100644 index 4c37ecf8..00000000 --- a/debian/po/it.po +++ /dev/null @@ -1,34 +0,0 @@ -# Italian translation of postfixadmin debconf messages. -# Copyright (C) 2012 postfixadmin package copyright holder -# This file is distributed under the same license as the postfixadmin package. -# Beatrice Torracca , 2012. -msgid "" -msgstr "" -"Project-Id-Version: postfixadmin\n" -"Report-Msgid-Bugs-To: postfixadmin@packages.debian.org\n" -"POT-Creation-Date: 2008-10-27 22:14+0100\n" -"PO-Revision-Date: 2012-04-07 16:15+0200\n" -"Last-Translator: Beatrice Torracca \n" -"Language-Team: Italian \n" -"Language: it\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Virtaal 0.7.1\n" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "Web server to reconfigure automatically:" -msgstr "Server web da riconfigurare automaticamente:" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "" -"Please choose the web server that should be automatically configured to run " -"postfixadmin." -msgstr "" -"Scegliere il server web che deve essere configurato automaticamente per " -"eseguire postfixadmin." diff --git a/debian/po/nl.po b/debian/po/nl.po deleted file mode 100644 index 9b9f32cd..00000000 --- a/debian/po/nl.po +++ /dev/null @@ -1,32 +0,0 @@ -# Dutch translation of postfixadmin debconf templates. -# Copyright (C) 2012 THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the postfixadmin package. -# Jeroen Schot , 2012. -# -msgid "" -msgstr "" -"Project-Id-Version: postfixadmin 2.3.5-1\n" -"Report-Msgid-Bugs-To: postfixadmin@packages.debian.org\n" -"POT-Creation-Date: 2008-10-27 22:14+0100\n" -"PO-Revision-Date: 2012-04-12 15:26+0200\n" -"Last-Translator: Jeroen Schot \n" -"Language-Team: Debian l10n Dutch \n" -"Language: nl\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "Web server to reconfigure automatically:" -msgstr "Automatisch te configureren webserver:" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "" -"Please choose the web server that should be automatically configured to run " -"postfixadmin." -msgstr "" -"Welke webserver moet automatisch worden geconfigureerd voor postfixadmin?" diff --git a/debian/po/pl.po b/debian/po/pl.po deleted file mode 100644 index 31842398..00000000 --- a/debian/po/pl.po +++ /dev/null @@ -1,37 +0,0 @@ -# Translation of ostfixadmi debconf templates to Polish. -# Copyright (C) 2008 -# This file is distributed under the same license as the ostfixadmi package. -# -# Michał Kułach , 2012. -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: postfixadmin@packages.debian.org\n" -"POT-Creation-Date: 2008-10-27 22:14+0100\n" -"PO-Revision-Date: 2012-04-07 18:47+0200\n" -"Last-Translator: Michał Kułach \n" -"Language-Team: Polish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: pl\n" -"X-Generator: Lokalize 1.2\n" -"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " -"|| n%100>=20) ? 1 : 2);\n" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "Web server to reconfigure automatically:" -msgstr "Serwer WWW do automatycznej konfiguracji:" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "" -"Please choose the web server that should be automatically configured to run " -"postfixadmin." -msgstr "" -"Proszę wybrać serwer WWW, który powinien być automatycznie skonfigurowany w " -"celu uruchomienia postfixadmin." - diff --git a/debian/po/pt.po b/debian/po/pt.po deleted file mode 100644 index 89c17c4d..00000000 --- a/debian/po/pt.po +++ /dev/null @@ -1,32 +0,0 @@ -# Portuguese translation for postfixadmin (debconf) -# This file is distributed under the same license as the postfixadmin package. -# Rui Branco , 2012. -# -msgid "" -msgstr "" -"Project-Id-Version: postfixadmin 2.3.5-1\n" -"Report-Msgid-Bugs-To: postfixadmin@packages.debian.org\n" -"POT-Creation-Date: 2008-10-27 22:14+0100\n" -"PO-Revision-Date: 2012-04-09 21:26+0100\n" -"Last-Translator: Rui Branco \n" -"Language-Team: Portuguese \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n!=1);\n" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "Web server to reconfigure automatically:" -msgstr "Servidor Web a reconfigurar automaticamente:" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "" -"Please choose the web server that should be automatically configured to run " -"postfixadmin." -msgstr "" -"Por favor escolha o servidor web a ser reconfigurado para correr o " -"postfixadmin." diff --git a/debian/po/ru.po b/debian/po/ru.po deleted file mode 100644 index 31c1b920..00000000 --- a/debian/po/ru.po +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the postfixadmin package. -# -# Yuri Kozlov , 2012. -msgid "" -msgstr "" -"Project-Id-Version: 2.3.5-1\n" -"Report-Msgid-Bugs-To: postfixadmin@packages.debian.org\n" -"POT-Creation-Date: 2008-10-27 22:14+0100\n" -"PO-Revision-Date: 2012-04-09 20:40+0400\n" -"Last-Translator: Yuri Kozlov \n" -"Language-Team: Russian \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ru\n" -"X-Generator: Lokalize 1.2\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<" -"=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "Web server to reconfigure automatically:" -msgstr "Веб-сервер для автоматической перенастройки:" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "" -"Please choose the web server that should be automatically configured to run " -"postfixadmin." -msgstr "" -"Выберите веб-сервер, который нужно автоматически настроить для запуска " -"dpostfixadmin." - diff --git a/debian/po/sv.po b/debian/po/sv.po deleted file mode 100644 index 7df9247f..00000000 --- a/debian/po/sv.po +++ /dev/null @@ -1,33 +0,0 @@ -# Translation of postfixadmin debconf template to Swedish -# Copyright (C) 2012 Martin Bagge -# This file is distributed under the same license as the postfixadmin package. -# -# Martin Bagge , 2012 -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: postfixadmin@packages.debian.org\n" -"POT-Creation-Date: 2008-10-27 22:14+0100\n" -"PO-Revision-Date: 2012-04-10 18:40+0100\n" -"Last-Translator: Martin Bagge / brother \n" -"Language-Team: Swedish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Poedit-Language: Swedish\n" -"X-Poedit-Country: Sweden\n" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "Web server to reconfigure automatically:" -msgstr "Webbservrar som ska ställas in automatiskt:" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "" -"Please choose the web server that should be automatically configured to run " -"postfixadmin." -msgstr "" -"Välj webbservrar som automatiskt ska ställas in för att köra postfixadmin." diff --git a/debian/po/templates.pot b/debian/po/templates.pot deleted file mode 100644 index 761557aa..00000000 --- a/debian/po/templates.pot +++ /dev/null @@ -1,31 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: postfixadmin@packages.debian.org\n" -"POT-Creation-Date: 2008-10-27 22:14+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "Web server to reconfigure automatically:" -msgstr "" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "" -"Please choose the web server that should be automatically configured to run " -"postfixadmin." -msgstr "" diff --git a/debian/po/zh_TW.po b/debian/po/zh_TW.po deleted file mode 100644 index 39f79e09..00000000 --- a/debian/po/zh_TW.po +++ /dev/null @@ -1,31 +0,0 @@ -# Chinese translations for PACKAGE package. -# Copyright (C) 2012 THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# Vincent Chen , 2012. -# -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: postfixadmin@packages.debian.org\n" -"POT-Creation-Date: 2008-10-27 22:14+0100\n" -"PO-Revision-Date: 2012-04-09 18:25-0700\n" -"Last-Translator: Vincent Chen \n" -"Language-Team: Chinese (traditional)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: zh_TW\n" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "Web server to reconfigure automatically:" -msgstr "網頁伺服器將自動重新設定:" - -#. Type: multiselect -#. Description -#: ../templates:1001 -msgid "" -"Please choose the web server that should be automatically configured to run " -"postfixadmin." -msgstr "請選擇要自動執行 postfixadmin 的網頁伺服器" diff --git a/debian/postfixadmin.apache2 b/debian/postfixadmin.apache2 new file mode 100644 index 00000000..771059e2 --- /dev/null +++ b/debian/postfixadmin.apache2 @@ -0,0 +1 @@ +conf debian/apache/postfixadmin.conf \ No newline at end of file diff --git a/debian/postfixadmin.config b/debian/postfixadmin.config index 9de7af4f..25fbd3bd 100644 --- a/debian/postfixadmin.config +++ b/debian/postfixadmin.config @@ -2,9 +2,6 @@ set -e . /usr/share/debconf/confmodule -db_version 2.0 -db_input high postfixadmin/reconfigure-webserver || true -db_go || true if [ -f /usr/share/dbconfig-common/dpkg/config ]; then # we support mysql and pgsql diff --git a/debian/postfixadmin.dirs b/debian/postfixadmin.dirs index c5c52bf3..688e63bb 100644 --- a/debian/postfixadmin.dirs +++ b/debian/postfixadmin.dirs @@ -2,4 +2,3 @@ usr/share/postfixadmin usr/share/postfixadmin/css usr/share/doc/postfixadmin etc/postfixadmin -etc/apache2/conf.d diff --git a/debian/postfixadmin.install b/debian/postfixadmin.install index dba83688..93b04f15 100644 --- a/debian/postfixadmin.install +++ b/debian/postfixadmin.install @@ -1,14 +1,8 @@ *.php usr/share/postfixadmin -*.js usr/share/postfixadmin -configs usr/share/postfixadmin css usr/share/postfixadmin images usr/share/postfixadmin languages usr/share/postfixadmin model usr/share/postfixadmin -scripts usr/share/postfixadmin -smarty usr/share/postfixadmin templates usr/share/postfixadmin -templates_c usr/share/postfixadmin users usr/share/postfixadmin -debian/apache.conf etc/postfixadmin -debian/lighttpd.conf etc/postfixadmin +debian/lighttpd/90-postfixadmin.conf etc/lighttpd/conf-available diff --git a/debian/postfixadmin.maintscript b/debian/postfixadmin.maintscript new file mode 100644 index 00000000..c176d1c5 --- /dev/null +++ b/debian/postfixadmin.maintscript @@ -0,0 +1,3 @@ +# move webserver configuration files +mv_conffile /etc/postfixadmin/apache.conf /etc/apache2/conf-available/postfixadmin.conf 2.3.7-1~ +mv_conffile /etc/postfixadmin/lighttpd.conf /etc/lighttpd/conf-available/postfixadmin.conf 2.3.7-1~ diff --git a/debian/postfixadmin.postinst b/debian/postfixadmin.postinst index 5d361676..7b15a089 100644 --- a/debian/postfixadmin.postinst +++ b/debian/postfixadmin.postinst @@ -8,24 +8,17 @@ if [ "$1" = "configure" ]; then . /usr/share/debconf/confmodule . /usr/share/dbconfig-common/dpkg/postinst dbc_go postfixadmin $@ - - # configure webserver stuff - db_get postfixadmin/reconfigure-webserver - servers="$RET" - restart="$servers" - linkdestination_apache="../../postfixadmin/apache.conf" - linkdestination_lighttpd="../../postfixadmin/lighttpd.conf" - linkname="postfixadmin" - if [ -e /usr/share/wwwconfig-common/confd-link.sh ]; then - . /usr/share/wwwconfig-common/confd-link.sh - else - . /usr/share/postfixadmin/confd-link.sh - fi - . /usr/share/wwwconfig-common/restart.sh fi -#DEBHELPER# +# remove legacy apache and lighthttpd configuration symlink, +# conf.d is no longer supported with Apache 2.4 +if [ "$(readlink /etc/apache2/conf.d/postfixadmin)" = "../../postfixadmin/apache.conf" ]; then + rm -f /etc/apache2/conf.d/postfixadmin +fi +if [ "$(readlink /etc/lighttpd/conf-available/postfixadmin)" = "../../postfixadmin/lighttpd.conf" ]; then + rm -f /etc/lighttpd/conf-available/postfixadmin +fi -chown www-data /usr/share/postfixadmin/templates_c +#DEBHELPER# exit 0 diff --git a/debian/postfixadmin.postrm b/debian/postfixadmin.postrm index 1ef33b06..1fe5d81c 100644 --- a/debian/postfixadmin.postrm +++ b/debian/postfixadmin.postrm @@ -6,16 +6,6 @@ if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then . /usr/share/debconf/confmodule db_version 2.0 - # restart the webserver only if we know which one was configured. - if db_get postfixadmin/reconfigure-webserver; then - servers="$RET" - restart=$servers - linkname="postfixadmin" - if [ -e /usr/share/wwwconfig-common/restart.sh ]; then - . /usr/share/wwwconfig-common/restart.sh - fi - fi - if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then . /usr/share/dbconfig-common/dpkg/postrm dbc_go postfixadmin $@ diff --git a/debian/postfixadmin.prerm b/debian/postfixadmin.prerm index 87241c47..3b553f1e 100644 --- a/debian/postfixadmin.prerm +++ b/debian/postfixadmin.prerm @@ -8,17 +8,4 @@ if [ -f /usr/share/dbconfig-common/dpkg/prerm ]; then dbc_go postfixadmin $@ fi -if [ -f /usr/share/debconf/confmodule ]; then - . /usr/share/debconf/confmodule - db_version 2.0 - db_get postfixadmin/reconfigure-webserver - servers="$RET" - linkname="postfixadmin" - if [ -e /usr/share/wwwconfig-common/confd-link.sh ]; then - . /usr/share/wwwconfig-common/confd-link.sh - else - . /usr/share/postfixadmin/confd-link.sh - fi -fi - #DEBHELPER# diff --git a/debian/rules b/debian/rules index bae9ca0d..6f631941 100755 --- a/debian/rules +++ b/debian/rules @@ -7,6 +7,12 @@ export VERSION = $(shell grep -E "version = '.*';" functions.inc.php |sed -e "s/.version = '//" |sed -e "s/';.*//" |sed -e "s/ /-/g") export DEBVERSION = $(shell grep -E "postfixadmin .([0-9]+|\.)+" debian/changelog |head -1 |sed -e "s/postfixadmin .//" |sed -e "s/-.*//") + +# Create a needed tar.gz file to build a non-nativ .dpkg +prep: + rm -f ../postfixadmin_*orig.tar.gz + cd ..; tar --exclude-vcs --exclude=$(notdir ${CURDIR})/debian --exclude=$(notdir ${CURDIR})/.pc -cvzf postfixadmin_${DEBVERSION}.orig.tar.gz $(notdir ${CURDIR}) + build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp @@ -14,16 +20,10 @@ build-stamp: dh_testdir touch build-stamp -# Create a needed tar.gz file to build a non-nativ .dpkg -prep: - rm -f ../postfixadmin_*orig.tar.gz - cd ..; tar --exclude-vcs --exclude=$(notdir ${CURDIR})/debian --exclude=$(notdir ${CURDIR})/.pc -cvzf postfixadmin_${DEBVERSION}.orig.tar.gz $(notdir ${CURDIR}) - clean: dh_testdir dh_testroot dh_clean - debconf-updatepo install: build dh_testdir @@ -31,12 +31,9 @@ install: build dh_prep dh_installdirs dh_install + dh_apache2 mv debian/postfixadmin/usr/share/postfixadmin/config.inc.php debian/postfixadmin/etc/postfixadmin/config.inc.php find debian/postfixadmin -name .svn | xargs -r rm -r - chmod +x debian/postfixadmin/usr/share/postfixadmin/scripts/postfixadmin-cli - chmod +x debian/postfixadmin/usr/share/postfixadmin/scripts/postfixadmin-cli.php - chown www-data debian/postfixadmin/usr/share/postfixadmin/templates_c - # Build architecture-independent files here. binary-indep: build install diff --git a/debian/stamp-patched b/debian/stamp-patched new file mode 100644 index 00000000..e69de29b diff --git a/debian/templates b/debian/templates deleted file mode 100644 index 9405de95..00000000 --- a/debian/templates +++ /dev/null @@ -1,6 +0,0 @@ -Template: postfixadmin/reconfigure-webserver -Type: multiselect -Choices: apache2, apache, apache-ssl, apache-perl, lighttpd -_Description: Web server to reconfigure automatically: - Please choose the web server that should be automatically configured - to run postfixadmin. diff --git a/edit.php b/edit.php index d3044db6..b8c9544c 100644 --- a/edit.php +++ b/edit.php @@ -93,6 +93,7 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") { if ($_SERVER['REQUEST_METHOD'] == "POST") { + if (safepost('token') != $_SESSION['PFA_token']) die('Invalid token!'); $inp_values = safepost('value', array() ); foreach($form_fields as $key => $field) { diff --git a/functions.inc.php b/functions.inc.php index 3f88915f..b116951c 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -16,6 +16,7 @@ */ $version = '2.93'; +$min_db_version = 1835; # update (at least) before a release with the latest function numbrer in upgrade.php /** * check_session @@ -1754,7 +1755,34 @@ function table_by_key ($table_key) { return $CONF['database_prefix'].$table; } +/* + * check if the database layout is up to date + * returns the current 'version' value from the config table + * if $error_out is True (default), die() with a message that recommends to run setup.php. + */ +function check_db_version($error_out = True) { + global $min_db_version; + + $table = table_by_key('config'); + + $sql = "SELECT value FROM $table WHERE name = 'version'"; + $r = db_query($sql); + + if($r['rows'] == 1) { + $row = db_assoc($r['result']); + $dbversion = $row['value']; + } else { + $dbversion = 0; + db_query("INSERT INTO $table (name, value) VALUES ('version', '0')", 0, ''); + } + if ( ($dbversion < $min_db_version) && $error_out == True) { + echo "ERROR: The PostfixAdmin database layout is outdated (you have r$dbversion, but r$min_db_version is expected).\nPlease run setup.php to upgrade the database.\n"; + exit(1); + } + + return $dbversion; +} /* Called after an alias_domain has been deleted in the DBMS. diff --git a/languages/de.lang b/languages/de.lang index 20810d5e..91a385f3 100644 --- a/languages/de.lang +++ b/languages/de.lang @@ -14,14 +14,14 @@ $PALANG['exit'] = 'Verlassen'; $PALANG['cancel'] = 'Abbrechen'; $PALANG['save'] = 'Änderungen speichern'; $PALANG['confirm'] = 'Sind Sie sicher dass Sie das löschen wollen?\n'; -$PALANG['confirm_delete_admin'] = 'Do you really want to delete the admin %s?'; # XXX -$PALANG['confirm_delete_alias'] = 'Do you really want to delete the alias %s?'; # XXX -$PALANG['confirm_delete_aliasdomain'] = 'Do you really want to delete the alias domain %s?'; # XXX +$PALANG['confirm_delete_admin'] = 'Wollen Sie wirklich den Admin %s löschen?'; +$PALANG['confirm_delete_alias'] = 'Wollen Sie wirklich den Alias %s löschen?'; +$PALANG['confirm_delete_aliasdomain'] = 'Wollen Sie wirklich die Admin-Domain %s löschen?'; $PALANG['confirm_delete_domain'] = 'Wollen Sie wirklich alle Einträge der Domain %s löschen? Dies kann NICHT rückgängig gemacht werden!'; -$PALANG['confirm_delete_fetchmail'] = 'Do you really want to delete the fetchmail job %s?'; # XXX -$PALANG['confirm_delete_mailbox'] = 'Do you really want to delete the mailbox %s?'; # XXX -$PALANG['confirm_delete_vacation'] = 'Do you really want to delete the vacation message for %s?'; # XXX -$PALANG['no_delete_permissions'] = 'You are not allowed to delete %s!'; # XXX +$PALANG['confirm_delete_fetchmail'] = 'Wollen Sie wirklich den Fetchmail-Job %s löschen?'; +$PALANG['confirm_delete_mailbox'] = 'Wollen Sie wirklich die Mailbox %s löschen?'; +$PALANG['confirm_delete_vacation'] = 'Wollen Sie wirklich die Abwesenheitsnachricht für %s löschen?'; +$PALANG['no_delete_permissions'] = 'Sie dürfen %s nicht löschen!'; $PALANG['check_update'] = 'Auf Updates überprüfen'; $PALANG['invalid_parameter'] = 'Ungültiger Parameter!'; $PALANG['show'] = 'Anzeigen:'; @@ -31,7 +31,7 @@ $PALANG['unknown'] = 'unbekannt'; $PALANG['download_csv'] = 'Diese Liste als CSV-Datei herunterladen'; $PALANG['missing_field'] = 'Das Feld %s fehlt'; $PALANG['must_be_numeric'] = '%s muss numerisch sein'; -$PALANG['must_be_numeric_bigger_than_null'] = '%s must be numeric and bigger than 0'; # XXX +$PALANG['must_be_numeric_bigger_than_null'] = '%s muss numerisch und größer als 0 sein'; $PALANG['must_be_boolean'] = "%s muss ein Bool'scher Wert sein"; $PALANG['invalid_value_given'] = 'Ungültiger Wert für %s angegeben'; $PALANG['edit_not_allowed'] = 'Sie dürfen %s nicht bearbeiten!'; @@ -181,8 +181,8 @@ $PALANG['pVacation_result_added'] = 'Automatische Antwort für %s wurde aktivier $PALANG['pVacation_reply_type'] = 'Choice of reply'; # XXX $PALANG['pVacation_reply_delay_time'] = 'Interval time'; # XXX $PALANG['pVacation_reply_delay_time_text'] = 'Zeit in Sekunden'; -$PALANG['pVacation_until_before_today'] = 'The Date of [Active until] is set before Today'; # XXX -$PALANG['pVacation_until_before_from'] = 'The Date of [Active until] is set before [Active from]'; # XXX +$PALANG['pVacation_until_before_today'] = 'Das Datum von [Aktiv bis] ist in der Vergangenheit'; +$PALANG['pVacation_until_before_from'] = 'Das Datum von [Aktiv bis] ist vor [Aktiv ab]'; $PALANG['reply_once'] = 'Einmal antworten'; $PALANG['reply_every_mail'] = 'Jede Mail beantworten'; $PALANG['reply_once_per_day'] = 'Einmal pro Tag antworten'; @@ -213,9 +213,9 @@ $PALANG['pViewlog_action_create_admin'] = 'Admin erstellen'; $PALANG['pViewlog_action_edit_admin'] = 'Admin ändern'; $PALANG['pViewlog_action_delete_admin'] = 'Admin löschen'; $PALANG['pViewlog_action_edit_vacation'] = 'Automatische Antwort ändern'; -$PALANG['pViewlog_action_create_fetchmail'] = 'create fetchmail job'; # XXX -$PALANG['pViewlog_action_edit_fetchmail'] = 'edit fetchmail job'; # XXX -$PALANG['pViewlog_action_delete_fetchmail'] = 'delete fetchmail job'; # XXX +$PALANG['pViewlog_action_create_fetchmail'] = 'Fetchmail-Job erstellen'; +$PALANG['pViewlog_action_edit_fetchmail'] = 'Fetchmail-Job bearbeiten'; +$PALANG['pViewlog_action_delete_fetchmail'] = 'Fetchmail-Job löschen'; $PALANG['pViewlog_result_error'] = 'Kann keine Einträge finden!'; @@ -272,8 +272,8 @@ $PALANG['pAdminEdit_domain_maxquota'] = 'Max Quota'; $PALANG['pAdminEdit_domain_maxquota_text'] = 'MB | -1 = ausschalten | 0 = kein Limit'; $PALANG['pAdminEdit_domain_quota'] = 'Domain Quota'; $PALANG['transport'] = 'Transport'; -$PALANG['pAdminEdit_domain_transport_text'] = 'Define transport'; -$PALANG['pAdminEdit_domain_backupmx'] = 'Mail server is backup MX'; +$PALANG['pAdminEdit_domain_transport_text'] = 'Transport festlegen'; +$PALANG['pAdminEdit_domain_backupmx'] = 'Mail server ist Backup-MX'; $PALANG['pAdminEdit_domain_result_error'] = 'Das Ändern der Domain %s ist fehlgeschlagen'; $PALANG['pAdminCreate_admin_welcome'] = 'Neuen Domain-Admin hinzufügen'; @@ -344,8 +344,8 @@ $PALANG['pInvalidMailRegex'] = "Ungültige Mailadresse %s - Überprüfung per Re $PALANG['pFetchmail_welcome'] = 'E-Mail Abruf für: '; $PALANG['pFetchmail_new_entry'] = 'Neuer Eintrag'; -$PALANG['fetchmail_already_exists'] = 'This fetchmail job already exists!'; # XXX -$PALANG['fetchmail_does_not_exist'] = 'This fetchmail job does not exist!'; # XXX +$PALANG['fetchmail_already_exists'] = 'Dieser Fetchmail-Job existiert schon!'; +$PALANG['fetchmail_does_not_exist'] = 'Dieser Fetchmail-Job existiert nicht!'; $PALANG['pFetchmail_database_save_error'] = 'Eintrag konnte nicht in der Datenbank gespeichert werden!'; $PALANG['pFetchmail_database_save_success'] = 'Eintrag wurde in der Datenbank gespeichert'; $PALANG['pFetchmail_error_invalid_id'] = 'Kein Eintrag mit ID %s gefunden!'; diff --git a/login.php b/login.php index 4d83ae0d..42acda0c 100644 --- a/login.php +++ b/login.php @@ -34,6 +34,7 @@ if($CONF['configured'] !== true) { exit; } +check_db_version(); # check if the database layout is up to date (and error out if not) if ($_SERVER['REQUEST_METHOD'] == "POST") { diff --git a/model/PFAHandler.php b/model/PFAHandler.php index 61c91c87..0a47b466 100644 --- a/model/PFAHandler.php +++ b/model/PFAHandler.php @@ -228,7 +228,7 @@ abstract class PFAHandler { * *vtxt "virtual" line of text, coming from JOINs etc. * html raw html (use carefully, won't get auto-escaped by smarty! Don't use with user input!) * pass password (will be encrypted with pacrypt()) - * b64p password (will be stored with base64_encode()) + * b64p password (will be stored with base64_encode() - but will NOT be decoded automatically) * num number * txtl text "list" - array of one line texts * *vnum "virtual" number, coming from JOINs etc. @@ -566,14 +566,14 @@ abstract class PFAHandler { if (db_pgsql()) { $formatted_date = "TO_DATE(text(###KEY###), '" . escape_string(Config::Lang('dateformat_pgsql')) . "')"; - $base64_decode = "DECODE(###KEY###, 'base64')"; + # $base64_decode = "DECODE(###KEY###, 'base64')"; } elseif (db_sqlite()) { $formatted_date = "strftime(###KEY###, '" . escape_string(Config::Lang('dateformat_mysql')) . "')"; - $base64_decode = "base64_decode(###KEY###)"; + # $base64_decode = "base64_decode(###KEY###)"; } else { $formatted_date = "DATE_FORMAT(###KEY###, '" . escape_string(Config::Lang('dateformat_mysql')) . "')"; - $base64_decode = "FROM_BASE64(###KEY###)"; + # $base64_decode = "FROM_BASE64(###KEY###)"; # requires MySQL >= 5.6 } $colformat = array( @@ -582,7 +582,7 @@ abstract class PFAHandler { # 'bool' fields are always returned as 0/1, additonally _$field contains yes/no (already translated) 'bool' => "CASE ###KEY### WHEN '" . db_get_boolean(true) . "' THEN '1' WHEN '" . db_get_boolean(false) . "' THEN '0' END as ###KEY###," . "CASE ###KEY### WHEN '" . db_get_boolean(true) . "' THEN '$yes' WHEN '" . db_get_boolean(false) . "' THEN '$no' END as _###KEY###", - 'b64p' => "$base64_decode AS ###KEY###", + # 'b64p' => "$base64_decode AS ###KEY###", # not available in MySQL < 5.6, therefore not decoding for any database ); # get list of fields to display diff --git a/model/VacationHandler.php b/model/VacationHandler.php index 6a9fe099..61394bcf 100644 --- a/model/VacationHandler.php +++ b/model/VacationHandler.php @@ -21,7 +21,7 @@ class VacationHandler extends PFAHandler { 'body' => pacol( 1, 1, 0, 'text', 'pUsersVacation_body' , '' , '' ), 'activefrom' => pacol( 1, 1, 1, 'text', 'pUsersVacation_activefrom' , '' , '' ), 'activeuntil' => pacol( 1, 1, 1, 'text', 'pUsersVacation_activeuntil' , '' , '' ), -# 'cache' => pacol( 0, 0, 0, 'text', '' , '' , '' ), # leftover from 2.2 + 'cache' => pacol( 0, 0, 0, 'text', '' , '' , '' ), # leftover from 2.2 'active' => pacol( 1, 1, 1, 'bool', 'active' , '' , 1 ), 'created' => pacol( 0, 0, 1, 'ts', 'created' , '' ), 'modified' => pacol( 0, 0, 1, 'ts', 'last_modified' , '' ), @@ -180,6 +180,7 @@ class VacationHandler extends PFAHandler { 'active' => db_get_boolean(true), 'activefrom' => $activeFrom, 'activeuntil' => $activeUntil, + 'cache' => '', ); // is there an entry in the vacaton table for the user, or do we need to insert? diff --git a/scripts/postfixadmin-cli.php b/scripts/postfixadmin-cli.php index c78f61e8..904956bc 100644 --- a/scripts/postfixadmin-cli.php +++ b/scripts/postfixadmin-cli.php @@ -34,7 +34,7 @@ class PostfixAdmin { /** - * Version + * Version * * @var string */ @@ -170,13 +170,16 @@ class PostfixAdmin { define('PATH', $this->params['webroot'] ); } else { define('PATH', CORE_PATH); - } + } if (!file_exists(PATH)) { $this->stderr( PATH . " don't exists"); return false; } + # make sure global variables fron functions.inc.php end up in the global namespace, instead of being local to this function + global $version, $min_db_version; + if (!require_once(PATH . '/common.php')) { $this->stderr("Failed to load " . PATH . '/common.php'); return false; @@ -190,6 +193,8 @@ class PostfixAdmin { public function dispatch() { $CONF = Config::read('all'); + check_db_version(); # ensure the database layout is up to date + if (!isset($this->args[0])) { $this->help(); return; diff --git a/sendmail.php b/sendmail.php index b3f5ad83..bb5e3e7c 100644 --- a/sendmail.php +++ b/sendmail.php @@ -39,6 +39,8 @@ $smtp_from_email = smtp_get_admin_email(); if ($_SERVER['REQUEST_METHOD'] == "POST") { + if (safepost('token') != $_SESSION['PFA_token']) die('Invalid token!'); + $fTo = safepost('fTo'); $fFrom = $smtp_from_email; $fSubject = safepost('fSubject'); diff --git a/templates/broadcast-message.tpl b/templates/broadcast-message.tpl index a0969f87..68eeeb29 100644 --- a/templates/broadcast-message.tpl +++ b/templates/broadcast-message.tpl @@ -1,5 +1,6 @@
+ diff --git a/templates/editform.tpl b/templates/editform.tpl index 01af0a47..b9cc84c2 100644 --- a/templates/editform.tpl +++ b/templates/editform.tpl @@ -1,6 +1,7 @@
+
{$PALANG.pBroadcast_title}
diff --git a/templates/password.tpl b/templates/password.tpl index 728345e0..8c815c95 100644 --- a/templates/password.tpl +++ b/templates/password.tpl @@ -1,5 +1,6 @@
+
diff --git a/templates/sendmail.tpl b/templates/sendmail.tpl index b33af3df..2c2e9d2c 100644 --- a/templates/sendmail.tpl +++ b/templates/sendmail.tpl @@ -1,5 +1,6 @@
+
{$PALANG.pPassword_welcome}
diff --git a/templates/users_edit-alias.tpl b/templates/users_edit-alias.tpl index 1c959fa0..c6b5b1fb 100644 --- a/templates/users_edit-alias.tpl +++ b/templates/users_edit-alias.tpl @@ -1,5 +1,6 @@
+
{$PALANG.pSendmail_welcome}
diff --git a/templates/vacation.tpl b/templates/vacation.tpl index 3af2b555..6e1a51a4 100644 --- a/templates/vacation.tpl +++ b/templates/vacation.tpl @@ -3,6 +3,7 @@ {/literal}
+
{$PALANG.pEdit_alias_welcome}
{$PALANG.pEdit_alias_help}
diff --git a/upgrade.php b/upgrade.php index ddaefa80..95e52eee 100644 --- a/upgrade.php +++ b/upgrade.php @@ -131,21 +131,7 @@ if($CONF['database_type'] == 'pgsql') { db_query_parsed($mysql, 0, " ENGINE = MYISAM COMMENT = 'PostfixAdmin settings'"); } -$sql = "SELECT * FROM $table WHERE name = 'version'"; - -// insert into config('version', '01'); - -$r = db_query($sql); - -if($r['rows'] == 1) { - $rs = $r['result']; - $row = db_array($rs); - $version = $row['value']; -} else { - db_query_parsed("INSERT INTO $table (name, value) VALUES ('version', '0')", 0, ''); - $version = 0; -} - +$version = check_db_version(False); _do_upgrade($version); function _do_upgrade($current_version) { diff --git a/users/edit-alias.php b/users/edit-alias.php index 099f63fa..fe685ca2 100644 --- a/users/edit-alias.php +++ b/users/edit-alias.php @@ -52,6 +52,8 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") if ($_SERVER['REQUEST_METHOD'] == "POST") { + if (safepost('token') != $_SESSION['PFA_token']) die('Invalid token!'); + // user clicked on cancel button if(isset($_POST['fCancel'])) { header("Location: main.php"); diff --git a/users/login.php b/users/login.php index e697c95f..41fbd214 100644 --- a/users/login.php +++ b/users/login.php @@ -30,6 +30,7 @@ $rel_path = '../'; define('POSTFIXADMIN_LOGOUT', 1); require_once("../common.php"); +check_db_version(); # check if the database layout is up to date (and error out if not) if ($_SERVER['REQUEST_METHOD'] == "POST") { diff --git a/users/password.php b/users/password.php index f6976df8..b1ee8308 100644 --- a/users/password.php +++ b/users/password.php @@ -37,6 +37,8 @@ $pPassword_password_current_text = ""; if ($_SERVER['REQUEST_METHOD'] == "POST") { + if (safepost('token') != $_SESSION['PFA_token']) die('Invalid token!'); + if(isset($_POST['fCancel'])) { header("Location: main.php"); exit(0); diff --git a/vacation.php b/vacation.php index 331a8799..a4212d3c 100644 --- a/vacation.php +++ b/vacation.php @@ -103,6 +103,8 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") { if ($_SERVER['REQUEST_METHOD'] == "POST") { + if (safepost('token') != $_SESSION['PFA_token']) die('Invalid token!'); + if(isset($_POST['fCancel'])) { header ("Location: $Return_url"); exit(0);
{$PALANG.pUsersVacation_welcome}