From dff8fcffc6ab5532b98bc3835d83479ffd0ac9e8 Mon Sep 17 00:00:00 2001 From: Christian Beer Date: Mon, 20 Jun 2016 15:14:55 +0200 Subject: [PATCH] Web: read-only RPCs should use the replica DB --- html/user/am_get_info.php | 1 + html/user/apps.php | 1 + html/user/forum_get_data.php | 1 + html/user/get_project_config.php | 1 + html/user/result_status.php | 1 + html/user/team_email_list.php | 5 +++-- html/user/team_lookup.php | 2 ++ 7 files changed, 10 insertions(+), 2 deletions(-) diff --git a/html/user/am_get_info.php b/html/user/am_get_info.php index 54f5b3056e..6c2fb5802c 100644 --- a/html/user/am_get_info.php +++ b/html/user/am_get_info.php @@ -19,6 +19,7 @@ require_once("../inc/boinc_db.inc"); require_once("../inc/xml.inc"); +BoincDb::get(true); xml_header(); $retval = db_init_xml(); diff --git a/html/user/apps.php b/html/user/apps.php index 7081ff8a0d..5e9995d92d 100644 --- a/html/user/apps.php +++ b/html/user/apps.php @@ -20,6 +20,7 @@ require_once("../inc/util.inc"); check_get_args(array("xml")); +BoincDb::get(true); $platforms = BoincPlatform::enum("deprecated=0"); $xml = get_str('xml', true); diff --git a/html/user/forum_get_data.php b/html/user/forum_get_data.php index 36e9b7248e..59d9c19394 100644 --- a/html/user/forum_get_data.php +++ b/html/user/forum_get_data.php @@ -20,6 +20,7 @@ require_once("../inc/forum_db.inc"); require_once("../inc/util.inc"); require_once("../inc/xml.inc"); +BoincDb::get(true); xml_header(); if (DISABLE_FORUMS) { diff --git a/html/user/get_project_config.php b/html/user/get_project_config.php index 0dbfc3cc5a..ac2df32bac 100644 --- a/html/user/get_project_config.php +++ b/html/user/get_project_config.php @@ -19,6 +19,7 @@ require_once("../inc/util.inc"); require_once("../inc/xml.inc"); +BoincDb::get(true); xml_header(); // This all needs to work even when DB is down. diff --git a/html/user/result_status.php b/html/user/result_status.php index 4077b7df97..2ec641c990 100644 --- a/html/user/result_status.php +++ b/html/user/result_status.php @@ -56,6 +56,7 @@ function result_xml($r) { "; } +BoincDb::get(true); xml_header(); echo "\n"; foreach ($ids as $id) { diff --git a/html/user/team_email_list.php b/html/user/team_email_list.php index 5963cf4c35..303dd1dbb6 100644 --- a/html/user/team_email_list.php +++ b/html/user/team_email_list.php @@ -34,6 +34,7 @@ if (DISABLE_TEAMS) { } } +BoincDb::get(true); if ($xml) { $creditonly = get_int('creditonly', true); xml_header(); @@ -52,7 +53,7 @@ if ($xml) { //$users = BoincUser::enum("teamid=$team->id"); foreach($users as $user) { show_team_member($user, $show_email, $creditonly); - } + } echo "\n"; exit(); } @@ -81,7 +82,7 @@ foreach($users as $user) { $e = $user->send_email?"$user->email_addr":""; table_row(user_links($user, BADGE_HEIGHT_MEDIUM), $e, format_credit($user->total_credit), format_credit($user->expavg_credit), $user->country); } -} +} if (!$plain) { end_table(); echo "

".tra("Show as plain text")."

"; diff --git a/html/user/team_lookup.php b/html/user/team_lookup.php index 718894bbae..a94a2a2b31 100644 --- a/html/user/team_lookup.php +++ b/html/user/team_lookup.php @@ -28,6 +28,8 @@ $format = get_str("format", true); $team_id = get_int("team_id", true); $team_ids = get_str("team_ids", true); +BoincDb::get(true); + if ($team_id || $team_ids || ($format == 'xml')) { require_once ('../inc/xml.inc'); xml_header();