예제 #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;
예제 #2
0
function printPerson($p)
{
    $id = $p['uid'];
    $uname = $p['username'];
    $picture = $p['picture'];
    $fullname = $p['fullname'];
    $email = $p['email'];
    if (strncmp($uname, "test", 4) == 0) {
        // Ignore test users.
        return;
    }
    $pic = "<img src=\"nophoto.gif\" />";
    if ($picture != "") {
        if (USING_AWS) {
            $picsrc = "https://" . AWS_BUCKET . ".s3.amazonaws.com/uploads/pictures/thumbs/{$id}.jpg";
            $pic = "<img src=\"" . $picsrc . "\" />";
        } else {
            $picsrc = "uploads/pictures/thumbs/{$id}.jpg";
            if (file_exists($picsrc)) {
                $pic = "<img src=\"" . $picsrc . "\" />";
            }
        }
    }
    $jobNames = getUserJobsAsList($id);
    if (canSeeAllPuzzles($id)) {
        $profclass = "seeallprofilebox";
    } else {
        if (isApprover($id)) {
            $profclass = "approverprofilebox";
        } else {
            if ($jobNames) {
                $profclass = "specprofilebox";
            } else {
                $profclass = "profilebox";
            }
        }
    }
    ?>
    <div class="<?php 
    echo $profclass;
    ?>
">
        <div class="profileimg"><?php 
    echo $pic;
    ?>
</div>
        <div class="profiletxt">
            <span class="profilename"><?php 
    echo "{$fullname}";
    ?>
 (<?php 
    echo "{$uname}";
    ?>
)</span>
            <span class="profiletitle"><?php 
    echo $jobNames;
    ?>
</span>
            <span class="profilecontact"><a href="mailto:<?php 
    echo $email;
    ?>
"><?php 
    echo $email;
    ?>
</a></span>
<?php 
    $sql = "SELECT * FROM user_info_key";
    $result = get_rows($sql);
    foreach ($result as $r) {
        $shortname = $r['shortname'];
        $longname = $r['longname'];
        $user_key_id = $r['id'];
        $sql = sprintf("SELECT value FROM user_info_values WHERE person_id = '%s' AND user_info_key_id = '%s'", mysql_real_escape_string($id), mysql_real_escape_string($user_key_id));
        $res = get_rows($sql);
        if (count($res) > 0 && $res[0]['value'] != "") {
            ?>
            <span class="profilesect"><?php 
            echo "<b>{$longname}</b>: " . $res[0]['value'];
            ?>
</span>
<?php 
        }
    }
    ?>
        </div>
        <div class="profilefooter"></div>
    </div>
<?php 
}
예제 #3
0
<?php

// 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("answers", "Answers");
// Check for answers permissions
if (!canChangeAnswers($uid) && !isApprover($uid)) {
    echo "<div class='errormsg'>You do not have permission for this page.</div>";
    foot();
    exit(1);
}
if (isset($_POST['newAnswer'])) {
    $result = submitAnswersForm(strtoupper($_POST['newAnswer']), $_POST['round']);
    if ($result == FALSE) {
        echo '<div class="errormsg">Error in submitting new answer</div>';
    }
}
if (isset($_POST['newRound'])) {
    $result = submitNewRound($_POST['newRound'], strtoupper($_POST['roundAnswer']));
    if ($result == FALSE) {
        echo '<div class="errormsg">Error in submitting new round</div>';
    }
}
displayAnswers($uid);
// End HTML
예제 #4
0
function isApproverAvailable($uid, $pid)
{
    return isApprover($uid) && !isAuthorOnPuzzle($uid, $pid) && !isEditorOnPuzzle($uid, $pid) && !isApproverOnPuzzle($uid, $pid) && !isTesterOnPuzzle($uid, $pid);
}
예제 #5
0
<?php

// 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("allpuzzles", "All Puzzles");
echo '<style type="text/css">.puzzideasummary {background-color: #000000;}</style>';
// Check for lurker permissions
if (!canSeeAllPuzzles($uid) && !isApprover($uid)) {
    echo "<div class='errormsg'>You do not have permissions for this page.</div>";
    foot();
    exit(1);
}
$filt = isValidPuzzleFilter();
function selected($key, $value)
{
    global $filt;
    if (count($filt) == 2 && $filt[0] == $key && $filt[1] == $value) {
        return "selected";
    }
    return "";
}
displayPuzzleStats($uid);
?>
    <div class="inlbox">
    <form method="get" action="allpuzzles.php" class="inlform">