$xml .= "<menu>"; $nightlytime = get_project_property($projectname, "nightlytime"); $xml .= add_XML_value("back", "index.php?project=" . urlencode($projectname) . "&date=" . get_dashboard_date_from_build_starttime($build_array["starttime"], $nightlytime)); $xml .= add_XML_value("noprevious", "1"); $xml .= add_XML_value("nonext", "1"); $xml .= "</menu>"; $xml .= "<user>"; $userid = $_SESSION['cdash']['loginid']; $user = pdo_query("SELECT admin FROM " . qid("user") . " WHERE id='{$userid}'"); $user_array = pdo_fetch_array($user); $xml .= add_XML_value("id", $userid); $xml .= add_XML_value("admin", $user_array["admin"]); $xml .= "</user>"; //get any measurements associated with this test $xml .= "<measurements>"; $query = "SELECT id,name,testpage,summarypage FROM measurement WHERE projectid='{$projectid}' ORDER BY name ASC"; $result = pdo_query($query); while ($row = pdo_fetch_array($result)) { $xml .= "<measurement>"; $xml .= add_XML_value("id", $row["id"]); $xml .= add_XML_value("name", $row["name"]); $xml .= add_XML_value("showT", $row["testpage"]); $xml .= add_XML_value("showS", $row["summarypage"]); $xml .= "</measurement>"; } $xml .= "</measurements>"; $xml .= "</cdash>"; // Now doing the xslt transition generate_XSLT($xml, "manageMeasurements"); } // end if session
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. =========================================================================*/ include "cdash/config.php"; require_once "cdash/pdo.php"; include 'login.php'; include "cdash/version.php"; if ($session_OK) { include_once 'cdash/common.php'; include_once "cdash/ctestparser.php"; set_time_limit(0); $db = pdo_connect("{$CDASH_DB_HOST}", "{$CDASH_DB_LOGIN}", "{$CDASH_DB_PASS}"); pdo_select_db("{$CDASH_DB_NAME}", $db); checkUserPolicy(@$_SESSION['cdash']['loginid'], 0); // only admin $xml = begin_XML_for_XSLT(); $xml .= "<title>CDash - Backup</title>"; $xml .= "<menutitle>CDash</menutitle>"; $xml .= "<menusubtitle>Backup</menusubtitle>"; $xml .= "<backurl>user.php</backurl>"; $xml .= "</cdash>"; // Now doing the xslt transition generate_XSLT($xml, "manageBackup"); } // end session
} $result = pdo_query($query); if (!$result) { $xml .= '<db_created>0</db_created>'; die(pdo_error()); } $query = ''; } } } // Check the version of PostgreSQL $result_version = pdo_query('SELECT version()'); $version_array = pdo_fetch_array($result_version); if (strpos(strtolower($version_array[0]), 'postgresql 9.') !== false) { // For PgSQL 9.0 we need to set the bytea_output to 'escape' (it was changed to hexa) @pdo_query('ALTER DATABASE ' . $CDASH_DB_NAME . " SET bytea_output TO 'escape'"); } } pdo_query('INSERT INTO ' . qid('user') . " (email,password,firstname,lastname,institution,admin) VALUES ('" . $admin_email . "', '" . md5($admin_password) . "', 'administrator', '','Kitware Inc.', 1)"); echo pdo_error(); $xml .= '<db_created>1</db_created>'; // Set the database version setVersion(); } } } } $xml .= '</cdash>'; // Now doing the xslt transition generate_XSLT($xml, 'install');
list($usec, $sec) = explode(' ', microtime()); return (double) $sec + (double) $usec * 100000; } srand(make_seed_recoverpass()); $password = ""; $max = strlen($keychars) - 1; for ($i = 0; $i <= $length; $i++) { $password .= substr($keychars, rand(0, $max), 1); } $currentURI = get_server_URI(); $url = $currentURI . "/user.php"; $text = "Hello,\n\n You have asked to recover your password for CDash.\n\n"; $text .= "Your new password is: " . $password . "\n"; $text .= "Please go to this page to login: "******"{$url}\n"; $text .= "\n\nGenerated by CDash"; if (cdashmail("{$email}", "CDash password recovery", $text, "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")) { $md5pass = md5($password); // If we can send the email we update the database pdo_query("UPDATE " . qid("user") . " SET password='******' WHERE email='{$email}'"); add_last_sql_error("recoverPassword"); $xml .= "<message>A confirmation message has been sent to your inbox.</message>"; } else { $xml .= "<warning>Cannot send recovery email</warning>"; } } } $xml .= "</cdash>"; // Now doing the xslt transition generate_XSLT($xml, "recoverPassword");
if (count($tests) > 0) { natcasesort($tests); //now generate some XML $xml .= "<tests>\n"; $previousLetter = ""; $firstSection = TRUE; foreach ($tests as $testName) { $letter = strtolower(substr($testName, 0, 1)); if ($letter != $previousLetter) { if ($firstSection) { $xml .= "<section>\n"; $firstSection = FALSE; } else { $xml .= "</section>\n<section>"; } $xml .= add_XML_value("sectionName", $letter) . "\n"; $previousLetter = $letter; } $xml .= "<test>\n"; $xml .= add_XML_value("testName", $testName) . "\n"; $summaryLink = "testSummary.php?project={$projectid}&name={$testName}&date={$today}"; $xml .= add_XML_value("summaryLink", $summaryLink) . "\n"; $xml .= "</test>\n"; } $xml .= "</section>\n"; $xml .= "</tests>\n"; } } $xml .= "</cdash>"; generate_XSLT($xml, "testOverview");
$project_array = pdo_fetch_array($project); $projectname = $project_array["name"]; } $Project->Id = $projectid; $role = $Project->GetUserRole($userid); } else { $projectname = 'Global'; } $xml = begin_XML_for_XSLT(); $xml .= "<title>Feed - " . $projectname . "</title>"; $xml .= get_cdash_dashboard_xml(get_project_name($projectid), $date); $sql = ''; if ($date) { $sql = "AND date>'" . $date . "'"; } // Get the errors $query = pdo_query("SELECT * FROM feed WHERE projectid=" . qnum($projectid) . " ORDER BY id DESC"); while ($query_array = pdo_fetch_array($query)) { $xml .= "<feeditem>"; $xml .= add_XML_value("date", $query_array["date"]); $xml .= add_XML_value("buildid", $query_array["buildid"]); $xml .= add_XML_value("type", $query_array["type"]); $xml .= add_XML_value("description", $query_array["description"]); $xml .= "</feeditem>"; } $xml .= add_XML_value("admin", $User->IsAdmin()); $xml .= add_XML_value("role", $role); $xml .= "</cdash>"; // Now doing the xslt transition generate_XSLT($xml, "viewFeed");
} } elseif (isset($_POST['makenormaluser'])) { if ($postuserid > 1) { $update_array = pdo_fetch_array(pdo_query('SELECT firstname,lastname FROM ' . qid('user') . " WHERE id='" . $postuserid . "'")); pdo_query('UPDATE ' . qid('user') . " SET admin=0 WHERE id='" . $postuserid . "'"); $xml .= '<warning>' . $update_array['firstname'] . ' ' . $update_array['lastname'] . ' is not administrator anymore.</warning>'; } else { $xml .= '<error>Administrator should remain admin.</error>'; } } elseif (isset($_POST['makeadmin'])) { $update_array = pdo_fetch_array(pdo_query('SELECT firstname,lastname FROM ' . qid('user') . " WHERE id='" . $postuserid . "'")); pdo_query('UPDATE ' . qid('user') . " SET admin=1 WHERE id='" . $postuserid . "'"); $xml .= '<warning>' . $update_array['firstname'] . ' ' . $update_array['lastname'] . ' is now an administrator.</warning>'; } elseif (isset($_POST['removeuser'])) { $user = new User(); $user->Id = $postuserid; $user->Fill(); $name = $user->GetName(); $user->Delete(); $xml .= "<warning>{$name} has been removed.</warning>"; } if (isset($_POST['search'])) { $xml .= '<search>' . $_POST['search'] . '</search>'; } if (isset($CDASH_FULL_EMAIL_WHEN_ADDING_USER) && $CDASH_FULL_EMAIL_WHEN_ADDING_USER == 1) { $xml .= add_XML_value('fullemail', '1'); } $xml .= '</cdash>'; // Now doing the xslt transition generate_XSLT($xml, 'manageUsers'); }
} $xml .= " dbAdd ( false, \"" . $file['filename'] . " Revision: " . $file['revision'] . "\",\"" . $file['diff_url'] . "\",2,\"\",\"1\",\"" . $file['author'] . "\",\"" . $file['email'] . "\",\"" . $file['log'] . "\",\"" . $file['bugurl'] . "\",\"" . $file['bugid'] . "\",\"" . $file['bugpos'] . "\")\n"; } // Modified files $xml .= "dbAdd (true, \"Modified files (" . count($locallymodified) . ")\", \"\", 0, \"\", \"1\", \"\", \"\", \"\", \"\", \"\", \"\")\n"; $previousdir = ""; foreach ($locallymodified as $file) { $directory = $file['directory']; if ($previousdir == "" || $directory != $previousdir) { $xml .= " dbAdd (true, \"" . $directory . "\", \"\", 1, \"\", \"1\", \"\", \"\", \"\", \"\", \"\", \"\")\n"; $previousdir = $directory; } $xml .= " dbAdd ( false, \"" . $file['filename'] . "\",\"" . $file['diff_url'] . "\",2,\"\",\"1\",\"" . $file['author'] . "\",\"" . $file['email'] . "\",\"" . $file['log'] . "\",\"" . $file['bugurl'] . "\",\"" . $file['bugid'] . "\",\"" . $file['bugpos'] . "\")\n"; } // Conflicting files $xml .= "dbAdd (true, \"Conflicting files (" . count($conflictingfiles) . ")\", \"\", 0, \"\", \"1\", \"\", \"\", \"\", \"\", \"\", \"\")\n"; $previousdir = ""; foreach ($conflictingfiles as $file) { $directory = $file['directory']; if ($previousdir == "" || $directory != $previousdir) { $xml .= " dbAdd (true, \"" . $directory . "\", \"\", 1, \"\", \"1\", \"\", \"\", \"\", \"\", \"\")\n"; $previousdir = $directory; } $xml .= " dbAdd ( false, \"" . $file['filename'] . " Revision: " . $file['revision'] . "\",\"" . $file['diff_url'] . "\",2,\"\",\"1\",\"" . $file['author'] . "\",\"" . $file['email'] . "\",\"" . $file['log'] . "\",\"" . $file['bugurl'] . "\",\"" . $file['bugid'] . "\",\"" . $file['bugpos'] . "\")\n"; } $xml .= "</javascript>"; $xml .= "</updates>"; $xml .= "</cdash>"; // Now doing the xslt transition generate_XSLT($xml, "viewUpdate");
} else { $projectname = htmlspecialchars(pdo_real_escape_string($projectname)); $projectid = get_project_id($projectname); @($date = $_GET["date"]); if ($date != NULL) { $date = htmlspecialchars(pdo_real_escape_string($date)); } // Check if the project has any subproject $Project = new Project(); $Project->Id = $projectid; $Project->Fill(); $displayProject = false; if (isset($_GET["display"]) && $_GET["display"] == "project" || isset($_GET["parentid"]) && $_GET["parentid"] > 0) { $displayProject = true; } if (!$displayProject && !isset($_GET["subproject"]) && $Project->GetNumberOfSubProjects($date) > 0) { $xml = generate_subprojects_dashboard_XML($Project, $date); // Now doing the xslt transition generate_XSLT($xml, "indexsubproject"); } else { $xml = generate_main_dashboard_XML($Project, $date); // Now doing the xslt transition if ($xml) { if (isset($_GET["parentid"])) { generate_XSLT($xml, "indexchildren"); } else { generate_XSLT($xml, "index"); } } } }
} $xml .= "</availableproject>"; } $Banner = new Banner(); $Banner->SetProjectId($projectid); // If submit has been pressed @($updateMessage = $_POST["updateMessage"]); if (isset($updateMessage)) { $Banner->SetText(htmlspecialchars(pdo_real_escape_string($_POST["message"]))); } /** We start generating the XML here */ // List the available project if ($projectid >= 0) { $xml .= "<project>"; $xml .= add_XML_value("id", $Project->Id); $xml .= add_XML_value("text", $Banner->GetText()); if ($projectid > 0) { $xml .= add_XML_value("name", $Project->GetName()); $xml .= add_XML_value("name_encoded", urlencode($Project->GetName())); } $xml .= add_XML_value("id", $Project->Id); $xml .= "</project>"; } $xml .= "</cdash>"; // Now doing the xslt transition generate_XSLT($xml, "manageBanner"); } // end session OK ?>
$xml .= add_XML_value('id', $project_array['id']); $xml .= add_XML_value('name', $project_array['name']); if ($project_array['id'] == $projectid) { $xml .= add_XML_value('selected', '1'); } $xml .= '</availableproject>'; } $Banner = new Banner(); $Banner->SetProjectId($projectid); // If submit has been pressed @($updateMessage = $_POST['updateMessage']); if (isset($updateMessage)) { $Banner->SetText(htmlspecialchars(pdo_real_escape_string($_POST['message']))); } /* We start generating the XML here */ // List the available project if ($projectid >= 0) { $xml .= '<project>'; $xml .= add_XML_value('id', $Project->Id); $xml .= add_XML_value('text', $Banner->GetText()); if ($projectid > 0) { $xml .= add_XML_value('name', $Project->GetName()); $xml .= add_XML_value('name_encoded', urlencode($Project->GetName())); } $xml .= add_XML_value('id', $Project->Id); $xml .= '</project>'; } $xml .= '</cdash>'; // Now doing the xslt transition generate_XSLT($xml, 'manageBanner'); }
} $xml .= "<sourcefile>"; $xml .= "<name>" . $build_array["sourcefile"] . "</name>"; $current_file = $build_array["sourcefile"]; } if ($build_array["type"] == 0) { $xml .= "<error>"; } else { $xml .= "<warning>"; } $xml .= "<line>" . $build_array["sourceline"] . "</line>"; $textarray = explode("\n", $build_array["text"]); foreach ($textarray as $text) { if (strlen($text) > 0) { $xml .= add_XML_value("text", $text); } } $xml .= "<sitename>" . $build_array["name"] . "</sitename>"; $xml .= "<buildname>" . $build_array["buildname"] . "</buildname>"; if ($build_array["type"] == 0) { $xml .= "</error>"; } else { $xml .= "</warning>"; } } if (pdo_num_rows($builds) > 0) { $xml .= "</sourcefile>"; } $xml .= "</cdash>"; generate_XSLT($xml, "buildOverview");
$xml .= '<availableproject>'; $xml .= add_XML_value('id', $projects_array['id']); $xml .= add_XML_value('name', $projects_array['name']); if ($projects_array['id'] == $projectid) { $xml .= add_XML_value('selected', '1'); } $xml .= '</availableproject>'; } $xml .= '<dayFrom>' . $dayFrom . '</dayFrom>'; $xml .= '<monthFrom>' . $monthFrom . '</monthFrom>'; $xml .= '<yearFrom>' . $yearFrom . '</yearFrom>'; $xml .= '<dayTo>' . $dayTo . '</dayTo>'; $xml .= '<monthTo>' . $monthTo . '</monthTo>'; $xml .= '<yearTo>' . $yearTo . '</yearTo>'; @($submit = $_POST['Submit']); // Delete the builds if (isset($submit)) { $begin = $yearFrom . '-' . $monthFrom . '-' . $dayFrom . ' 00:00:00'; $end = $yearTo . '-' . $monthTo . '-' . $dayTo . ' 00:00:00'; $sql = 'SELECT id FROM build WHERE projectid=' . qnum($projectid) . " AND\n parentid IN (0, -1) AND starttime<='{$end}' AND starttime>='{$begin}'\n ORDER BY starttime ASC"; $build = pdo_query($sql); $builds = array(); while ($build_array = pdo_fetch_array($build)) { $builds[] = $build_array['id']; } remove_build($builds); $xml .= add_XML_value('alert', 'Removed ' . count($builds) . ' builds.'); } $xml .= '</cdash>'; generate_XSLT($xml, 'removeBuilds');
/** Login Form function */ function LoginForm($loginerror) { include "cdash/config.php"; require_once "cdash/pdo.php"; include_once "cdash/common.php"; include "cdash/version.php"; $xml = begin_XML_for_XSLT(); $xml .= "<title>Login</title>"; if (isset($CDASH_NO_REGISTRATION) && $CDASH_NO_REGISTRATION == 1) { $xml .= add_XML_value("noregister", "1"); } if (@$_GET['note'] == "register") { $xml .= "<message>Registration Complete. Please login with your email and password.</message>"; } if ($loginerror != "") { $xml .= "<message>" . $loginerror . "</message>"; } if ($CDASH_ALLOW_LOGIN_COOKIE) { $xml .= "<allowlogincookie>1</allowlogincookie>"; } if ($GOOGLE_CLIENT_ID != '' && $GOOGLE_CLIENT_SECRET != '') { $xml .= "<oauth2>"; $xml .= add_XML_value("client", $GOOGLE_CLIENT_ID); $xml .= "</oauth2>"; } $xml .= "</cdash>"; if (!isset($NoXSLGenerate)) { generate_XSLT($xml, "login"); } }
$defects = pdo_query("SELECT * FROM dynamicanalysisdefect WHERE dynamicanalysisid='{$dynid}'"); while ($defects_array = pdo_fetch_array($defects)) { // defects $defect_type = $defects_array["type"]; if (array_key_exists($defect_type, $defect_nice_names)) { $defect_type = $defect_nice_names[$defect_type]; } if (!in_array($defect_type, $defect_types)) { $defect_types[] = $defect_type; } $column = array_search($defect_type, $defect_types); $xml .= "<defect>"; $xml .= add_XML_value("column", $column); $xml .= add_XML_value("value", $defects_array["value"]); $xml .= "</defect>"; } $xml .= get_labels_xml_from_query_results("SELECT text FROM label, label2dynamicanalysis WHERE " . "label.id=label2dynamicanalysis.labelid AND " . "label2dynamicanalysis.dynamicanalysisid='{$dynid}' " . "ORDER BY text ASC"); $xml .= "</dynamicanalysis>"; } // explicitly list the defect types encountered here // so we can dynamically generate the header row foreach ($defect_types as $defect_type) { $xml .= "<defecttypes>"; $xml .= add_XML_value("type", $defect_type); $xml .= "</defecttypes>"; } $xml .= add_XML_value("numcolumns", sizeof($defect_types)); $xml .= "</cdash>"; // Now doing the xslt transition generate_XSLT($xml, "viewDynamicAnalysis");
/** Login Form function */ function LoginForm($loginerror) { include dirname(__DIR__) . '/config/config.php'; require_once 'include/pdo.php'; include_once 'include/common.php'; include 'include/version.php'; $xml = begin_XML_for_XSLT(); $xml .= '<title>Login</title>'; if (isset($CDASH_NO_REGISTRATION) && $CDASH_NO_REGISTRATION == 1) { $xml .= add_XML_value('noregister', '1'); } if (@$_GET['note'] == 'register') { $xml .= '<message>Registration Complete. Please login with your email and password.</message>'; } if ($loginerror != '') { $xml .= '<message>' . $loginerror . '</message>'; } if ($CDASH_ALLOW_LOGIN_COOKIE) { $xml .= '<allowlogincookie>1</allowlogincookie>'; } if ($GOOGLE_CLIENT_ID != '' && $GOOGLE_CLIENT_SECRET != '') { $xml .= '<oauth2>'; $xml .= add_XML_value('client', $GOOGLE_CLIENT_ID); // Google OAuth needs to know the base url to redirect back to $xml .= add_XML_value('CDASH_BASE_URL', get_server_URI()); $xml .= '</oauth2>'; } $xml .= '</cdash>'; if (!isset($NoXSLGenerate)) { generate_XSLT($xml, 'login'); } }
<?php /*========================================================================= Program: CDash - Cross-Platform Dashboard System Module: $Id$ 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'; $NoXSLGenerate = 1; include 'old_index.php'; $xml = generate_index_table(); // Now doing the xslt transition generate_XSLT($xml, 'index');
$xml .= ReportLastBuild("Experimental", $projectid, $siteid, $projectname, $nightlytime); $xml .= "</project>"; } $xml .= "</claimedsite>"; } // Use to build the site/project matrix foreach ($claimedsiteprojects as $project) { $xml .= "<claimedsiteproject>"; $xml .= add_XML_value("id", $project["id"]); $xml .= add_XML_value("name", $project["name"]); $xml .= add_XML_value("name_encoded", urlencode($project["name"])); $xml .= "</claimedsiteproject>"; } if (@$_GET['note'] == "subscribedtoproject") { $xml .= "<message>You have subscribed to a project.</message>"; } else { if (@$_GET['note'] == "subscribedtoproject") { $xml .= "<message>You have been unsubscribed from a project.</message>"; } } // If the user is admin we show all the errors if ($user_array["admin"]) { $errorlog = pdo_fetch_array(pdo_query("SELECT count(id) FROM errorlog")); $xml .= add_XML_value("nerrorlogs", $errorlog[0]); } $xml .= "</cdash>"; // Now doing the xslt transition if (!isset($NoXSLGenerate)) { generate_XSLT($xml, "user"); } }
switch ($row["status"]) { case "passed": $xml .= add_XML_value("status", "Passed"); $xml .= add_XML_value("statusclass", "normal"); break; case "failed": $xml .= add_XML_value("status", "Failed"); $xml .= add_XML_value("statusclass", "error"); break; case "notrun": $xml .= add_XML_value("status", "Not Run"); $xml .= add_XML_value("statusclass", "warning"); break; } if ($project['showtesttime']) { if ($row["timestatus"] < $project['testtimemaxstatus']) { $xml .= add_XML_value("timestatus", "Passed"); $xml .= add_XML_value("timestatusclass", "normal"); } else { $xml .= add_XML_value("timestatus", "Failed"); $xml .= add_XML_value("timestatusclass", "error"); } } $xml .= "</build>\n"; } $xml .= "</builds>\n"; $end = microtime_float(); $xml .= "<generationtime>" . round($end - $start, 3) . "</generationtime>"; $xml .= "</cdash>\n"; generate_XSLT($xml, "queryTests");
if ($branchCoverageData[0] != $branchCoverageData[1]) { $file_array[$i] .= '<span class="error">'; } else { $file_array[$i] .= '<span class="normal">'; } $file_array[$i] .= str_pad($code, 5, ' ', STR_PAD_LEFT) . "</span>"; } else { $file_array[$i] .= str_pad('', 5, ' ', STR_PAD_LEFT); } } if (array_key_exists($i, $linecodes)) { $code = $linecodes[$i]; if ($code == 0) { $file_array[$i] .= '<span class="error">'; } else { $file_array[$i] .= '<span class="normal">'; } $file_array[$i] .= str_pad($code, 5, ' ', STR_PAD_LEFT) . " | " . $line; $file_array[$i] .= "</span>"; } else { $file_array[$i] .= str_pad('', 5, ' ', STR_PAD_LEFT) . " | " . $line; } $i++; } $file = implode("<br>", $file_array); $xml .= "<file>" . utf8_encode(htmlspecialchars($file)) . "</file>"; $xml .= "</coverage>"; $xml .= "</cdash>"; // Now doing the xslt transition generate_XSLT($xml, "viewCoverageFile");
<projectname_encoded>' . urlencode($projectname) . '</projectname_encoded> <previousdate>' . $previousdate . '</previousdate> <projectpublic>' . $projectpublic . '</projectpublic> <nextdate>' . $nextdate . '</nextdate>'; if (empty($project_array['homeurl'])) { $xml .= '<home>index.php?project=' . urlencode($projectname) . '</home>'; } else { $xml .= '<home>' . $homeurl . '</home>'; } if ($CDASH_USE_LOCAL_DIRECTORY && file_exists('local/models/proProject.php')) { include_once 'local/models/proProject.php'; $pro = new proProject(); $pro->ProjectId = $projectid; $xml .= '<proedition>' . $pro->GetEdition(1) . '</proedition>'; } if ($currentstarttime > time()) { $xml .= '<future>1</future>'; } else { $xml .= '<future>0</future>'; } $xml .= '</dashboard>'; // Menu definition $xml .= '<menu>'; if (!isset($date) || strlen($date) < 8 || date(FMT_DATE, $currentstarttime) == date(FMT_DATE)) { $xml .= add_XML_value('nonext', '1'); } $xml .= '</menu>'; $xml .= '</cdash>'; // Now doing the xslt transition generate_XSLT($xml, 'viewSubProjectDependenciesGraph');
list($previousdate, $currentstarttime, $nextdate) = get_dates($date, $project_array["nightlytime"]); $logoid = getLogoID($projectid); // Main dashboard section $xml .= "<dashboard>\n <datetime>" . date("l, F d Y H:i:s T", time()) . "</datetime>\n <date>" . $date . "</date>\n <unixtimestamp>" . $currentstarttime . "</unixtimestamp>\n <svn>" . $svnurl . "</svn>\n <bugtracker>" . $bugurl . "</bugtracker>\n <googletracker>" . $googletracker . "</googletracker>\n <documentation>" . $docurl . "</documentation>\n <logoid>" . $logoid . "</logoid>\n <projectid>" . $projectid . "</projectid>\n <projectname>" . $projectname . "</projectname>\n <projectname_encoded>" . urlencode($projectname) . "</projectname_encoded>\n <previousdate>" . $previousdate . "</previousdate>\n <projectpublic>" . $projectpublic . "</projectpublic>\n <nextdate>" . $nextdate . "</nextdate>"; if (empty($project_array["homeurl"])) { $xml .= "<home>index.php?project=" . urlencode($projectname) . "</home>"; } else { $xml .= "<home>" . $homeurl . "</home>"; } if ($CDASH_USE_LOCAL_DIRECTORY && file_exists("local/models/proProject.php")) { include_once "local/models/proProject.php"; $pro = new proProject(); $pro->ProjectId = $projectid; $xml .= "<proedition>" . $pro->GetEdition(1) . "</proedition>"; } if ($currentstarttime > time()) { $xml .= "<future>1</future>"; } else { $xml .= "<future>0</future>"; } $xml .= "</dashboard>"; // Menu definition $xml .= "<menu>"; if (!isset($date) || strlen($date) < 8 || date(FMT_DATE, $currentstarttime) == date(FMT_DATE)) { $xml .= add_XML_value("nonext", "1"); } $xml .= "</menu>"; $xml .= "</cdash>"; // Now doing the xslt transition generate_XSLT($xml, "viewSubProjectDependenciesGraph");
if ($nextbuildid > 0) { $xml .= add_XML_value("next", "viewNotes.php?buildid=" . $nextbuildid); } else { $xml .= add_XML_value("nonext", "1"); } $xml .= "</menu>"; // Build $xml .= "<build>"; $site_array = pdo_fetch_array(pdo_query("SELECT name FROM site WHERE id='{$siteid}'")); $xml .= add_XML_value("site", $site_array["name"]); $xml .= add_XML_value("siteid", $siteid); $xml .= add_XML_value("buildname", $buildname); $xml .= add_XML_value("buildid", $buildid); $xml .= add_XML_value("stamp", $build_array["stamp"]); $xml .= "</build>"; $build2note = pdo_query("SELECT noteid,time FROM build2note WHERE buildid='{$buildid}'"); while ($build2note_array = pdo_fetch_array($build2note)) { $noteid = $build2note_array["noteid"]; $note_array = pdo_fetch_array(pdo_query("SELECT * FROM note WHERE id='{$noteid}'")); $xml .= "<note>"; $xml .= add_XML_value("name", $note_array["name"]); $xml .= add_XML_value("text", $note_array["text"]); $xml .= add_XML_value("time", $build2note_array["time"]); $xml .= "</note>"; $text = $note_array["text"]; $name = $note_array["name"]; } $xml .= "</cdash>"; // Now doing the xslt transition generate_XSLT($xml, "viewNotes");
echo pdo_error(); pdo_query("INSERT INTO buildgroup(name,projectid,starttime,endtime,description)\n VALUES ('Continuous','{$projectid}','1980-01-01 00:00:00','1980-01-01 00:00:00','Continuous Builds')"); $id = pdo_insert_id("buildgroup"); pdo_query("INSERT INTO buildgroupposition(buildgroupid,position,starttime,endtime)\n VALUES ('{$id}','2','1980-01-01 00:00:00','1980-01-01 00:00:00')"); pdo_query("INSERT INTO buildgroup(name,projectid,starttime,endtime,description)\n VALUES ('Experimental','{$projectid}','1980-01-01 00:00:00','1980-01-01 00:00:00','Experimental Builds')"); $id = pdo_insert_id("buildgroup"); pdo_query("INSERT INTO buildgroupposition(buildgroupid,position,starttime,endtime)\n VALUES ('{$id}','3','1980-01-01 00:00:00','1980-01-01 00:00:00')"); $n++; } } $xml .= add_XML_value("alert", $n . " projects have now default groups."); } else { if ($AssignBuildToDefaultGroups) { // Loop throught the builds $builds = pdo_query("SELECT id,type,projectid FROM build WHERE id NOT IN (SELECT buildid as id FROM build2group)"); while ($build_array = pdo_fetch_array($builds)) { $buildid = $build_array["id"]; $buildtype = $build_array["type"]; $projectid = $build_array["projectid"]; $buildgroup_array = pdo_fetch_array(pdo_query("SELECT id FROM buildgroup WHERE name='{$buildtype}' AND projectid='{$projectid}'")); $groupid = $buildgroup_array["id"]; pdo_query("INSERT INTO build2group(buildid,groupid) VALUES ('{$buildid}','{$groupid}')"); } $xml .= add_XML_value("alert", "Builds have been added to default groups successfully."); } } // end AssignBuildToDefaultGroups $xml .= "</cdash>"; // Now doing the xslt transition generate_XSLT($xml, "upgrade");
} foreach ($labelids as $labelid) { $xml .= "<labelemail>"; $xml .= add_XML_value("id", $labelid); $Label->Id = $labelid; $xml .= add_XML_value("text", $Label->GetText()); $xml .= "</labelemail>"; } $xml .= "</project>"; $sql = "SELECT id,name FROM project"; if ($User->IsAdmin() == false) { $sql .= " WHERE public=1 OR id IN (SELECT projectid AS id FROM user2project WHERE userid='{$userid}' AND role>0)"; } $projects = pdo_query($sql); while ($project_array = pdo_fetch_array($projects)) { $xml .= "<availableproject>"; $xml .= add_XML_value("id", $project_array['id']); $xml .= add_XML_value("name", $project_array['name']); if ($project_array['id'] == $projectid) { $xml .= add_XML_value("selected", "1"); } $xml .= "</availableproject>"; } $xml .= "</cdash>"; // Now doing the xslt transition generate_XSLT($xml, "subscribeProject"); } // end session OK ?>
if ($branchCoverageData[0] != $branchCoverageData[1]) { $file_array[$i] .= '<span class="error">'; } else { $file_array[$i] .= '<span class="normal">'; } $file_array[$i] .= str_pad($code, 5, ' ', STR_PAD_LEFT) . '</span>'; } else { $file_array[$i] .= str_pad('', 5, ' ', STR_PAD_LEFT); } } if (array_key_exists($i, $log->Lines)) { $code = $log->Lines[$i]; if ($code == 0) { $file_array[$i] .= '<span class="error">'; } else { $file_array[$i] .= '<span class="normal">'; } $file_array[$i] .= str_pad($code, 5, ' ', STR_PAD_LEFT) . ' | ' . $line; $file_array[$i] .= '</span>'; } else { $file_array[$i] .= str_pad('', 5, ' ', STR_PAD_LEFT) . ' | ' . $line; } $i++; } $file = implode('<br>', $file_array); $xml .= '<file>' . utf8_encode(htmlspecialchars($file)) . '</file>'; $xml .= '</coverage>'; $xml .= '</cdash>'; // Now doing the xslt transition generate_XSLT($xml, 'viewCoverageFile');
$xml .= add_XML_value('description', stripslashes($siteinformation_array['description'])); $xml .= add_XML_value('processoris64bits', $siteinformation_array['processoris64bits']); $xml .= add_XML_value('processorvendor', $siteinformation_array['processorvendor']); $xml .= add_XML_value('processorvendorid', $siteinformation_array['processorvendorid']); $xml .= add_XML_value('processorfamilyid', $siteinformation_array['processorfamilyid']); $xml .= add_XML_value('processormodelid', $siteinformation_array['processormodelid']); $xml .= add_XML_value('processorcachesize', $siteinformation_array['processorcachesize']); $xml .= add_XML_value('numberlogicalcpus', $siteinformation_array['numberlogicalcpus']); $xml .= add_XML_value('numberphysicalcpus', $siteinformation_array['numberphysicalcpus']); $xml .= add_XML_value('totalvirtualmemory', $siteinformation_array['totalvirtualmemory']); $xml .= add_XML_value('totalphysicalmemory', $siteinformation_array['totalphysicalmemory']); $xml .= add_XML_value('logicalprocessorsperphysical', $siteinformation_array['logicalprocessorsperphysical']); $xml .= add_XML_value('processorclockfrequency', $siteinformation_array['processorclockfrequency']); $xml .= add_XML_value('ip', $site_array['ip']); $xml .= add_XML_value('latitude', $site_array['latitude']); $xml .= add_XML_value('longitude', $site_array['longitude']); $xml .= add_XML_value('outoforder', $site_array['outoforder']); $xml .= '</site>'; $user2site = pdo_query("SELECT su.userid FROM site2user AS su,user2project AS up\n WHERE su.userid=up.userid AND up.role>0 AND su.siteid='{$siteid}' and su.userid='{$userid}'"); echo pdo_error(); if (pdo_num_rows($user2site) == 0) { $xml .= add_XML_value('siteclaimed', '0'); } else { $xml .= add_XML_value('siteclaimed', '1'); } $xml .= '</user>'; } $xml .= '</cdash>'; // Now doing the xslt transition generate_XSLT($xml, 'editSite'); }
FROM build AS b, siteinformation AS si, site as s LEFT JOIN site2user ON (site2user.siteid=s.id) LEFT JOIN ' . qid('user') . ' ON (site2user.userid=' . qid('user') . ".id)\n WHERE s.id=b.siteid\n AND b.starttime<'{$end_UTCDate}' AND b.starttime>'{$beginning_UTCDate}'\n AND si.siteid=s.id\n AND b.projectid='{$projectid}' GROUP BY s.id,s.name,si.processorclockfrequency,\n si.description,\n si.numberphysicalcpus,s.ip,s.latitude,s.longitude," . qid('user') . '.firstname,' . qid('user') . '.lastname,' . qid('user') . '.id'); } else { $site = pdo_query('SELECT s.id,s.name,si.processorclockfrequency, si.description, si.numberphysicalcpus,s.ip,s.latitude,s.longitude, ' . qid('user') . '.firstname,' . qid('user') . '.lastname,' . qid('user') . '.id AS userid FROM build AS b, siteinformation AS si, site as s LEFT JOIN site2user ON (site2user.siteid=s.id) LEFT JOIN ' . qid('user') . ' ON (site2user.userid=' . qid('user') . ".id)\n WHERE s.id=b.siteid\n AND b.starttime<'{$end_UTCDate}' AND b.starttime>'{$beginning_UTCDate}'\n AND si.siteid=s.id\n AND b.projectid='{$projectid}' GROUP BY s.id"); } echo pdo_error(); while ($site_array = pdo_fetch_array($site)) { $xml .= '<site>'; $xml .= add_XML_value('name', $site_array['name']); $xml .= add_XML_value('id', $site_array['id']); $xml .= add_XML_value('description', $site_array['description']); $xml .= add_XML_value('processor_speed', getByteValueWithExtension($site_array['processorclockfrequency'] * 1024 * 1024)); $xml .= add_XML_value('numberphysicalcpus', $site_array['numberphysicalcpus']); $xml .= add_XML_value('latitude', $site_array['latitude']); $xml .= add_XML_value('longitude', $site_array['longitude']); $xml .= add_XML_value('longitude', $site_array['longitude']); $xml .= add_XML_value('maintainer_name', $site_array['firstname'] . ' ' . $site_array['lastname']); $xml .= add_XML_value('maintainer_id', $site_array['userid']); $xml .= '</site>'; } $xml .= '</cdash>'; // Now doing the xslt transition generate_XSLT($xml, 'viewMap');
$builds = $ClientJobSchedule->GetAssociatedBuilds(); foreach ($builds as $buildid) { $xml .= '<build>'; $xml .= add_XML_value("id", $buildid); $xml .= '</build>'; } $status = $ClientJobSchedule->GetStatus(); switch ($status) { case CDASH_JOB_SCHEDULED: $statusText = "Scheduled"; break; case CDASH_JOB_RUNNING: $statusText = "Running"; break; case CDASH_JOB_FINISHED: $statusText = "Finished"; break; case CDASH_JOB_FAILED: $statusText = "Failed"; break; case CDASH_JOB_ABORTED: $statusText = "Aborted"; break; default: $statusText = "Unknown"; break; } $xml .= '<status>' . $statusText . '</status>'; $xml .= "</cdash>"; generate_XSLT($xml, "scheduleSummary", true);
$keychars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!#$%&'; $length = 10; $password = ''; $max = strlen($keychars) - 1; for ($i = 0; $i <= $length; $i++) { // random_int is available in PHP 7 and the random_compat PHP 5.x // polyfill included in the Composer package.json dependencies. $password .= substr($keychars, random_int(0, $max), 1); } $currentURI = get_server_URI(); $url = $currentURI . '/user.php'; $text = "Hello,\n\n You have asked to recover your password for CDash.\n\n"; $text .= 'Your new password is: ' . $password . "\n"; $text .= 'Please go to this page to login: '******'CDash password recovery', $text)) { $md5pass = md5($password); // If we can send the email we update the database pdo_query('UPDATE ' . qid('user') . " SET password='******' WHERE email='{$email}'"); add_last_sql_error('recoverPassword'); $xml .= '<message>A confirmation message has been sent to your inbox.</message>'; } else { $xml .= '<warning>Cannot send recovery email</warning>'; } } } $xml .= '</cdash>'; // Now doing the xslt transition generate_XSLT($xml, 'recoverPassword');