how to delete account

Hi,

I want to create a functionality that allows users to delete their community accounts, and I'm not sure how to do it.

Should I logout the user before I delete them, will they automatically be logged out as they are deleted?

Can I use a REST service like the function below, or should I use a built-in delete stored procedure from the database?

                $.telligent.evolution.del({
                   url: $.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/users/{id}.json',
                   data: { 
                      'id': userId
                   },
                   success: function(response) {
                        
                   }
                });

Any feedback is appreciated.

Regards,

Silviu

Parents Reply
  • Thanks you all for your responses. In the meantime I actually noticed that things are not as simple as they seem. It looks like if a user is a simple member he does not have the rights to actually delete himself, so I should write a plugin in order to do this, because there I can use the RunAsUser method 

                Apis<IUsers>().RunAsUser("admin", () =>
                {
                    Apis<IUsers>().Delete(userOptions);
                });

    Or is there a telligent ajax api for this? Another thing I want to check before deletion is if the user is not impersonated or anonymous. How can I check that for the current user?

Children