Make VacationHandler compatible with MySQL strict mode again

The MySQL database layout includes a 'cache' column for historical
reasons, the PostgreSQL database never did.

r1883 removed the 'cache' column from VacationHandler to unbreak
PostgreSQL, and at the same time broke MySQL in strict mode.

This patch re-adds the 'cache' column only for MySQL to fix this
regression.



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1890 a1433add-5e2c-0410-b055-b7f2511e0802
pull/25/head
Christian Boltz 7 years ago committed by David Goodwin
parent bf9ec09829
commit 80d381f644

@ -26,6 +26,11 @@ class VacationHandler extends PFAHandler {
'modified' => pacol( 0, 0, 1, 'ts', 'last_modified' , '' ),
# TODO: add virtual 'notified' column and allow to display who received a vacation response?
);
if ( ! db_pgsql() ) {
$this->struct['cache'] = pacol( 0, 0, 0, 'text', '' , '' , '' ); # leftover from 2.2
}
}
protected function initMsg() {
@ -181,6 +186,10 @@ class VacationHandler extends PFAHandler {
'activeuntil' => $activeUntil,
);
if ( ! db_pgsql() ) {
$vacation_data['cache'] = ''; # leftover from 2.2
}
// is there an entry in the vacaton table for the user, or do we need to insert?
$table_vacation = table_by_key('vacation');
$result = db_query("SELECT * FROM $table_vacation WHERE email = '$E_username'");

Loading…
Cancel
Save