Delete Spy Data for member when account is deleted.

This little source modification will delete all spy data for a member when the account is deleted. Tested on dolphin 7.0.7. Should work on some older versions as well. A number of people have complained about spy data remaining after a member is removed. This will take care of that.

Open the file inc\classes\BxDolUpdateMembersCache.php

Look for the following.

<?php

 class BxDolUpdateMembersCache extends BxDolAlertsResponse
 {

    // class constructor
    function BxDolUpdateMembersCache() {
       
    }

    // system event
    function response($o)
    {

        $sProfileStatus = null;
        $iProfileId = $o->iObject;

Directly under the line $iProfileId = $o->iObject; add the following.

        // Start Deano Mod. -- Clear spy data for deleted member.
        if ( $iProfileId ) {
            switch ($o->sAction) {
                case 'delete':
                    $sQuery = "DELETE FROM `bx_spy_data` WHERE `sender_id` = '$iProfileId' OR `recipient_id` = '$iProfileId'";
                    db_res($sQuery);
                break;   
            }
        }
        // End Deano Mod. -- Clear spy data for deleted member.






Hope this helps a few people.

https://www.deanbassett.com
Quote · 14 Aug 2011

deano, great post, though i think there are still issues with purging anything from memberships that have been removed. specifically speaking continued email notifications have been a problem on several instances. so when a membership is removed, is the script not running through the database and removing all associated data relevant to that userID 

When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support
Quote · 14 Aug 2011

I am sure there are other areas. This can be updated as needed to cover those.

https://www.deanbassett.com
Quote · 14 Aug 2011

Updated code to include message purging as well.

// Start Deano Mod. -- Clear spy data for deleted member.
if ( $iProfileId ) {
    switch ($o->sAction) {
        case 'delete':
        // Remove Spy Data for deleted member.
            $sQuery = "DELETE FROM `bx_spy_data` WHERE `sender_id` = '$iProfileId' OR `recipient_id` = '$iProfileId'";
            db_res($sQuery);
        // Remove Message from deleted member.
            $sQuery = "DELETE FROM `sys_messages` where `Sender` = '$iProfileId' OR `Recipient` = '$iProfileId'";
            db_res($sQuery);
    break;  
    }
}
// End Deano Mod. -- Clear spy data for deleted member.

https://www.deanbassett.com
Quote · 14 Aug 2011

Excellent work Deano!

Quote · 15 Aug 2011

Hi,

 

It did not work for me on version 7.0.9, is that the case, or it could be an issue in my site?


Best Regards,

Okatanani

Quote · 12 Jul 2012

 same here :(

Hi,

 

It did not work for me on version 7.0.9, is that the case, or it could be an issue in my site?


Best Regards,

Okatanani

 

You Creature!!
Quote · 23 Jul 2012

I have tested on 7.0.9.

Are you trying to get rid of data for members that were already deleted?

Because this does not do that.

This is a patch to delete that data for members deleted after the patch is applied.

https://www.deanbassett.com
Quote · 23 Jul 2012

oh sorry deano, yeah i was trying to remove the data from already deleted members, thats ok then as my site isnt launched to the public yet so will work fine with me :) thanks bud.

 

Charlie

 

I have tested on 7.0.9.

Are you trying to get rid of data for members that were already deleted?

Becuse this does not do that.

This is a patch to delete that data for members deleted after the patch is applied.

 

You Creature!!
Quote · 23 Jul 2012

Thank you deano, great code.
is there a query to clean all old messages from deleted usersaccounts?

greetings from switzerland

Quote · 17 Aug 2012

 

Thank you deano, great code.
is there a query to clean all old messages from deleted usersaccounts?

greetings from switzerland

4'th post in this topic contains a update for messages.

If you are refering to accounts that were deleted prior to installing this patch, then no.


https://www.deanbassett.com
Quote · 17 Aug 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.