[SOLVED] Allow users to deactivate (unpublish) their profil

12 years 10 months ago - 12 years 10 months ago #166774 by userbk
Is there a way I can allow my users to publish/unpublish their own account? Not delete it, but deactivate it and then be able to reactivate it.
Possible?

Please Log in to join the conversation.

12 years 10 months ago #166859 by krileon
There might be something at Joomla.org, but am not aware of any such feature unless for example they ask a moderator to ban their account. CB it self does not provide such a feature. I suppose you could create a checkbox field then use CB Queries to execute a database query to ban their profile with the reason of "Disabled account" for instance after profile update checking that the checkbox field is equal to 1 first.


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 to join the conversation.

12 years 10 months ago - 12 years 10 months ago #166873 by userbk
Good morning K,
I downloaded and installed Queries and created a checkbox for "Disable Account".

Is there any chance you could write me what the query I should add is? I haven't the faintest idea how to do that. I'll appreciate it enormously.

Also, once the user checks that box and disables his account, will that user be able to login again and re-enable his/her account?

Indeed, I found nothing that could do that, so that query is like the holy grail of... well... disabling accounts on CB :)

Cheers,
bk
PS - does this have anything to do with it? docs.joomla.org/API15:JTable/publish

Please Log in to join the conversation.

12 years 10 months ago #166905 by krileon

Is there any chance you could write me what the query I should add is? I haven't the faintest idea how to do that. I'll appreciate it enormously.

Please see the below configuration. You will need to create 2 of these, 1 for enable and 1 for disable.

Disable
Trigger: onAfterUserUpdate,onAfterUpdateUser
User: Automatic
Access: - All Registered Users
Condition: FIELD, Equal To, 1
Query:
UPDATE `#__comprofiler` SET `banned` = 1, `banneddate` = NOW(), `bannedby` = '[user_id]', `bannedreason` = 'Account manually disabled' WHERE `user_id` = '[user_id]'
Mode: Internal

Enable
Trigger: onAfterUserUpdate,onAfterUpdateUser
User: Automatic
Access: - All Registered Users
Condition: FIELD, Empty
Query:
UPDATE `#__comprofiler` SET `banned` = 0, `unbanneddate` = NOW() WHERE `user_id` = '[user_id]'
Mode: Internal

Please test the above thoroughly. It may require tweaking and is completely untested.

Also, once the user checks that box and disables his account, will that user be able to login again and re-enable his/her account?

No, but they'll still be able to use the site moderately; their profile would be disabled which would give them contact information to contact a moderator if need be.


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 to join the conversation.

12 years 10 months ago #166917 by userbk
I don't know what to say :woohoo:
I cannot give Community Builder another rave review since i already did on joomla.org
Thank you so much for your continuous incredible support. I am so glad I decided to use CB. What an incredible thing and what an incredible team you guys are.

Works perfectly well.
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

12 years 9 months ago #168692 by userbk
Still loving that my users can activate or deactivate their account, but now I'm facing another problem. Suppose I want to Ban their profile for some reason, they can always simply select Enable and reactivate their account.
Is there a way to allow them to reactivate their account, only if the reason = Account manually disabled?

BK

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.204 seconds

Facebook Twitter LinkedIn