/** * @return boolean true if the vacation is removed successfully. Else false. */ public function remove() { $vh = new VacationHandler($_SESSION['sessid']['username']); return $vh->remove(); }
if ($tActiveUntil >= date("Y-m-d") and $tActiveUntil >= $tActiveFrom) { if (!$vh->set_away($fSubject, $fBody, $fInterval_Time, $tActiveFrom, $tActiveUntil)) { $error = 1; } } else { if ($tActiveUntil < date("Y-m-d")) { flash_error($PALANG['pVacation_until_before_today']); } else { flash_error($PALANG['pVacation_until_before_from']); } $error = 1; } } //if change, remove old one, then perhaps set new one if (!empty($fBack)) { if (!$vh->remove()) { $error = 1; } } } // If NO error then diplay flash message and go back to right url where we came from if ($error == 0) { if (!empty($fBack)) { flash_info(sprintf($PALANG['pVacation_result_removed'], htmlentities($tUseremail))); header("Location: {$Return_url}"); exit; } if (!empty($fChange)) { flash_info(sprintf($PALANG['pVacation_result_added'], htmlentities($tUseremail))); header("Location: {$Return_url}"); exit;