* this package in the file LICENSE.TXT. * * Further details on the project are available at http://postfixadmin.sf.net * * @version $Id: main.php 1558 2013-11-10 15:57:32Z christian_boltz $ * @license GNU GPL v2 or later. * * File: main.php * 'Home page' for logged in users. * Template File: main.php * * Template Variables: * * tummVacationtext * * Form POST \ GET Variables: -none- */ $rel_path = '../'; require_once '../common.php'; authentication_require_role('user'); $USERID_USERNAME = authentication_get_username(); $vh = new VacationHandler($USERID_USERNAME); if ($vh->check_vacation()) { $tummVacationtext = $PALANG['pUsersMain_vacationSet']; } else { $tummVacationtext = $PALANG['pUsersMain_vacation']; } $smarty->assign('tummVacationtext', $tummVacationtext); $smarty->assign('smarty_template', 'users_main'); $smarty->display('index.tpl'); /* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */
/** * @param string $subject * @param string $body * @param string $interval_time * @param string $activeFrom * @param string $activeUntil * @return boolean true on success. * Whatiis @replyType?? for */ public function setAway($subject, $body, $interval_time = 0, $activeFrom = '2000-01-01', $activeUntil = '2099-12-31') { $vh = new VacationHandler($_SESSION['sessid']['username']); return $vh->set_away($subject, $body, $interval_time, $activeFrom, $activeUntil); }
# TODO: better error message } } else { $Admin_role = 0; $Return_url = "main.php"; authentication_require_role('user'); $fUsername = authentication_get_username(); } // is vacation support enabled in $CONF ? if ($CONF['vacation'] == 'NO') { header("Location: {$Return_url}"); exit(0); } date_default_timezone_set(@date_default_timezone_get()); # Suppress date.timezone warnings $vh = new VacationHandler($fUsername); $choice_of_reply = Config::read('vacation_choice_of_reply'); foreach (array_keys($choice_of_reply) as $key) { $choice_of_reply[$key] = Config::Lang($choice_of_reply[$key]); } if ($_SERVER['REQUEST_METHOD'] == "GET") { $tSubject = ''; $tBody = ''; $tActiveFrom = ''; $tActiveUntil = ''; $tUseremail = $fUsername; $tInterval_Time = ''; $details = $vh->get_details(); if ($details != false) { $tSubject = $details['subject']; $tBody = $details['body'];