Ejemplo n.º 1
0
// vim:set ts=4 sw=4 sts=4 et:
require_once "config.php";
require_once "html.php";
require_once "db-func.php";
require_once "utils.php";
// Redirect to the login page, if not logged in
$uid = isLoggedIn();
// Start HTML
head("approver", "Approval Editor Overview");
if (!USING_APPROVERS) {
    echo "<div class='msg'>Puzzletron is not set up to use approvers</div>";
    foot();
    exit(1);
}
// Check for editor permissions
if (!isApprover($uid) && !isEditorChief($uid)) {
    echo "<div class='errormsg'>You do not have permission for this page.</div>";
    foot();
    exit(1);
}
if (array_key_exists('failedToAddEdit', $_SESSION) and $_SESSION['failedToAddEdit'] == TRUE) {
    echo "<div class='errormsg'>Failed to add puzzle to your editing queue<br/>";
    echo "Perhaps you are an author, are testsolving it, or are already editing it?</div>";
    unset($_SESSION['failedToAddEdit']);
}
displayPuzzleStats($uid);
?>
<br/>
<form action="form-submit.php" method="post">
    <input type="hidden" name="uid" value="<?php 
echo $uid;
Ejemplo n.º 2
0
function canChangeEditorsNeeded($uid, $pid)
{
    return isEditorChief($uid) || isAuthorOnPuzzle($uid, $pid) || isEditorOnPuzzle($uid, $pid);
}
Ejemplo n.º 3
0
function head($selnav = "", $title = -1)
{
    if ($title == -1) {
        $title = fullTitle();
    }
    $hunt = mktime(12, 17, 00, 1, HUNT_DOM, HUNT_YEAR);
    $now = time();
    $timediff = abs($hunt - $now);
    $days = (int) ($timediff / (60 * 60 * 24));
    $hrs = (int) ($timediff / (60 * 60)) - 24 * $days;
    $mins = (int) ($timediff / 60) - 24 * 60 * $days - 60 * $hrs;
    $cdmsg = "";
    if ($now > $hunt) {
        $cdmsg = "after hunt started!!!";
        $cdclass = "cunum";
    } else {
        $cdmsg = "left until hunt.";
        $cdclass = "cdnum";
    }
    ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    <link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico" />

    <!-- CSS -->
    <link rel="stylesheet" type="text/css" href="css/reset-min.css" />
    <link rel="stylesheet" type="text/css" href="css/base-min.css" />
    <link rel="stylesheet" type="text/css" href="css/fonts-min.css" />
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <?php 
    if ($selnav == "people" || $selnav == "account") {
        ?>
 <link rel="stylesheet" type="text/css" href="css/profiles.css" /> <?php 
    }
    ?>
    <title><?php 
    echo $title;
    ?>
</title>
    <script type='text/javascript' src='jquery-1.4.2.js'></script>
    <script type='text/javascript' src='jquery.tablesorter.min.js'></script>
    <script type="text/javascript" src='js.js'></script>
</head>
<body>
<div id="container">
    <div id="header">
        <div id="top">
            <div id="countdowndiv">
                <span id="countdown">
                <?php 
    if ($days !== 0) {
        $daypl = $days === 1 ? "" : "s";
        echo "<span class=\"{$cdclass}\">{$days}</span> day{$daypl}, ";
    }
    $hrpl = $hrs === 1 ? "" : "s";
    echo "<span class=\"{$cdclass}\">{$hrs}</span> hour{$hrpl} and ";
    $minpl = $mins === 1 ? "" : "s";
    echo "<span class=\"{$cdclass}\">{$mins}</span> minute{$minpl} {$cdmsg}";
    ?>
                </span>
            </div>
            <div id="titlediv">
                <h1><?php 
    echo fullTitle();
    ?>
</h1>
            </div>
            <div id="logindiv">
<?php 
    if (isset($_SESSION['uid'])) {
        echo 'Logged in as <strong>' . getUserUsername($_SESSION['uid']) . '</strong>';
        echo '<a href="account.php"' . ($selnav == "account" ? ' class="accsel"' : "") . '>Your Account</a>';
        if (MAILING_LISTS) {
            echo '<a href="mailinglists.php"' . ($selnav == "mailinglists" ? ' class="accsel"' : "") . '>Mailing Lists</a>';
        }
        if (!TRUST_REMOTE_USER) {
            echo '<a href="logout.php">Logout</a>';
        }
    } else {
        ?>
                <span class="notloggedin">Not logged in</span> <a href="login.php">Login</a>
        <?php 
    }
    ?>
            </div>
        </div>
        <div id="navbar">
            <ul class="nav">
                <li class="nav"><a class="nav wikinav" target="_blank" href="<?php 
    echo WIKI_URL;
    ?>
 ">Wiki</a></li>
<?php 
    echoNav($selnav == "home", "index.php", "Home", true);
    if (isset($_SESSION['uid'])) {
        $suid = $_SESSION['uid'];
        echoNav1($selnav, "people", "People", true);
        echoNav1($selnav, "admin", "Admin", isServerAdmin($suid));
        echoNav1($selnav, "author", "Author", true);
        echoNav1($selnav, "roundcaptain", "Round Captain", USING_ROUND_CAPTAINS && isRoundCaptain($suid));
        echoNav1($selnav, "spoiled", "Spoiled", true);
        echoNav1($selnav, "editor", "Discussion Editor", isEditor($suid));
        echoNav1($selnav, "approver", "Approval Editor", USING_APPROVERS && (isApprover($suid) || isEditorChief($suid)));
        echoNav1($selnav, "testsolving", "Testsolving", true);
        //    echoNav1($selnav, "factcheck",      "Fact Check",          true);
        echoNav1($selnav, "ffc", "Final Fact Check", true);
        echoNav1($selnav, "editorlist", "Editor List", isEditorChief($suid) || isServerAdmin($suid));
        echoNav1($selnav, "testadmin", "Testing Admin", isTestingAdmin($suid));
        echoNav1($selnav, "testsolveteams", "TS Team Assignments", USING_TESTSOLVE_TEAMS && isTestingAdmin($suid));
        echoNav1($selnav, "answers", "Answers", canChangeAnswers($suid));
        echoNav1($selnav, "allpuzzles", "All Puzzles", canSeeAllPuzzles($suid));
        echoNav1($selnav, "editor-pick-special", "Puzzles Needing Help", true);
    }
    ?>
            </ul>
        </div>
        <div class="clear"></div>
    </div>
    <div id="body">
<?php 
}
Ejemplo n.º 4
0
function displayTags($uid, $pid)
{
    ?>
    <tr>
        <td class='peopleInfo'>
            <strong>Tags:</strong> <?php 
    echo getTagsAsList($pid);
    ?>
&nbsp;&nbsp;
    <?php 
    if (isCohesion($uid) || isEditorChief($uid) || isServerAdmin($uid)) {
        ?>
<a href="#" class="changeLink">[Change]</a>
        </td>
    </tr>
    <tr>
        <td>
            <table>
            <form method="post" action="form-submit.php">
                <input type="hidden" name="uid" value="<?php 
        echo $uid;
        ?>
" />
                <input type="hidden" name="pid" value="<?php 
        echo $pid;
        ?>
" />
                <tr>
                    <td>
                        <p><strong>Remove Tags:</strong></p>
                        <?php 
        echo displayRemoveTags($pid);
        ?>
                    </td>
                    <td>
                        <p><strong>Add Tags:</strong></p>
                        <?php 
        echo displayAddTags($pid);
        ?>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <input type="submit" name="changeTags" value="Change Tags" />
                    </td>
                </tr>
            </form>
            </table>
    <?php 
    }
    ?>
        </td>
    </tr>
<?php 
}