From f9d0d9226a4c54222238c7bab88b7fa042743684 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 17 Jul 2024 16:50:42 -0700 Subject: [PATCH] web: use the SHOW_USER_PAGE constant instead of 'show_user.php' --- html/inc/user.inc | 7 ++++++- html/inc/util.inc | 2 +- html/user/show_coproc.php | 5 ++++- html/user/view_profile.php | 7 +++++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/html/inc/user.inc b/html/inc/user.inc index 71086e99c5..777aea8062 100644 --- a/html/inc/user.inc +++ b/html/inc/user.inc @@ -94,7 +94,12 @@ function show_project($project) { if ($project->url == "http://www.worldcommunitygrid.org/") { $x = $project->name; } else { - $x = "url"."show_user.php?userid=$project->id\">$project->name"; + $x = sprintf( + '%s', + $project->url, + $project->id, + $project->name + ); } echo " $x diff --git a/html/inc/util.inc b/html/inc/util.inc index 5f93d4906b..0b3d5c92b0 100644 --- a/html/inc/util.inc +++ b/html/inc/util.inc @@ -99,7 +99,7 @@ if (!defined('HOME_PAGE')) { define('HOME_PAGE', 'home.php'); } -// the page showing another user. +// the page showing another user ('userid' arg). // Link to here wherever we show a user name. // if (!defined('SHOW_USER_PAGE')) { diff --git a/html/user/show_coproc.php b/html/user/show_coproc.php index c232d887c0..c409532e26 100644 --- a/html/user/show_coproc.php +++ b/html/user/show_coproc.php @@ -75,7 +75,10 @@ function show_row($x, $y, $mode) { break; case 'user': $user = BoincUser::lookup_id($x); - echo "$user->name"; + echo sprintf( + '%s', + SHOW_USER_PAGE, $x, $user->name + ); break; case 'team': $team = BoincTeam::lookup_id($x); diff --git a/html/user/view_profile.php b/html/user/view_profile.php index b1510fb212..993c6d4862 100644 --- a/html/user/view_profile.php +++ b/html/user/view_profile.php @@ -62,8 +62,11 @@ show_profile($user, $logged_in_user); end_table(); echo ""; start_table("table-striped"); -row2(tra("Account data"), - "".tra("View")."" +row2(tra("User info"), + sprintf( + '%s', + SHOW_USER_PAGE, $userid, tra("View") + ) ); community_links($community_links_object, $logged_in_user);