本文整理汇总了PHP中qid函数的典型用法代码示例。如果您正苦于以下问题:PHP qid函数的具体用法?PHP qid怎么用?PHP qid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qid函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testRecoverPassword
function testRecoverPassword()
{
$this->login();
$this->get($this->url . "/recoverPassword.php");
if (strpos($this->getBrowser()->getContentAsText(), "your email address") === false) {
$this->fail("'your email address' not found when expected.");
return 1;
}
if (!$this->setFieldByName("email", "simpletest@localhost")) {
$this->fail("Failed to set email");
return 1;
}
if (!$this->clickSubmitByName("recover")) {
$this->fail("clicking recover returned false");
}
//fix the password so others can still login...
$md5pass = md5("simpletest");
pdo_query("UPDATE " . qid("user") . " SET password='{$md5pass}' WHERE email='simpletest@localhost'");
add_last_sql_error("test_recoverpassword");
$this->pass("Passed");
}
示例2: testRecoverPassword
public function testRecoverPassword()
{
$this->login();
$this->get($this->url . '/recoverPassword.php');
if (strpos($this->getBrowser()->getContentAsText(), 'your email address') === false) {
$this->fail("'your email address' not found when expected.");
return 1;
}
if (!$this->setFieldByName('email', 'simpletest@localhost')) {
$this->fail('Failed to set email');
return 1;
}
if (!$this->clickSubmitByName('recover')) {
$this->fail('clicking recover returned false');
}
//fix the password so others can still login...
$md5pass = md5('simpletest');
pdo_query('UPDATE ' . qid('user') . " SET password='{$md5pass}' WHERE email='simpletest@localhost'");
add_last_sql_error('test_recoverpassword');
$this->pass('Passed');
}
示例3: register_user
function register_user($projectid, $email, $firstName, $lastName, $repositoryCredential)
{
include dirname(__DIR__) . '/config/config.php';
$UserProject = new UserProject();
$UserProject->ProjectId = $projectid;
// Check if the user is already registered
$user = pdo_query('SELECT id FROM ' . qid('user') . " WHERE email='{$email}'");
if (pdo_num_rows($user) > 0) {
// Check if the user has been registered to the project
$user_array2 = pdo_fetch_array($user);
$userid = $user_array2['id'];
$user = pdo_query("SELECT userid FROM user2project WHERE userid='{$userid}' AND projectid='{$projectid}'");
if (pdo_num_rows($user) == 0) {
// not registered
// We register the user to the project
pdo_query("INSERT INTO user2project (userid,projectid,role,emailtype)\n VALUES ('{$userid}','{$projectid}','0','1')");
// We add the credentials if not already added
$UserProject->UserId = $userid;
$UserProject->AddCredential($repositoryCredential);
$UserProject->ProjectId = 0;
$UserProject->AddCredential($email);
// Add the email by default
echo pdo_error();
return false;
}
return '<error>User ' . $email . ' already registered.</error>';
}
// already registered
// Check if the repositoryCredential exists for this project
$UserProject->RepositoryCredential = $repositoryCredential;
if ($UserProject->FillFromRepositoryCredential() === true) {
return '<error>' . $repositoryCredential . ' was already registered for this project under a different email address</error>';
}
// Register the user
// Create a new password
$keychars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$length = 10;
$pass = '';
$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.
$pass .= substr($keychars, random_int(0, $max), 1);
}
$encrypted = md5($pass);
pdo_query('INSERT INTO ' . qid('user') . " (email,password,firstname,lastname,institution,admin)\n VALUES ('{$email}','{$encrypted}','{$firstName}','{$lastName}','','0')");
add_last_sql_error('register_user');
$userid = pdo_insert_id('user');
// Insert the user into the project
pdo_query("INSERT INTO user2project (userid,projectid,role,emailtype)\n VALUES ('{$userid}','{$projectid}','0','1')");
add_last_sql_error('register_user');
// We add the credentials if not already added
$UserProject->UserId = $userid;
$UserProject->AddCredential($repositoryCredential);
$UserProject->ProjectId = 0;
$UserProject->AddCredential($email);
// Add the email by default
$currentURI = get_server_URI();
$prefix = '';
if (strlen($firstName) > 0) {
$prefix = ' ';
}
$project = pdo_query("SELECT name FROM project WHERE id='{$projectid}'");
$project_array = pdo_fetch_array($project);
$projectname = $project_array['name'];
// Send the email
$text = 'Hello' . $prefix . $firstName . ",\n\n";
$text .= 'You have been registered to CDash because you have CVS/SVN access to the repository for ' . $projectname . "\n";
$text .= 'To access your CDash account: ' . $currentURI . "/user.php\n";
$text .= 'Your login is: ' . $email . "\n";
$text .= 'Your password is: ' . $pass . "\n\n";
$text .= 'Generated by CDash.';
if (cdashmail("{$email}", 'CDash - ' . $projectname . ' : Subscription', "{$text}")) {
echo 'Email sent to: ' . $email . '<br>';
} else {
add_log("cannot send email to: {$email}", 'register_user', LOG_ERR);
}
return true;
}
示例4: list
{
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: ";
$text .= "{$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='{$md5pass}' 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");
示例5: send_update_email
/** function to send email to site maintainers when the update
* step fails */
function send_update_email($handler, $projectid)
{
include 'config/config.php';
include_once 'include/common.php';
require_once 'include/pdo.php';
require_once 'models/build.php';
require_once 'models/project.php';
require_once 'models/buildgroup.php';
$Project = new Project();
$Project->Id = $projectid;
$Project->Fill();
// If we shouldn't sent any emails we stop
if ($Project->EmailBrokenSubmission == 0) {
return;
}
// If the handler has a buildid (it should), we use it
if (isset($handler->BuildId) && $handler->BuildId > 0) {
$buildid = $handler->BuildId;
} else {
// Get the build id
$name = $handler->getBuildName();
$stamp = $handler->getBuildStamp();
$sitename = $handler->getSiteName();
$buildid = get_build_id($name, $stamp, $projectid, $sitename);
}
if ($buildid < 0) {
return;
}
// Check if the group as no email
$Build = new Build();
$Build->Id = $buildid;
$groupid = $Build->GetGroup();
$BuildGroup = new BuildGroup();
$BuildGroup->SetId($groupid);
// If we specified no email we stop here
if ($BuildGroup->GetSummaryEmail() == 2) {
return;
}
// Send out update errors to site maintainers
$update_errors = check_email_update_errors($buildid);
if ($update_errors['errors']) {
// Find the site maintainer(s)
$sitename = $handler->getSiteName();
$siteid = $handler->getSiteId();
$to_address = '';
$email_addresses = pdo_query('SELECT email FROM ' . qid('user') . ',site2user WHERE ' . qid('user') . ".id=site2user.userid AND site2user.siteid='{$siteid}'");
while ($email_addresses_array = pdo_fetch_array($email_addresses)) {
if ($to_address != '') {
$to_address .= ', ';
}
$to_address .= $email_addresses_array['email'];
}
if ($to_address != '') {
$serverURI = get_server_URI();
// In the case of asynchronous submission, the serverURI contains /cdash
// we need to remove it
if ($CDASH_BASE_URL == '' && $CDASH_ASYNCHRONOUS_SUBMISSION) {
$serverURI = substr($serverURI, 0, strrpos($serverURI, '/'));
}
// Generate the email to send
$subject = 'CDash [' . $Project->Name . '] - Update Errors for ' . $sitename;
$update_info = pdo_query('SELECT command,status FROM buildupdate AS u,build2update AS b2u
WHERE b2u.updateid=u.id AND b2u.buildid=' . qnum($buildid));
$update_array = pdo_fetch_array($update_info);
$body = "{$sitename} has encountered errors during the Update step and you have been identified as the maintainer of this site.\n\n";
$body .= "*Update Errors*\n";
$body .= 'Status: ' . $update_array['status'] . ' (' . $serverURI . '/viewUpdate.php?buildid=' . $buildid . ")\n";
if ($CDASH_TESTING_MODE) {
add_log($to_address, 'TESTING: EMAIL', LOG_DEBUG);
add_log($subject, 'TESTING: EMAILTITLE', LOG_DEBUG);
add_log($body, 'TESTING: EMAILBODY', LOG_DEBUG);
} else {
if (cdashmail("{$to_address}", $subject, $body)) {
add_log('email sent to: ' . $to_address, 'sendEmailExpectedBuilds');
return;
} else {
add_log('cannot send email to: ' . $to_address, 'sendEmailExpectedBuilds');
}
}
}
}
}
示例6: exit
if (isset($_GET['method'])) {
require __DIR__ . '/index_old.php';
exit(0);
}
include dirname(dirname(dirname(__DIR__))) . '/config/config.php';
require_once 'include/pdo.php';
include 'include/common.php';
include 'include/version.php';
require_once 'models/project.php';
require_once 'models/buildfailure.php';
require_once 'include/filterdataFunctions.php';
require_once 'include/index_functions.php';
@set_time_limit(0);
// Check if we can connect to the database.
$db = pdo_connect("{$CDASH_DB_HOST}", "{$CDASH_DB_LOGIN}", "{$CDASH_DB_PASS}");
if (!$db || pdo_select_db("{$CDASH_DB_NAME}", $db) === false || pdo_query('SELECT id FROM ' . qid('user') . ' LIMIT 1', $db) === false) {
if ($CDASH_PRODUCTION_MODE) {
$response = array();
$response['error'] = 'CDash cannot connect to the database.';
echo json_encode($response);
return;
} else {
// redirect to the install.php script
$response = array();
$response['redirect'] = get_server_URI() . '/install.php';
echo json_encode($response);
return;
}
return;
}
@($projectname = $_GET['project']);
示例7: dirname
=========================================================================*/
require_once dirname(dirname(__DIR__)) . '/config/config.php';
require_once 'include/pdo.php';
require_once 'include/common.php';
$buildid = pdo_real_escape_numeric($_GET['buildid']);
if (!isset($buildid) || !is_numeric($buildid)) {
echo 'Not a valid buildid!';
return;
}
$db = pdo_connect("{$CDASH_DB_HOST}", "{$CDASH_DB_LOGIN}", "{$CDASH_DB_PASS}");
pdo_select_db("{$CDASH_DB_NAME}", $db);
// Find the notes
$note = pdo_query("SELECT * FROM buildnote WHERE buildid='{$buildid}' ORDER BY timestamp ASC");
while ($note_array = pdo_fetch_array($note)) {
$userid = $note_array['userid'];
$user_array = pdo_fetch_array(pdo_query('SELECT firstname,lastname FROM ' . qid('user') . " WHERE id='{$userid}'"));
$timestamp = strtotime($note_array['timestamp'] . ' UTC');
switch ($note_array['status']) {
case 0:
echo '<b>[note] </b>';
break;
case 1:
echo '<b>[fix in progress] </b>';
break;
case 2:
echo '<b>[fixed] </b>';
break;
}
echo 'by <b>' . $user_array['firstname'] . ' ' . $user_array['lastname'] . '</b>' . ' (' . date('H:i:s T', $timestamp) . ')';
echo '<pre>' . substr($note_array['note'], 0, 100) . '</pre>';
// limit 100 chars
示例8: auth
/**
* Authentication function
* This is called on every page load where common.php is selected, as well as when
* submitting the login form.
**/
function auth($SessionCachePolicy = 'private_no_expire')
{
include dirname(__DIR__) . '/config/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'])) {
// arrive from login form
@($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));
}
return authenticate($login, $passwd, $SessionCachePolicy, isset($_POST['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);
if (strlen($cookiekey) < 1) {
return false;
}
$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;
}
}
// Return early if a session has already been started.
if (session_status() != PHP_SESSION_NONE) {
return;
}
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']) {
//.........这里部分代码省略.........
示例9: echo_submission_table
function echo_submission_table()
{
@($limit = $_REQUEST['limit']);
if (!isset($limit)) {
$limit = 25;
} else {
$limit = pdo_real_escape_numeric($limit);
}
$rows = pdo_all_rows_query("SELECT * FROM " . qid("submission") . " ORDER BY id DESC LIMIT " . $limit);
$sep = ', ';
echo "<h3>Table `submission` (most recently queued {$limit})</h3>";
echo '<pre>';
echo 'id, filename, projectid, status, attempts, filesize, filemd5sum, ' . 'lastupdated, created, started, finished' . "\n";
echo "\n";
foreach ($rows as $row) {
echo $row['id'] . $sep . $row['filename'] . $sep . $row['projectid'] . $sep . $row['status'] . $sep . $row['attempts'] . $sep . $row['filesize'] . $sep . $row['filemd5sum'] . $sep . $row['lastupdated'] . $sep . $row['created'] . $sep . $row['started'] . $sep . $row['finished'] . "\n";
}
echo '</pre>';
echo '<br/>';
}
示例10: GetIdFromEmail
/** Get the user id from the email */
function GetIdFromEmail($email)
{
$email = pdo_real_escape_string($email);
$query = pdo_query("SELECT id FROM " . qid("user") . " WHERE email='" . trim($email) . "'");
if (!$query) {
add_last_sql_error("User:GetIdFromEmail");
return false;
}
if (pdo_num_rows($query) == 0) {
return false;
}
$query_array = pdo_fetch_array($query);
return $query_array['id'];
}
示例11: echo_file_contents
}
function echo_file_contents($filename)
{
// Emit the contents of the named file, but only if it exists.
// If it doesn't exist, emit nothing.
//
if (file_exists($filename)) {
$contents = file_get_contents($filename);
echo '<h3>contents of "' . $filename . '"</h3>';
echo '<pre>';
echo htmlentities($contents);
echo '</pre>';
echo '<br/>';
}
}
if ($session_OK) {
$userid = $_SESSION['cdash']['loginid'];
$user_is_admin = pdo_get_field_value('SELECT admin FROM ' . qid('user') . " WHERE id='{$userid}'", 'admin', 0);
if ($user_is_admin) {
echo_svn_output('--version');
echo_svn_output('remote -v');
echo_svn_output('status');
echo_svn_output('diff');
global $CDASH_ROOT_DIR;
echo_file_contents($CDASH_ROOT_DIR . '/config/config.local.php');
echo_file_contents($CDASH_ROOT_DIR . '/tests/config.test.local.php');
echo '<br/>';
} else {
echo 'Admin login required to display svn info.';
}
}
示例12: pdo_real_escape_numeric
$response['hidenav'] = 1;
@($projectid = $_GET['projectid']);
if ($projectid != null) {
$projectid = pdo_real_escape_numeric($projectid);
}
// If the projectid is not set and there is only one project we go directly to the page
if (!isset($projectid)) {
$project = pdo_query('SELECT id FROM project');
if (pdo_num_rows($project) == 1) {
$project_array = pdo_fetch_array($project);
$projectid = $project_array['id'];
}
}
@($show = $_GET['show']);
$role = 0;
$user_array = pdo_fetch_array(pdo_query('SELECT admin FROM ' . qid('user') . " WHERE id='{$userid}'"));
if ($projectid && is_numeric($projectid)) {
$user2project = pdo_query("SELECT role FROM user2project\n WHERE userid='{$userid}' AND projectid='{$projectid}'");
if (pdo_num_rows($user2project) > 0) {
$user2project_array = pdo_fetch_array($user2project);
$role = $user2project_array['role'];
}
}
if ($user_array['admin'] != 1 && $role <= 1) {
$response['error'] = "You don't have the permissions to access this page";
echo json_encode($response);
return;
}
// List the available projects that this user has admin rights to.
$sql = 'SELECT id,name FROM project';
if ($user_array['admin'] != 1) {
示例13: testCleanup
public function testCleanup()
{
pdo_query('DELETE FROM ' . qid('user') . "WHERE id={$this->UserId}");
pdo_query("DELETE FROM password WHERE userid={$this->UserId}");
$this->removeLineFromConfig($this->RotationConfig);
$this->removeLineFromConfig($this->UniqueConfig);
}
示例14: register_user
function register_user($projectid, $email, $firstName, $lastName, $repositoryCredential)
{
include "cdash/config.php";
$UserProject = new UserProject();
$UserProject->ProjectId = $projectid;
// Check if the user is already registered
$user = pdo_query("SELECT id FROM " . qid("user") . " WHERE email='{$email}'");
if (pdo_num_rows($user) > 0) {
// Check if the user has been registered to the project
$user_array2 = pdo_fetch_array($user);
$userid = $user_array2["id"];
$user = pdo_query("SELECT userid FROM user2project WHERE userid='{$userid}' AND projectid='{$projectid}'");
if (pdo_num_rows($user) == 0) {
// We register the user to the project
pdo_query("INSERT INTO user2project (userid,projectid,role,emailtype)\n VALUES ('{$userid}','{$projectid}','0','1')");
// We add the credentials if not already added
$UserProject->UserId = $userid;
$UserProject->AddCredential($repositoryCredential);
$UserProject->ProjectId = 0;
$UserProject->AddCredential($email);
// Add the email by default
echo pdo_error();
return false;
}
return "<error>User " . $email . " already registered.</error>";
}
// already registered
// Check if the repositoryCredential exists for this project
$UserProject->RepositoryCredential = $repositoryCredential;
if ($UserProject->FillFromRepositoryCredential() === true) {
return "<error>" . $repositoryCredential . " was already registered for this project under a different email address</error>";
}
// Register the user
// Create a new password
$keychars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$length = 10;
srand(make_seed_recoverpass());
$pass = "";
$max = strlen($keychars) - 1;
for ($i = 0; $i <= $length; $i++) {
$pass .= substr($keychars, rand(0, $max), 1);
}
$encrypted = md5($pass);
pdo_query("INSERT INTO " . qid("user") . " (email,password,firstname,lastname,institution,admin)\n VALUES ('{$email}','{$encrypted}','{$firstName}','{$lastName}','','0')");
add_last_sql_error("register_user");
$userid = pdo_insert_id("user");
// Insert the user into the project
pdo_query("INSERT INTO user2project (userid,projectid,role,emailtype)\n VALUES ('{$userid}','{$projectid}','0','1')");
add_last_sql_error("register_user");
// We add the credentials if not already added
$UserProject->UserId = $userid;
$UserProject->AddCredential($repositoryCredential);
$UserProject->ProjectId = 0;
$UserProject->AddCredential($email);
// Add the email by default
$currentURI = get_server_URI();
$prefix = "";
if (strlen($firstName) > 0) {
$prefix = " ";
}
$project = pdo_query("SELECT name FROM project WHERE id='{$projectid}'");
$project_array = pdo_fetch_array($project);
$projectname = $project_array['name'];
// Send the email
$text = "Hello" . $prefix . $firstName . ",<br><br>";
$text .= "You have been registered to CDash because you have CVS/SVN access to the repository for " . $projectname . " <br>";
$text .= "To access your CDash account: " . $currentURI . "/user.php<br>";
$text .= "Your login is: " . $email . "<br>";
$text .= "Your password is: " . $pass . "<br>";
$text .= "<br>Generated by CDash.";
if (@cdashmail("{$email}", "CDash - " . $projectname . " : Subscription", "{$text}", "From: {$CDASH_EMAILADMIN}\nReply-To: no-reply\nContent-type: text/plain; charset=utf-8\nX-Mailer: PHP/" . phpversion() . "\nMIME-Version: 1.0\nContent-type: text/html; charset=UTF-8")) {
echo "Email sent to: " . $email . "<br>";
}
return true;
}
示例15: set_include_path
set_include_path($cdashpath . PATH_SEPARATOR . get_include_path());
require_once "cdash/config.php";
require_once "cdash/pdo.php";
require_once "cdash/common.php";
$buildid = pdo_real_escape_numeric($_GET["buildid"]);
if (!isset($buildid) || !is_numeric($buildid)) {
echo "Not a valid buildid!";
return;
}
$db = pdo_connect("{$CDASH_DB_HOST}", "{$CDASH_DB_LOGIN}", "{$CDASH_DB_PASS}");
pdo_select_db("{$CDASH_DB_NAME}", $db);
// Find the notes
$note = pdo_query("SELECT * FROM buildnote WHERE buildid='{$buildid}' ORDER BY timestamp ASC");
while ($note_array = pdo_fetch_array($note)) {
$userid = $note_array["userid"];
$user_array = pdo_fetch_array(pdo_query("SELECT firstname,lastname FROM " . qid("user") . " WHERE id='{$userid}'"));
$timestamp = strtotime($note_array["timestamp"] . " UTC");
switch ($note_array["status"]) {
case 0:
echo "<b>[note] </b>";
break;
case 1:
echo "<b>[fix in progress] </b>";
break;
case 2:
echo "<b>[fixed] </b>";
break;
}
echo "by <b>" . $user_array["firstname"] . " " . $user_array["lastname"] . "</b>" . " (" . date("H:i:s T", $timestamp) . ")";
echo "<pre>" . substr($note_array["note"], 0, 100) . "</pre>";
// limit 100 chars