Opened 16 years ago

Closed 16 years ago

#505 closed Defect (fixed)

ignore function broken on add and remove users.

Reported by: Ageless Owned by: davea
Priority: Minor Milestone: Undetermined
Component: Web - Forums Version:
Keywords: forums preferences Cc:

Description (last modified by Ageless)

Both adding to filter and removing from filter is broken. David did add !'s to the add_to_ignore code, but in [14289] it's still broken. When I tested this on Cosmology@Home by adding users to ignore, or with users already on ignore changing my preferences and saving them, the screen would reload and at the top of it it says "Missing user xx", where xx is the user's ID number.

Removing from filter in edit_forum_preferences_action.php is now:

$ignored_users = get_ignored_list($user);
for ($i=0;$i<sizeof($ignored_users);$i++){
    if ($_POST["remove".trim($ignored_users[$i])]!=""){
        $other_user = BoincUser::lookup_id($user_to_add);
        if (!$other_user) {
            echo "No such user: $other_user";
        } else {
            remove_ignored_user($user, $other_user);
        }
    }
}

With help of TJM of Enigma, this should be

$ignored_users = get_ignored_list($user); 
for ($i=0;$i<sizeof($ignored_users);$i++){ 
    if ($_POST["remove".trim($ignored_users[$i])]!=""){ 
        $other_user = BoincUser::lookup_id($ignored_users[$i]); 
        if (!$other_user) { 
            echo "No such user: $other_user"; 
        } else { 
            remove_ignored_user($user, $other_user); 
        } 
    } 
}

Change History (3)

comment:1 Changed 16 years ago by Ageless

Description: modified (diff)

comment:2 Changed 16 years ago by Ageless

Summary: ignore function broken or add and remove users.ignore function broken on add and remove users.

fixing title.

comment:3 Changed 16 years ago by davea

Resolution: fixed
Status: newclosed

(In [14290]) - user web: fix bug in user filter; fixes #505

Note: See TracTickets for help on using tickets.