From 9220ceb02a669788e19bf48dda5640894e62c26a Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 5 Feb 2014 17:21:03 -0800 Subject: [PATCH] Admin web: deprecate problem_host.php, which sends a confusing email to user --- html/ops/index.php | 1 - html/ops/problem_host.php | 24 +++++++----------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/html/ops/index.php b/html/ops/index.php index ec01cc516e..7528ba8d05 100644 --- a/html/ops/index.php +++ b/html/ops/index.php @@ -118,7 +118,6 @@ echo "
  • User privileges
  • User job submission privileges
  • Send mass email to a selected set of users
  • -
  • Email user with misconfigured host
  • ID: diff --git a/html/ops/problem_host.php b/html/ops/problem_host.php index d54bd8549d..8e480087f0 100644 --- a/html/ops/problem_host.php +++ b/html/ops/problem_host.php @@ -16,23 +16,15 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . +// DEPRECATED - the email by this script doesn't tell the +// volunteer anything specific or useful. + require_once("../inc/db.inc"); require_once("../inc/util_ops.inc"); require_once("../inc/email.inc"); -// activate/deactivate script -if (0) { - echo " -This script needs to be activated before it can be run. -Once you understand what the script does you can change the -if (1) to if (0) at the top of the file to activate it. -Be sure to deactivate the script after using it to make sure -it is not accidentally run. -"; - exit; -} +exit(); -db_init(); function send_problem_email($user, $host) { global $master_url; @@ -110,7 +102,7 @@ For further information and assistance with ".PROJECT." go to $master_url"; } -$hostid = $_GET["hostid"]; +$hostid = get_int("hostid", true); if (!$hostid) { admin_page_head("Misconfigured Host"); @@ -122,14 +114,12 @@ if (!$hostid) { "; } else { - $res = mysql_query("select * from host where id='$hostid'"); - $host = mysql_fetch_object($res); + $host = BoincHost::lookup_id($hostid); if (!$host) { echo "

    No host with that ID

    Please try again
    "; } else { - $res = mysql_query("select * from user where id='$host->userid'"); - $user = mysql_fetch_object($res); + $user = BoincUser::lookup_id($host->userid); echo "Do another?

    "; send_problem_email($user, $host); echo "Email to ".$user->email_addr." has been sent.
    ";