Skip to Content Skip to Menu

Deleting accounts on front end

1 year 3 weeks ago #335623 by flappleton
Deleting accounts on front end was created by flappleton
Is it possible to delete accounts on the front end?

Mark

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
1 year 3 weeks ago #335634 by krileon
Replied by krileon on topic Deleting accounts on front end
Yes, CB Privacy provides fields to allow a user to delete their own account or even just disable their own account.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

1 year 3 weeks ago #335643 by flappleton
Replied by flappleton on topic Deleting accounts on front end
Sorry, I wasn’t clear: I meant can an administrator delete other user accounts, not their own, from the front end. 

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
1 year 3 weeks ago #335645 by krileon
Replied by krileon on topic Deleting accounts on front end
They can use the delete account and disable account fields provided by CB Privacy on the users behalf. So you could use those for doing that on frontend, yes. Aside from that no there is no frontend delete. It's possible to implement that using CB Auto Actions though.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

1 year 3 weeks ago #335646 by flappleton
Replied by flappleton on topic Deleting accounts on front end
Thanks for the quick response. Where can I get more information about CB Auto Actions?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
1 year 3 weeks ago #335648 by krileon
Replied by krileon on topic Deleting accounts on front end
The below can be used to delete a user. You'd simply need to provide a link for it on each users profile.

Global
Triggers: None
Type: Code
User: Self
Access: All Moderators
Conditions
Field: Custom > Value
Custom Value: [get_delete]
Operator: Not Equal To
Value: [user_id]
Action
Method: PHP
Code:
Code:
$user = CBuser::getUserDataInstance( (int) '[get_delete]' ); if ( ! $user->getInt( 'id', 0 ) ) { return 'User does not exist'; } if ( ! $user->delete() ) { return $user->getError(); } return 'User deleted successfully';
Output
Display: Redirect
URL: index.php

Once saved under the Global tab you'll have a URL to directly execute the auto action. It should be something like the following.
Code:
index.php?option=com_comprofiler&view=pluginclass&plugin=cbautoactions&action=action&actions=ACTION_ID_HERE

The above example is dependent on the user being deleted being supplied in the URL. Specifically their user id being set to &delete=USER_ID_HERE. Since this URL is going to be displayed on profile with presumably a Custom HTML field you can substitute that in.
Code:
index.php?option=com_comprofiler&view=pluginclass&plugin=cbautoactions&action=action&actions=ACTION_ID_HERE&delete=[user_id]

You could use this in a button, a link, etc.. it ensures only CB Moderators can run the auto action and it won't let them delete themselves. You may want to add other checks as needed though (e.g. check that [get_delete] isn't empty and isn't a moderator).

Just using the built in delete account field provided by CB Privacy would be far simpler though.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum