get_details()) { $tSubject = $details['subject']; $tBody = $details['body']; } if($vh->check_vacation()) { $tMessage = $PALANG['pUsersVacation_welcome_text']; } if ($tSubject == '') { $tSubject = html_entity_decode($PALANG['pUsersVacation_subject_text'], ENT_QUOTES, 'UTF-8'); } if ($tBody == '') { $tBody = html_entity_decode($PALANG['pUsersVacation_body_text'], ENT_QUOTES, 'UTF-8'); } } if ($_SERVER['REQUEST_METHOD'] == "POST") { if(isset($_POST['fCancel'])) { header("Location: main.php"); exit(0); } if (isset ($_POST['fSubject'])) $fSubject = escape_string ($_POST['fSubject']); if (isset ($_POST['fBody'])) $fBody = escape_string ($_POST['fBody']); if (isset ($_POST['fAway'])) $fAway = escape_string ($_POST['fAway']); if (isset ($_POST['fBack'])) $fBack = escape_string ($_POST['fBack']); //set a default, reset fields for coming back selection if ($tSubject == '') { $tSubject = html_entity_decode($PALANG['pUsersVacation_subject_text'], ENT_QUOTES, 'UTF-8'); } if ($tBody == '') { $tBody = html_entity_decode($PALANG['pUsersVacation_body_text'], ENT_QUOTES, 'UTF-8'); } // if they've set themselves away OR back, delete any record of vacation emails. // the user is going away - set the goto alias and vacation table as necessary. if (!empty ($fAway)) { if(!$vh->set_away($fSubject, $fBody)) { $error = 1; $tMessage = $PALANG['pUsersVacation_result_error']; } flash_info($PALANG['pVacation_result_added']); header ("Location: main.php"); exit; } if (!empty ($fBack)) { $vh->remove(); $tMessage = $PALANG['pUsersVacation_result_success']; flash_info($tMessage); header ("Location: main.php"); exit; } } include ("../templates/header.php"); include ("../templates/users_menu.php"); include ("../templates/users_vacation.php"); include ("../templates/footer.php"); /* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */ ?>