예제 #1
0
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
require "header.php";
// Gets args from POST
$quote = stripslashes_if_gpc_magic_quotes($_POST["quote"]);
// Replace IRC "<" and ">" characters with the HTML equivalent.
// Then strip newlines from the top and bottom of the quote.
$quote_lt = ereg_replace('<', '&lt;', $quote);
$quote_gt = ereg_replace('>', '&gt;', $quote_lt);
$quote_lb = trim($quote_gt);
// Insert into database as new. We leave out ID number cause the
// database will autoincrement that field by itself.
$st = $db->prepare('INSERT INTO miniqdb (epoch,quote) VALUES (?,?)');
$st->execute(array(date('U'), $quote_lb));
$id = $db->lastInsertId();
echo "<p>quote posted</p>";
echo "<p>Quote <a href=\"quote.php?id={$id}\">{$id}</a> was just added.</p>";
echo "<p><a href=\"index.php\">Go back to the QDB</a></p>";
echo $footer;
예제 #2
0
}
if (isset($_POST["password"]) and $_POST["password"]) {
    $password = $_POST["password"];
} else {
    $result = "passwordrequired";
}
if (isset($_REQUEST["login"]) and $_REQUEST["login"]) {
    $login = $_REQUEST["login"];
} else {
    $result = "loginrequired";
}
# Strip slashes added by PHP
$login = stripslashes_if_gpc_magic_quotes($login);
$password = stripslashes_if_gpc_magic_quotes($password);
$question = stripslashes_if_gpc_magic_quotes($question);
$answer = stripslashes_if_gpc_magic_quotes($answer);
# Check the entered username for characters that our installation doesn't support
if ($result === "") {
    $result = check_username_validity($login, $login_forbidden_chars);
}
#==============================================================================
# Check reCAPTCHA
#==============================================================================
if ($result === "") {
    if ($use_recaptcha) {
        $resp = recaptcha_check_answer($recaptcha_privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
        if (!$resp->is_valid) {
            $result = "badcaptcha";
            error_log("Bad reCAPTCHA attempt with user {$login}");
        }
    }
예제 #3
0
파일: grade.php 프로젝트: ynarwal/scavhunt
        $answers = unserialize(file_get_contents($answerFile));
        if (isset($answers[$challengeId])) {
            $respondents++;
            echo '<strong>' . h($user['last'] . ', ' . $user['first']) . '</strong><br /><table border="1">';
            foreach ($answers[$challengeId] as $questionNumber => $answer) {
                if (isset($answers[$challengeId . '_assigned'])) {
                    // This was a multi-answerable question, currently just matching students to prior answers
                    $assigned = $answers[$challengeId . '_assigned'][$questionNumber];
                    if (is_array($answer)) {
                        $answer = $answer[0];
                    }
                    echo '<tr><th>' . printNameFromId($assigned) . '</th><td>' . nl2br(h(stripslashes_if_gpc_magic_quotes($answer))) . '</td></tr>';
                } else {
                    // Just a standard single-shot question
                    echo '<tr><th>' . chr(65 + $questionNumber) . '</th><td>';
                    if (substr($answer, 0, 5) == 'file:') {
                        $parts = explode(':', $answer);
                        $type = $parts[1];
                        echo '<a target="_blank" href="getupload.php?challenge=' . urlencode($_REQUEST['challenge']) . '&user='******'id']) . '&num=' . urlencode($questionNumber) . '&type=' . urlencode($type) . '">' . h($type) . ' file</a>';
                    } else {
                        echo nl2br(h(stripslashes_if_gpc_magic_quotes($answer)));
                    }
                    echo '</td></tr>';
                }
            }
            echo '</table>';
            echo 'Score: <input type="text" size="5" name="newScores[' . $user['id'] . ']" value="' . $scores[$challengeId][$user['id']] . '" /><br /><br />';
        }
    }
}
echo '<input type="submit" value="Save" /></form><br />(' . $respondents . ' respondents)';
if (isset($_POST["question"]) and $_POST["question"]) {
    $question = $_POST["question"];
} else {
    $result = "questionrequired";
}
if (isset($_REQUEST["login"]) and $_REQUEST["login"]) {
    $login = $_REQUEST["login"];
} else {
    $result = "loginrequired";
}
# Strip slashes added by PHP
$login = stripslashes_if_gpc_magic_quotes($login);
$question = stripslashes_if_gpc_magic_quotes($question);
$answer = stripslashes_if_gpc_magic_quotes($answer);
$newpassword = stripslashes_if_gpc_magic_quotes($newpassword);
$confirmpassword = stripslashes_if_gpc_magic_quotes($confirmpassword);
# Check the entered username for characters that our installation doesn't support
if ($result === "") {
    $result = check_username_validity($login, $login_forbidden_chars);
}
#==============================================================================
# Check reCAPTCHA
#==============================================================================
if ($result === "") {
    if ($use_recaptcha) {
        $resp = recaptcha_check_answer($recaptcha_privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
        if (!$resp->is_valid) {
            $result = "badcaptcha";
            error_log("Bad reCAPTCHA attempt with user {$login}");
        }
    }
예제 #5
0
$ldap = "";
$userdn = "";
$token = "";
if (isset($_POST["mail"]) and $_POST["mail"]) {
    $mail = $_POST["mail"];
} else {
    $result = "mailrequired";
}
if (isset($_REQUEST["login"]) and $_REQUEST["login"]) {
    $login = $_REQUEST["login"];
} else {
    $result = "loginrequired";
}
# Strip slashes added by PHP
$login = stripslashes_if_gpc_magic_quotes($login);
$mail = stripslashes_if_gpc_magic_quotes($mail);
# Check the entered username for characters that our installation doesn't support
if ($result === "") {
    $result = check_username_validity($login, $login_forbidden_chars);
}
#==============================================================================
# Check reCAPTCHA
#==============================================================================
if ($result === "") {
    if ($use_recaptcha) {
        $resp = recaptcha_check_answer($recaptcha_privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
        if (!$resp->is_valid) {
            $result = "badcaptcha";
            error_log("Bad reCAPTCHA attempt with user {$login}");
        }
    }
예제 #6
0
    if (decrypt($token, $keyphrase) == $smstoken) {
        $result = "buildtoken";
    } else {
        $result = "tokennotvalid";
    }
} elseif (isset($_REQUEST["sms"]) and isset($_REQUEST["login"])) {
    $sms = decrypt($_REQUEST["sms"], $keyphrase);
    $login = $_REQUEST["login"];
    $result = "sendsms";
} elseif (isset($_REQUEST["login"]) and $_REQUEST["login"]) {
    $login = $_REQUEST["login"];
} else {
    $result = "loginrequired";
}
# Strip slashes added by PHP
$login = stripslashes_if_gpc_magic_quotes($login);
# Check the entered username for characters that our installation doesn't support
if ($result === "") {
    $result = check_username_validity($login, $login_forbidden_chars);
}
#==============================================================================
# Check reCAPTCHA
#==============================================================================
if ($result === "") {
    if ($use_recaptcha) {
        $resp = recaptcha_check_answer($recaptcha_privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
        if (!$resp->is_valid) {
            $result = "badcaptcha";
            error_log("Bad reCAPTCHA attempt with user {$login}");
        }
    }
예제 #7
0
 @($Project->DisplayLabels = stripslashes_if_gpc_magic_quotes($_POST["displayLabels"]));
 @($Project->ShowCoverageCode = stripslashes_if_gpc_magic_quotes($_POST["showCoverageCode"]));
 @($Project->AutoremoveTimeframe = stripslashes_if_gpc_magic_quotes($_POST["autoremoveTimeframe"]));
 @($Project->AutoremoveMaxBuilds = stripslashes_if_gpc_magic_quotes($_POST["autoremoveMaxBuilds"]));
 /** Calculate the upload quota */
 if (isset($_POST['uploadQuota'])) {
     $uploadQuota = $_POST['uploadQuota'];
 } else {
     $uploadQuota = $CDASH_MAX_UPLOAD_QUOTA;
 }
 if (is_numeric($uploadQuota) && $uploadQuota > 0) {
     $Project->UploadQuota = floor(min($uploadQuota, $CDASH_MAX_UPLOAD_QUOTA) * 1024 * 1024 * 1024);
 }
 /** If we are managing clients */
 if ($CDASH_MANAGE_CLIENTS) {
     $Project->CTestTemplateScript = stripslashes_if_gpc_magic_quotes($_POST["ctestTemplateScript"]);
 }
 $Project->Save();
 // Add the logo
 if (array_key_exists('logo', $_FILES) && strlen($_FILES['logo']['tmp_name']) > 0) {
     $handle = fopen($_FILES['logo']['tmp_name'], "r");
     $contents = 0;
     if ($handle) {
         $contents = addslashes(fread($handle, $_FILES['logo']['size']));
         $filetype = $_FILES['logo']['type'];
         fclose($handle);
         unset($handle);
     }
     $Project->AddLogo($contents, $filetype);
 }
 // Add repositories
예제 #8
0
     $clientJobSchedule->Enable = 0;
 }
 $clientJobSchedule->StartDate = htmlspecialchars(pdo_real_escape_string($_POST['startdate']));
 if (empty($clientJobSchedule->StartDate)) {
     $clientJobSchedule->StartDate = date('Y-m-d H:i:s');
 }
 $clientJobSchedule->EndDate = htmlspecialchars(pdo_real_escape_string($_POST['enddate']));
 if (empty($clientJobSchedule->EndDate)) {
     $clientJobSchedule->EndDate = '1980-01-01 00:00:00';
 }
 $clientJobSchedule->StartTime = htmlspecialchars(pdo_real_escape_string($_POST['starttime']));
 $clientJobSchedule->Type = htmlspecialchars(pdo_real_escape_string($_POST['type']));
 $clientJobSchedule->RepeatTime = htmlspecialchars(pdo_real_escape_string($_POST['repeat']));
 $clientJobSchedule->CMakeCache = stripslashes_if_gpc_magic_quotes($_POST['cmakecache']);
 $clientJobSchedule->Description = stripslashes_if_gpc_magic_quotes($_POST['description']);
 $clientJobSchedule->ClientScript = stripslashes_if_gpc_magic_quotes($_POST['clientscript']);
 if (!empty($_POST['update'])) {
     $clientJobSchedule->Id = $scheduleid;
 }
 $clientJobSchedule->Save();
 // Remove everything and add them back in
 $clientJobSchedule->RemoveDependencies();
 // Add the os
 if (isset($_POST['system'])) {
     foreach ($_POST['system'] as $osid) {
         $clientJobSchedule->AddOS($osid);
     }
 }
 // Add the compiler
 if (isset($_POST['compiler'])) {
     foreach ($_POST['compiler'] as $compilerid) {
예제 #9
0
</title>
<meta name="verify-v1" content="KlSUQDVnMzXQ1UZyxpTl+k1WeDIqIRqRpB2QyOHBRKA=" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="<?php 
if (isset($_GET['post'])) {
    echo formTagMeta($post->tags);
} else {
    echo META_KEYWORD;
}
?>
" />
<meta name="description" content="<?php 
if (isset($_GET['post'])) {
    echo htmlentities(stripslashes_if_gpc_magic_quotes($post->post_h2));
} else {
    echo htmlentities(stripslashes_if_gpc_magic_quotes(META_DESC));
}
?>
" />
<link rel="alternate" type="application/rss+xml" title="Swapnil Sarwe - RSS" href="<?php 
echo HTTP_SERVER;
?>
feed.rss" />
<link rel="alternate" type="application/rss+xml" title="Swapnil Sarwe - Feedburner" href="http://feeds.feedburner.com/swapnilsarwefeed" />
<link href="<?php 
echo HTTP_SERVER;
?>
css/style.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="<?php 
echo HTTP_SERVER;
?>