Deletion profile

Hello,
I did not well understand, the deletion of a user.
Apparently all remits in the function(office) profile_delete in admin.inc.php.
But photos for example and adversity of the user are not deleted?

 

I did not find how is managed the deletion of to user in the module photo.

Strange.

Regard

Quote · 15 Jun 2011

Sorry but I don't understand your question. Can you explain me more clearly what you want?

PS: If possible do not write me personally, please try to ask on the forum first
Quote · 15 Jun 2011

Sorry English is not my language

I wonder how boonex delete photos and avatars during profile deletion process.

I wanted to take it as example for my own modules.

 

Regard

Quote · 16 Jun 2011

They are deleted, but is not directly handled in the profile_delete function. It is handled by the photo module in response to an alert.

In admin.inc.php in the profile delete function your will see this near the bottom.

    require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolAlerts.php');
    $oZ = new BxDolAlerts('profile', 'delete',  $ID);
    $oZ->alert();


This creates an alert

All alerts are in the database in the tables sys_alerts and sys_alerts_handlers

So when this alert is created, dolphin will lookup all profile delete alerts and call the handler for each of them

In the case of the photos, the alert runs a service call function in the photos module like so, BxDolService::call('photos', 'response_profile_delete', array($this)); and it handles deleting the photos.

So. calling profile_delete is really all you need to do in your module. The alert it generates will handle deleting of items not specifically deleted by that function.

It is done this way for a reason. The profile delete function only specifically deletes items that exist regardless of what modules are installed. The rest are handled by the alert system. This way no attempt to delete photos is done if the photo module is not installed.

So each module that has to remove things when a profile is deleted will create alert entries in the database when the module is installed so the alert system will call the modules delete functions. Those alerts are removed when the module is uninstalled so the delete functions for that module are no longer called.

I am sure i did not do a very good job of explaining that, but that's how it works.


https://www.deanbassett.com
Quote · 16 Jun 2011

Ha it is great really thank you.
Yes it is very well explained.

 

Best Regard

Quote · 16 Jun 2011
 
 
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.