Skip to content

Commit e99c3ab

Browse files
Merge branch 'master' of https://github.com/BOINC/boinc
2 parents 7c4528a + 0e4b412 commit e99c3ab

7 files changed

Lines changed: 50 additions & 30 deletions

File tree

client/cs_scheduler.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -679,10 +679,20 @@ int CLIENT_STATE::handle_scheduler_reply(
679679
// insert extra elements, write to disk, and parse
680680
//
681681
if (sr.global_prefs_xml) {
682-
// skip this if we have host-specific prefs
683-
// and we're talking to an old scheduler
684-
//
685-
if (!global_prefs.host_specific || sr.scheduler_version >= 507) {
682+
if (gstate.acct_mgr_info.using_am()
683+
// ignore prefs if we're using prefs from account mgr
684+
//
685+
&& !strcmp(global_prefs.source_project, gstate.acct_mgr_info.master_url)
686+
) {
687+
if (log_flags.sched_op_debug) {
688+
msg_printf(project, MSG_INFO,
689+
"ignoring prefs from project; using prefs from AM"
690+
);
691+
}
692+
} else if (!global_prefs.host_specific || sr.scheduler_version >= 507) {
693+
// ignore prefs if we have host-specific prefs
694+
// and we're talking to an old scheduler
695+
//
686696
retval = save_global_prefs(
687697
sr.global_prefs_xml, project->master_url, scheduler_url
688698
);

drupal/sites/default/boinc/modules/boinc_solr_search/boinc_solr_comments/boinc_solr_comments.module

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function boinc_solr_comments_apachesolr_index_documents_alter(array &$documents,
107107

108108
$comment_document->entity_id = $comment->cid;
109109
$comment_document->entity_type = 'comment';
110-
$comment_document->bundle = 'comment';
110+
$comment_document->bundle = 'Comment';
111111
$comment_document->bundle_name = 'Comment';
112112

113113
$comment_document->path = 'goto/comment/' . $comment->cid;

html/inc/account.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
// forms for account creation and login
2020

2121
function create_account_form($teamid, $next_url) {
22+
global $recaptcha_public_key;
2223
echo "
2324
<form action=\"create_account_action.php\" method=\"post\">
2425
<input type=hidden name=next_url value=\"$next_url\">
@@ -75,13 +76,12 @@ function create_account_form($teamid, $next_url) {
7576
);
7677
}
7778

78-
// Check if we're reCaptcha to prevent spam accounts
79+
// Check if we're using reCaptcha to prevent spam accounts
7980
//
80-
$publickey = parse_config(get_config(), "<recaptcha_public_key>");
81-
if ($publickey) {
81+
if ($recaptcha_public_key) {
8282
row2(
8383
"",
84-
boinc_recaptcha_get_html($publickey)
84+
boinc_recaptcha_get_html($recaptcha_public_key)
8585
);
8686
}
8787

html/inc/bootstrap.inc

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,20 @@ function navbar_right($user) {
7979
';
8080
if (!$is_login_page) {
8181
if ($user) {
82-
echo '
83-
<li><a href=home.php>'.$user->name.'</a></li>
84-
';
82+
echo sprintf('
83+
<li><a href=%shome.php>'.$user->name.'</a></li>
84+
', URL_BASE
85+
);
8586
$url_tokens = url_tokens($user->authenticator);
86-
echo '
87-
<li><a href="logout.php?'.$url_tokens.'">Log out</a></li>
88-
';
87+
echo sprintf('<li><a href="%slogout.php?%s">Log out</a></li>',
88+
URL_BASE, $url_tokens
89+
);
8990
} else {
90-
echo '
91-
<li><a href="create_account_form.php">Sign Up</a></li>
92-
<li><a href="login_form.php">Login</a></li>
93-
';
91+
echo sprintf('
92+
<li><a href="%screate_account_form.php">Sign Up</a></li>
93+
<li><a href="%slogin_form.php">Login</a></li>
94+
', URL_BASE, URL_BASE
95+
);
9496
}
9597
}
9698
}

html/inc/recaptchalib.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,15 @@
2222
require('../inc/recaptcha_loader.php');
2323

2424
function boinc_recaptcha_get_head_extra() {
25-
// are we using recaptcha?
26-
$publickey = parse_config(get_config(), "<recaptcha_public_key>");
27-
if ($publickey) {
25+
global $recaptcha_public_key;
26+
if ($recaptcha_public_key) {
2827
// the meta tag must be included
2928
// for Recaptcha to work with some IE browsers
3029
return '<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >
31-
<script src="https://www.google.com/recaptcha/api.js" async defer></script>';
32-
} else {
33-
return null;
30+
<script src="https://www.google.com/recaptcha/api.js?ver=2" async defer></script>
31+
';
3432
}
33+
return "";
3534
}
3635

3736
function boinc_recaptcha_get_html($publickey) {
@@ -56,4 +55,4 @@ function boinc_recaptcha_isValidated($privatekey) {
5655
return true;
5756
}
5857

59-
?>
58+
?>

html/inc/util.inc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ require_once("../inc/translation.inc");
3131
require_once("../inc/profile.inc");
3232
require_once("../inc/bootstrap.inc");
3333

34-
$master_url = parse_config(get_config(), "<master_url>");
34+
// parse some stuff from config (do it here for efficiency)
35+
//
36+
$config = get_config();
37+
$master_url = parse_config($config , "<master_url>");
38+
$no_computing = parse_bool($config, "no_computing");
39+
$recaptcha_public_key = parse_config($config, "<recaptcha_public_key>");
40+
$recaptcha_private_key = parse_config($config, "<recaptcha_private_key>");
3541

3642
// don't allow /... at the end of URL
3743

@@ -152,7 +158,7 @@ function get_logged_in_user($must_be_logged_in=true) {
152158
}
153159
}
154160
$next_url = urlencode($next_url);
155-
Header("Location: login_form.php?next_url=$next_url");
161+
Header("Location: ".URL_BASE."login_form.php?next_url=$next_url");
156162
exit;
157163
}
158164
$got_logged_in_user = true;
@@ -533,7 +539,8 @@ function check_tokens($auth) {
533539
}
534540

535541
function no_computing() {
536-
return parse_bool(get_config(), "no_computing");
542+
global $no_computing;
543+
return $no_computing;
537544
}
538545

539546
// Generates a legal filename from a parameter string.

lib/boinc_win.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@
3131
#pragma warning(disable: 4244) // conversion from int to char
3232
#define getpid _getpid
3333
#define getcwd _getcwd
34-
#define snprintf _snprintf
3534
#define strdate _strdate
3635
#define strdup _strdup
3736
#define stricmp _stricmp
3837
#define strtime _strtime
38+
#if _MSC_VER < 1900
39+
#define snprintf _snprintf
40+
#endif
3941
#endif
4042

4143
#ifndef HAVE_CONFIG_H

0 commit comments

Comments
 (0)