bug: buddy_manage.php - deleted users showing as ghost buddies bug: buddy_manage.php - deleted users showing as ghost buddies
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

bug: buddy_manage.php - deleted users showing as ghost buddies

Started by bitcloud, September 24, 2008, 12:18:40 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

bitcloud

Hi Stramm... others...

I have a lot of deleted users on my gallery. This means that there are some users who were "buddies" with others, but are now deleted.
In buddy_manage.php it shows up no username, just the text "offline" for where these users used to be.

I'm not sure if this bug has been addressed, but it should be a matter of changing a CPG db query somewhere to check if a user exists before returning a buddy result. (and potentially the delete user file should be updated for this mod)

Thanks in advance for any help on what to change to correct this

Stramm

hmm.. yes, the buddy table needs an update when a user gets deleted.

bitcloud

Thanks for the quick response...

in the mean time, can you think of which queries I should look toward modifying so that buddies only get called up if they're existing users?

Stramm

That's not the way I'm going to fix it. To clean the buddy table you either nedd to check each entry manually or write a lil script that'll do that for you.

bitcloud

ok... I might do a hacky edit on the delete user file, and do what you say.. write a script to clean the buddy list..

Cheers for the advice :)

bitcloud

Strangely enough I found these lines:

//Delete Notifications
//Cleanup buddy tables

In delete.php. Not sure if they are your mods or mine (probably yours)
I can't duplicate the orphaned buddy entries when deleting anymore, so I'm not sure how all these orphaned/deleted buddies came about.

Anyway, to clean up the buddy table (if anyone else experiences this), I plugged this into phpmyadmin:
DELETE FROM `cpg1410_buddy` where user_id not in (select user_id from `cpg1410_users`)

and:

DELETE FROM `cpg1410_buddy` where buddy_id not in (select user_id from `cpg1410_users`)
(replacing cpg1410 with whatever your version)