$smarty->assign('errortype', 401);
    $smarty->assign('msg', tra("You do not have permission to use this feature"));
    $smarty->display("error.tpl");
    die;
}
if (!isset($_REQUEST["pollId"])) {
    $_REQUEST["pollId"] = 0;
}
$smarty->assign('pollId', $_REQUEST["pollId"]);
if (isset($_REQUEST["setlast"])) {
    check_ticket('admin-polls');
    $polllib->set_last_poll();
}
if (isset($_REQUEST["closeall"])) {
    check_ticket('admin-polls');
    $polllib->close_all_polls();
}
if (isset($_REQUEST["activeall"])) {
    check_ticket('admin-polls');
    $polllib->active_all_polls();
}
if ($_REQUEST["pollId"]) {
    $info = $polllib->get_poll($_REQUEST["pollId"]);
} else {
    $info = array();
    $info["title"] = '';
    $info["active"] = 'y';
    $info["publishDate"] = $tikilib->now;
}
$smarty->assign('title', $info["title"]);
$smarty->assign('active', $info["active"]);