allow vacation settings to include a time (but specify a time if one is not), this should stop us overwriting the time - see https://sourceforge.net/p/postfixadmin/discussion/676076/thread/5637ae3bc5/?limit=25#24a5

This commit is contained in:
David Goodwin committed 2021-05-13 16:15:45 +01:00
1 parent 166a151854
commit f30ae89bb4
2 files changed
+10 -4

No files matched your search

+9 -3
View File
@@ -218,9 +218,15 @@ class VacationHandler extends PFAHandler {
public function set_away($subject, $body, $interval_time, $activeFrom, $activeUntil) {
$this->remove(); // clean out any notifications that might already have been sent.
$E_username = escape_string($this->username);
$activeFrom = date("Y-m-d 00:00:00", strtotime($activeFrom)); # TODO check if result looks like a valid date
$activeUntil = date("Y-m-d 23:59:59", strtotime($activeUntil)); # TODO check if result looks like a valid date
if (preg_match('/^\d{4}-\d{2}-\d{2}$/', $activeFrom)) {
$activeFrom .= ' 00:00:00';
}
if (preg_match('/^\d{4}-\d{2}-\d{2}$/', $activeUntil)) {
$activeUntil .= ' 23:59:59';
}
$activeFrom = date("Y-m-d H:i", strtotime($activeFrom)); # TODO check if result looks like a valid date
$activeUntil = date("Y-m-d H:i", strtotime($activeUntil)); # TODO check if result looks like a valid date
list(/*NULL*/, $domain) = explode('@', $this->username);
$vacation_data = array(
+1 -1
View File
@@ -154,7 +154,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
if ($action == 'fChange') {
## check if ActiveUnitl is not back in time,
## check if ActiveUntil is not back in time,
## because vacation.pl will report SMTP recipient $smtp_recipient which resolves to $email does not have an active vacation (rv: $rv, email: $email)"
## and will not send message