- Added additional spam fighting measure to profile.inc. Profiles for

users with RAC less than <profile_min_credit> with only be displayed if
 the viewing user is logged in.


svn path=/trunk/boinc/; revision=16004
This commit is contained in:
Eric J. Korpela 2008-09-16 22:03:43 +00:00
parent 527da28e54
commit 3be692ce7f
2 changed files with 17 additions and 2 deletions

View File

@ -7449,3 +7449,9 @@ Rom 15 Sept 2008
clientscr/
screensaver_win.cpp
Eric 16 Sept 2008
- Added additional spam fighting measure to profile.inc. Profiles for
users with RAC less than <profile_min_credit> with only be displayed if
the viewing user is logged in.

View File

@ -190,6 +190,17 @@ function get_profile_summary($profile) {
//
function show_profile($user, $logged_in_user, $screen_mode = false) {
BoincForumPrefs::lookup($user);
$is_logged_in = isset($logged_in_user);
$can_edit = isset($logged_in_user) && $logged_in_user && $user->id == $logged_in_user->id;
$min_credit = parse_config(get_config(), "<profile_min_credit>");
if ((!$is_logged_in) && $min_credit && $user->expavg_credit < $min_credit ) {
error_page(
"To prevent spam, profiles of users with an average credit of less than $min_credit will only be displayed to users who are logged in to their accounts. We appologize for this inconvenience."
);
}
if (is_banished($user)) {
error_page("User is banished");
}
@ -198,8 +209,6 @@ function show_profile($user, $logged_in_user, $screen_mode = false) {
error_page("No user profile exists for that user ID.");
}
$can_edit = isset($logged_in_user) && $logged_in_user && $user->id == $logged_in_user->id;
if ($can_edit) {
row1("<a href=create_profile.php>Edit your profile</a>");
}