Changed to only show info about userids that have a valid profile.

svn path=/trunk/boinc/; revision=1735
This commit is contained in:
David Anderson 2003-07-18 21:56:11 +00:00
parent e840468a1b
commit 19c55f3204
1 changed files with 8 additions and 7 deletions

View File

@ -33,14 +33,15 @@ if ($_POST['recommend']) {
}
$result = mysql_query("SELECT * FROM profile WHERE userid = $user->id");
if ($result) {
$profile_info = mysql_fetch_array($result, MYSQL_ASSOC);
}
else {
profile_error_page("No profile exists for that user, or there was a database error.<p>");
exit();
}
if (mysql_num_rows($result) > 0) {
$profile_info = mysql_fetch_array($result, MYSQL_ASSOC);
} else {
// TODO: Standardize this to a global error page.
echo "No user profile exists for that user ID.";
exit();
}
$logged_in_user = get_logged_in_user(false); // (false) since anyone can look at profiles.
$can_edit = $logged_in_user && $user->id == $logged_in_user->id;