本文整理汇总了PHP中pdo_real_escape_numeric函数的典型用法代码示例。如果您正苦于以下问题:PHP pdo_real_escape_numeric函数的具体用法?PHP pdo_real_escape_numeric怎么用?PHP pdo_real_escape_numeric使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pdo_real_escape_numeric函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
// Check if the SubProject filter was specified.
// If so, we won't add SQL clauses for some other filters.
// Instead we handle them in PHP code via build_survives_filter().
$this->HasSubProjectsFilter = false;
$filtercount = pdo_real_escape_numeric(@$_REQUEST['filtercount']);
for ($i = 1; $i <= $filtercount; ++$i) {
if (empty($_REQUEST['field' . $i])) {
continue;
}
$field = htmlspecialchars(pdo_real_escape_string($_REQUEST['field' . $i]));
if ($field === 'subprojects') {
$this->HasSubProjectsFilter = true;
break;
}
}
$this->FiltersAffectedBySubProjects = array('buildduration', 'builderrors', 'buildwarnings', 'configureduration', 'configureerrors', 'configurewarnings', 'testsduration', 'testsfailed', 'testsnotrun', 'testspassed', 'testtimestatus');
}
示例2: str_replace
=========================================================================*/
// To be able to access files in this CDash installation regardless
// of getcwd() value:
//
$cdashpath = str_replace('\\', '/', dirname(dirname(__FILE__)));
set_include_path($cdashpath . PATH_SEPARATOR . get_include_path());
require_once "cdash/config.php";
require_once "cdash/pdo.php";
require_once "cdash/common.php";
$projectid = pdo_real_escape_numeric($_GET["projectid"]);
if (!isset($projectid) || !is_numeric($projectid)) {
echo "Not a valid projectid!";
return;
}
$timestamp = pdo_real_escape_numeric($_GET["timestamp"]);
$db = pdo_connect("{$CDASH_DB_HOST}", "{$CDASH_DB_LOGIN}", "{$CDASH_DB_PASS}");
pdo_select_db("{$CDASH_DB_NAME}", $db);
// Find the project variables
$files = pdo_query("SELECT d.date,count(df.dailyupdateid) FROM dailyupdate as d \n LEFT JOIN dailyupdatefile AS df ON (df.dailyupdateid=d.id)\n WHERE d.projectid=" . $projectid . " \n AND date<='" . date("Y-m-d", $timestamp) . "'\n GROUP BY d.date ORDER BY d.date");
?>
<br>
<script language="javascript" type="text/javascript">
$(function () {
var d1 = [];
var dates = [];
<?php
$i = 0;
while ($files_array = pdo_fetch_array($files)) {
示例3: client_submit
function client_submit()
{
include 'config/config.php';
if (!$CDASH_MANAGE_CLIENTS) {
return 0;
}
include_once 'models/clientsite.php';
include_once 'models/clientos.php';
include_once 'models/clientjob.php';
include_once 'models/clientjobschedule.php';
include_once 'models/clientcmake.php';
include_once 'models/clientcompiler.php';
include_once 'models/clientlibrary.php';
include 'config/config.php';
require_once 'include/common.php';
// Client asks for the site id
if (isset($_GET['getsiteid'])) {
if (!isset($_GET['sitename']) || !isset($_GET['systemname'])) {
echo 'ERROR: sitename or systemname not set';
return 0;
}
$sitename = htmlspecialchars(pdo_real_escape_string($_GET['sitename']));
$systemname = htmlspecialchars(pdo_real_escape_string($_GET['systemname']));
// Should get the site id
$ClientSite = new ClientSite();
$siteid = $ClientSite->GetId($sitename, $systemname);
echo $siteid;
return 1;
} elseif (isset($_GET['getjob'])) {
if (!isset($_GET['siteid'])) {
echo '0';
return 1;
}
if (!$_GET['siteid']) {
echo '0';
return 1;
}
$ClientJobSchedule = new ClientJobSchedule();
$ClientJobSchedule->SiteId = pdo_real_escape_numeric($_GET['siteid']);
$jobid = $ClientJobSchedule->HasJob();
if ($jobid > 0) {
// if we have something to do
echo $ClientJobSchedule->GetCTestScript();
} else {
echo '0';
// send zero to let the client know that nothing is there
}
return 1;
} elseif (isset($_GET['submitinfo'])) {
if (!isset($_GET['sitename']) || !isset($_GET['systemname'])) {
echo '0';
return 1;
}
$filehandle = 'php://input';
$contents = file_get_contents($filehandle);
$xml = new SimpleXMLElement($contents);
// Add/Update the OS
$ClientOS = new ClientOS();
$ClientOS->Name = $ClientOS->GetPlatformFromName($xml->system->platform);
$ClientOS->Version = $ClientOS->GetVersionFromName($xml->system->version);
$ClientOS->Bits = $xml->system->bits;
$ClientOS->Save();
// Add/Update the site
$ClientSite = new ClientSite();
$ClientSite->Name = htmlspecialchars(pdo_real_escape_string($_GET['sitename']));
$ClientSite->SystemName = htmlspecialchars(pdo_real_escape_string($_GET['systemname']));
$ClientSite->Host = 'none';
$ClientSite->OsId = $ClientOS->Id;
$ClientSite->BaseDirectory = $xml->system->basedirectory;
$ClientSite->Save();
$siteid = $ClientSite->Id;
// Add/Update the compiler(s)
$compilers = array();
foreach ($xml->compiler as $compiler) {
$ClientCompiler = new ClientCompiler();
$ClientCompiler->Name = $compiler->name;
$ClientCompiler->Version = $compiler->version;
$ClientCompiler->Command = $compiler->command;
$ClientCompiler->Generator = $compiler->generator;
$ClientCompiler->SiteId = $siteid;
$ClientCompiler->Save();
$comp = array();
$comp['name'] = $compiler->name;
$comp['version'] = $compiler->version;
$comp['command'] = $compiler->command;
$comp['generator'] = $compiler->generator;
$compilers[] = $comp;
}
$ClientCompiler = new ClientCompiler();
$ClientCompiler->SiteId = $siteid;
$ClientCompiler->DeleteUnused($compilers);
// Add/Update CMake(s)
$cmakes = array();
foreach ($xml->cmake as $cmake) {
$ClientCMake = new ClientCMake();
$ClientCMake->Version = $cmake->version;
$ClientCMake->Path = $cmake->path;
$ClientCMake->SiteId = $siteid;
$ClientCMake->Save();
$cm = array();
//.........这里部分代码省略.........
示例4: get_subprojectid
function get_subprojectid()
{
if (!isset($_GET['subprojectid'])) {
echo_error('subprojectid not specified.');
return false;
}
$subprojectid = pdo_real_escape_numeric($_GET['subprojectid']);
return $subprojectid;
}
示例5: add_XML_value
$xml .= add_XML_value("back", "index.php?project=" . urlencode($projectname) . "&date=" . get_dashboard_date_from_project($projectname, $date));
$xml .= "</menu>";
// Get some information about the specified project
$projectname = pdo_real_escape_string($projectname);
$projectQuery = "SELECT id, nightlytime FROM project WHERE name = '{$projectname}'";
$projectResult = pdo_query($projectQuery);
if (!($projectRow = pdo_fetch_array($projectResult))) {
die("Error: project {$projectname} not found<br>\n");
}
$projectid = $projectRow["id"];
$nightlytime = $projectRow["nightlytime"];
checkUserPolicy(@$_SESSION['cdash']['loginid'], $projectid);
// Return the available groups
@($groupSelection = $_POST["groupSelection"]);
if ($groupSelection != NULL) {
$groupSelection = pdo_real_escape_numeric($groupSelection);
}
if (!isset($groupSelection)) {
$groupSelection = 0;
}
$buildgroup = pdo_query("SELECT id,name FROM buildgroup WHERE projectid='{$projectid}'");
while ($buildgroup_array = pdo_fetch_array($buildgroup)) {
$xml .= "<group>";
$xml .= add_XML_value("id", $buildgroup_array["id"]);
$xml .= add_XML_value("name", $buildgroup_array["name"]);
if ($groupSelection == $buildgroup_array["id"]) {
$xml .= add_XML_value("selected", "1");
}
$xml .= "</group>";
}
$groupSelectionSQL = "";
示例6: pdo_connect
require_once "cdash/common.php";
$db = pdo_connect("{$CDASH_DB_HOST}", "{$CDASH_DB_LOGIN}", "{$CDASH_DB_PASS}");
pdo_select_db("{$CDASH_DB_NAME}", $db);
$siteid = pdo_real_escape_numeric($_GET["siteid"]);
$buildname = htmlspecialchars(pdo_real_escape_string($_GET["buildname"]));
$buildtype = htmlspecialchars(pdo_real_escape_string($_GET["buildtype"]));
$buildgroupid = pdo_real_escape_numeric($_GET["buildgroup"]);
$divname = htmlspecialchars(pdo_real_escape_string($_GET["divname"]));
if (!isset($siteid) || !is_numeric($siteid)) {
echo "Not a valid siteid!";
return;
}
@($submit = $_POST["submit"]);
@($groupid = $_POST["groupid"]);
if ($groupid != NULL) {
$groupid = pdo_real_escape_numeric($groupid);
}
@($expected = $_POST["expected"]);
@($markexpected = $_POST["markexpected"]);
@($previousgroupid = $_POST["previousgroupid"]);
if ($markexpected) {
if (!isset($groupid) || !is_numeric($groupid)) {
echo "Not a valid groupid!";
return;
}
$expected = pdo_real_escape_string($expected);
$markexpected = pdo_real_escape_string($markexpected);
// If a rule already exists we update it
pdo_query("UPDATE build2grouprule SET expected='{$expected}' WHERE groupid='{$groupid}' AND buildtype='{$buildtype}'\n AND buildname='{$buildname}' AND siteid='{$siteid}' AND endtime='1980-01-01 00:00:00'");
return;
}
示例7: while
while ($project_array = pdo_fetch_array($projects)) {
$availableproject = array();
$availableproject['id'] = $project_array['id'];
$availableproject['name'] = $project_array['name'];
if ($project_array['id'] == $projectid) {
$availableproject['selected'] = '1';
}
$availableprojects[] = $availableproject;
}
$response['availableprojects'] = $availableprojects;
if (!isset($projectid)) {
$response['error'] = "Please select a project to continue.";
echo json_encode($response);
return;
}
$projectid = pdo_real_escape_numeric($projectid);
$response['projectid'] = $projectid;
$Project = new Project();
$Project->Id = $projectid;
$role = $Project->GetUserRole($userid);
if ($User->IsAdmin() === FALSE && $role <= 1) {
$response['error'] = "You don't have the permissions to access this page.";
echo json_encode($response);
return;
}
$response['threshold'] = $Project->GetCoverageThreshold();
$SubProject = new SubProject();
$SubProject->SetProjectId($projectid);
if ($projectid >= 0) {
$project = array();
$project['id'] = $Project->Id;
示例8: Copyright
Language: PHP
Date: $Date$
Version: $Revision$
Copyright (c) Kitware, Inc. All rights reserved.
See LICENSE or http://www.cdash.org/licensing/ for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
require_once dirname(dirname(__DIR__)) . '/config/config.php';
require_once 'include/pdo.php';
require_once 'include/common.php';
$testid = pdo_real_escape_numeric($_GET['testid']);
$buildid = pdo_real_escape_numeric($_GET['buildid']);
$measurement = preg_replace('/[^\\da-z]/i', '', $_GET['measurement']);
$measurementname = htmlspecialchars(pdo_real_escape_string(stripslashes($measurement)));
if (!isset($buildid) || !is_numeric($buildid)) {
echo 'Not a valid buildid!';
return;
}
if (!isset($testid) || !is_numeric($testid)) {
echo 'Not a valid testid!';
return;
}
if (!isset($measurementname) || !is_string($measurementname)) {
echo 'Not a valid measurementname!';
return;
}
$db = pdo_connect("{$CDASH_DB_HOST}", "{$CDASH_DB_LOGIN}", "{$CDASH_DB_PASS}");
示例9: strtotime
$time = strtotime($startttime_array['starttime']);
}
}
$dayFrom = date('d', $time);
$monthFrom = date('m', $time);
$yearFrom = date('Y', $time);
$dayTo = date('d');
$yearTo = date('Y');
$monthTo = date('m');
} else {
$dayFrom = pdo_real_escape_numeric($_POST['dayFrom']);
$monthFrom = pdo_real_escape_numeric($_POST['monthFrom']);
$yearFrom = pdo_real_escape_numeric($_POST['yearFrom']);
$dayTo = pdo_real_escape_numeric($_POST['dayTo']);
$monthTo = pdo_real_escape_numeric($_POST['monthTo']);
$yearTo = pdo_real_escape_numeric($_POST['yearTo']);
}
$xml = '<cdash>';
$xml .= '<cssfile>' . $CDASH_CSS_FILE . '</cssfile>';
$xml .= '<version>' . $CDASH_VERSION . '</version>';
$xml .= '<title>CDash - Remove Builds</title>';
$xml .= '<menutitle>CDash</menutitle>';
$xml .= '<menusubtitle>Remove Builds</menusubtitle>';
$xml .= '<backurl>manageBackup.php</backurl>';
// List the available projects
$sql = 'SELECT id,name FROM project';
$projects = pdo_query($sql);
while ($projects_array = pdo_fetch_array($projects)) {
$xml .= '<availableproject>';
$xml .= add_XML_value('id', $projects_array['id']);
$xml .= add_XML_value('name', $projects_array['name']);
示例10: auth
/** Authentication function */
function auth($SessionCachePolicy = 'private_no_expire')
{
include "cdash/config.php";
$loginid = 1231564132;
if (isset($CDASH_EXTERNAL_AUTH) && $CDASH_EXTERNAL_AUTH && isset($_SERVER['REMOTE_USER'])) {
$login = $_SERVER['REMOTE_USER'];
return authenticate($login, NULL, $SessionCachePolicy, 0);
// we don't remember
}
if (@$_GET["logout"]) {
// user requested logout
session_name("CDash");
session_cache_limiter('nocache');
@session_start();
unset($_SESSION['cdash']);
session_destroy();
// Remove the cookie if we have one
$cookienames = array("CDash", str_replace('.', '_', "CDash-" . $_SERVER['SERVER_NAME']));
// php doesn't like dot in cookie names
foreach ($cookienames as $cookiename) {
if (isset($_COOKIE[$cookiename])) {
$cookievalue = $_COOKIE[$cookiename];
$cookieuseridkey = substr($cookievalue, 0, strlen($cookievalue) - 33);
$db = pdo_connect("{$CDASH_DB_HOST}", "{$CDASH_DB_LOGIN}", "{$CDASH_DB_PASS}");
pdo_select_db("{$CDASH_DB_NAME}", $db);
pdo_query("UPDATE " . qid("user") . " SET cookiekey='' WHERE id=" . qnum($cookieuseridkey));
setcookie("CDash-" . $_SERVER['SERVER_NAME'], "", time() - 3600);
}
}
echo "<script language=\"javascript\">window.location='index.php'</script>";
return 0;
}
if (isset($_POST["sent"])) {
@($login = $_POST["login"]);
if ($login != NULL) {
$login = htmlspecialchars(pdo_real_escape_string($login));
}
@($passwd = $_POST["passwd"]);
if ($passwd != NULL) {
$passwd = htmlspecialchars(pdo_real_escape_string($passwd));
}
@($rememberme = $_POST["rememberme"]);
if ($rememberme != NULL) {
$rememberme = pdo_real_escape_numeric($rememberme);
}
return authenticate($login, $passwd, $SessionCachePolicy, $rememberme);
} else {
// arrive from session var
$cookiename = str_replace('.', '_', "CDash-" . $_SERVER['SERVER_NAME']);
// php doesn't like dot in cookie names
if (isset($_COOKIE[$cookiename])) {
$db = pdo_connect("{$CDASH_DB_HOST}", "{$CDASH_DB_LOGIN}", "{$CDASH_DB_PASS}");
pdo_select_db("{$CDASH_DB_NAME}", $db);
$cookievalue = $_COOKIE[$cookiename];
$cookiekey = substr($cookievalue, strlen($cookievalue) - 33);
$cookieuseridkey = substr($cookievalue, 0, strlen($cookievalue) - 33);
$sql = "SELECT email,password,id FROM " . qid("user") . "\n WHERE cookiekey='" . pdo_real_escape_string($cookiekey) . "'";
if (!empty($cookieuseridkey)) {
$sql .= " AND id='" . pdo_real_escape_string($cookieuseridkey) . "'";
}
$result = pdo_query("{$sql}");
if (pdo_num_rows($result) == 1) {
$user_array = pdo_fetch_array($result);
session_name("CDash");
session_cache_limiter($SessionCachePolicy);
session_set_cookie_params($CDASH_COOKIE_EXPIRATION_TIME);
@ini_set('session.gc_maxlifetime', $CDASH_COOKIE_EXPIRATION_TIME + 600);
session_start();
$sessionArray = array("login" => $user_array['email'], "passwd" => $user_array['password'], "ID" => session_id(), "valid" => 1, "loginid" => $user_array['id']);
$_SESSION['cdash'] = $sessionArray;
return true;
}
}
session_name("CDash");
session_cache_limiter($SessionCachePolicy);
session_set_cookie_params($CDASH_COOKIE_EXPIRATION_TIME);
@ini_set('session.gc_maxlifetime', $CDASH_COOKIE_EXPIRATION_TIME + 600);
session_start();
$email = @$_SESSION['cdash']["login"];
if (!empty($email)) {
$db = pdo_connect("{$CDASH_DB_HOST}", "{$CDASH_DB_LOGIN}", "{$CDASH_DB_PASS}");
pdo_select_db("{$CDASH_DB_NAME}", $db);
$sql = "SELECT id,password FROM " . qid("user") . " WHERE email='" . pdo_real_escape_string($email) . "'";
$result = pdo_query("{$sql}");
if (pdo_num_rows($result) == 0) {
pdo_free_result($result);
$loginerror = "Wrong email or password.";
return false;
}
$user_array = pdo_fetch_array($result);
if ($user_array["password"] == $_SESSION['cdash']["passwd"]) {
return true;
}
$loginerror = "Wrong email or password.";
return false;
}
}
}
示例11: Copyright
Copyright (c) 2002 Kitware, Inc. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
Copyright (c) 2012 Volkan Gezer <volkangezer@gmail.com>
=========================================================================*/
include "cdash/config.php";
require_once "cdash/pdo.php";
include 'login.php';
include_once "cdash/common.php";
include_once "models/project.php";
if ($session_OK) {
$projectid = pdo_real_escape_numeric($_REQUEST["projectid"]);
checkUserPolicy(@$_SESSION['cdash']['loginid'], $projectid);
// Checks
if (!isset($projectid) || !is_numeric($projectid)) {
echo "Not a valid projectid!";
return;
}
$project = pdo_query("SELECT * FROM project WHERE id='{$projectid}'");
if (pdo_num_rows($project) > 0) {
$project_array = pdo_fetch_array($project);
$projectname = $project_array["name"];
$nightlytime = $project_array["nightlytime"];
}
$submit = $_POST['submit'];
$nameN = htmlspecialchars(pdo_real_escape_string($_POST['nameN']));
$showTN = htmlspecialchars(pdo_real_escape_string($_POST['showTN']));
示例12: rest_post
function rest_post()
{
global $buildid;
// Lookup some details about this build.
$build = pdo_query("SELECT name, type, siteid, projectid FROM build WHERE id='{$buildid}'");
$build_array = pdo_fetch_array($build);
$buildtype = $build_array['type'];
$buildname = $build_array['name'];
$siteid = $build_array['siteid'];
$projectid = $build_array['projectid'];
// Should we change whether or not this build is expected?
if (isset($_POST['expected']) && isset($_POST['groupid'])) {
$expected = pdo_real_escape_numeric($_POST['expected']);
$groupid = pdo_real_escape_numeric($_POST['groupid']);
// If a rule already exists we update it.
$build2groupexpected = pdo_query("SELECT groupid FROM build2grouprule\n WHERE groupid='{$groupid}' AND buildtype='{$buildtype}' AND\n buildname='{$buildname}' AND siteid='{$siteid}' AND\n endtime='1980-01-01 00:00:00'");
if (pdo_num_rows($build2groupexpected) > 0) {
pdo_query("UPDATE build2grouprule SET expected='{$expected}'\n WHERE groupid='{$groupid}' AND buildtype='{$buildtype}' AND\n buildname='{$buildname}' AND siteid='{$siteid}' AND\n endtime='1980-01-01 00:00:00'");
} elseif ($expected) {
// we add the grouprule
$now = gmdate(FMT_DATETIME);
pdo_query("INSERT INTO build2grouprule\n (groupid, buildtype, buildname, siteid, expected,\n starttime, endtime)\n VALUES\n ('{$groupid}','{$buildtype}','{$buildname}','{$siteid}','{$expected}',\n '{$now}','1980-01-01 00:00:00')");
}
}
// Should we move this build to a different group?
if (isset($_POST['expected']) && isset($_POST['newgroupid'])) {
$expected = pdo_real_escape_numeric($_POST['expected']);
$newgroupid = pdo_real_escape_numeric($_POST['newgroupid']);
// Remove the build from its previous group.
$prevgroup = pdo_fetch_array(pdo_query("SELECT groupid as id FROM build2group WHERE buildid='{$buildid}'"));
$prevgroupid = $prevgroup['id'];
pdo_query("DELETE FROM build2group\n WHERE groupid='{$prevgroupid}' AND buildid='{$buildid}'");
// Insert it into the new group.
pdo_query("INSERT INTO build2group(groupid,buildid)\n VALUES ('{$newgroupid}','{$buildid}')");
// Mark any previous buildgroup rule as finished as of this time.
$now = gmdate(FMT_DATETIME);
pdo_query("UPDATE build2grouprule SET endtime='{$now}'\n WHERE groupid='{$prevgroupid}' AND buildtype='{$buildtype}' AND\n buildname='{$buildname}' AND siteid='{$siteid}' AND\n endtime='1980-01-01 00:00:00'");
// Create the rule for the new buildgroup.
// (begin time is set by default by mysql)
pdo_query("INSERT INTO build2grouprule(groupid, buildtype, buildname, siteid,\n expected, starttime, endtime)\n VALUES ('{$newgroupid}','{$buildtype}','{$buildname}','{$siteid}','{$expected}',\n '{$now}','1980-01-01 00:00:00')");
}
// Should we change the 'done' setting for this build?
if (isset($_POST['done'])) {
$done = pdo_real_escape_numeric($_POST['done']);
pdo_query("UPDATE build SET done='{$done}' WHERE id='{$buildid}'");
}
}
示例13: pdo_real_escape_numeric
$xml .= "<menutitle>CDash</menutitle>";
$xml .= "<menusubtitle>Project Roles</menusubtitle>";
// Form post
@($adduser = $_POST["adduser"]);
@($removeuser = $_POST["removeuser"]);
@($userid = $_POST["userid"]);
if ($userid != NULL) {
$userid = pdo_real_escape_numeric($userid);
}
@($role = $_POST["role"]);
if ($role != NULL) {
$role = pdo_real_escape_numeric($role);
}
@($emailtype = $_POST["emailtype"]);
if ($emailtype != NULL) {
$emailtype = pdo_real_escape_numeric($emailtype);
}
@($credentials = $_POST["credentials"]);
@($repositoryCredential = $_POST["repositoryCredential"]);
@($updateuser = $_POST["updateuser"]);
@($importUsers = $_POST["importUsers"]);
@($registerUsers = $_POST["registerUsers"]);
@($registerUser = $_POST["registerUser"]);
function make_seed_recoverpass()
{
list($usec, $sec) = explode(' ', microtime());
return (double) $sec + (double) $usec * 100000;
}
// Register a user and send the email
function register_user($projectid, $email, $firstName, $lastName, $repositoryCredential)
{
示例14: str_replace
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
// To be able to access files in this CDash installation regardless
// of getcwd() value:
//
$cdashpath = str_replace('\\', '/', dirname(dirname(__FILE__)));
set_include_path($cdashpath . PATH_SEPARATOR . get_include_path());
require_once "cdash/config.php";
require_once "cdash/pdo.php";
require_once "cdash/common.php";
$projectid = pdo_real_escape_numeric($_GET["projectid"]);
$testname = htmlspecialchars(pdo_real_escape_string($_GET["testname"]));
$starttime = pdo_real_escape_numeric($_GET["starttime"]);
@($zoomout = $_GET["zoomout"]);
if (!isset($projectid) || !is_numeric($projectid)) {
echo "Not a valid projectid!";
return;
}
if (!isset($testname)) {
echo "Not a valid test name!";
return;
}
if (!isset($starttime)) {
echo "Not a valid starttime!";
return;
}
$db = pdo_connect("{$CDASH_DB_HOST}", "{$CDASH_DB_LOGIN}", "{$CDASH_DB_PASS}");
pdo_select_db("{$CDASH_DB_NAME}", $db);
示例15: cdashmail
$User->Id = $userid;
$email = $User->GetEmail();
cdashmail("{$email}", $title, $messagePlainText, "From: CDash <" . $CDASH_EMAIL_FROM . ">\nReply-To: " . $CDASH_EMAIL_REPLY . "\nContent-type: text/plain; charset=utf-8\nX-Mailer: PHP/" . phpversion() . "\nMIME-Version: 1.0");
$xml .= add_XML_value("warning", "*The email has been sent successfully.");
} else {
$xml .= add_XML_value("warning", "*No email sent because the coverage is green.");
}
}
}
// end sendEmail
// If we change the priority
if (isset($_POST['prioritySelection'])) {
$CoverageFile2User = new CoverageFile2User();
$CoverageFile2User->ProjectId = $projectid;
$CoverageFile2User->FullPath = htmlspecialchars(pdo_real_escape_string($_POST['fullpath']));
$CoverageFile2User->SetPriority(pdo_real_escape_numeric($_POST['prioritySelection']));
}
/** We start generating the XML here */
// Find the recent builds for this project
if ($projectid > 0) {
$xml .= "<project>";
$xml .= add_XML_value("id", $Project->Id);
$xml .= add_XML_value("name", $Project->GetName());
$xml .= add_XML_value("name_encoded", urlencode($Project->GetName()));
if ($buildid > 0) {
$xml .= add_XML_value("buildid", $buildid);
}
$CoverageSummary = new CoverageSummary();
$buildids = $CoverageSummary->GetBuilds($Project->Id, $beginUTCTime, $currentUTCTime);
rsort($buildids);
foreach ($buildids as $buildId) {