Skip to Content Skip to Menu

🕒 Save Time and Effort with CB Editor Assistant: Effortlessly create and refine content in Joomla 3, 4, & 5.
🎁 Limited Offer: Enjoy a 5-day FREE trial and save up to 30% afterward!

password protect

8 years 15 hours ago #290583 by matthewdavey
password protect was created by matthewdavey
Is it possible to password protect the edit profile button on the k2 user login somehow see attached
Because I want say like a business can join and the staff at the main computer can log in but only the head user can edit the profile?
This is a very important thing for me it has many uses
eg; a house could join and the parents could password protect the edit profile but the kids could still be able to use the instant message or access the live cam all with one account.

Is it possible to have aditional users to have access to a home CBuilder account
Thanks
Attachments:

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48711
  • Thanks: 8320
  • Karma: 1447
8 years 8 hours ago #290606 by krileon
Replied by krileon on topic password protect
You might be able to do this using a password field. Then using CB Auto Actions try to validate it on onBeforeUserUpdate. If it doesn't match then set an error in the user object or $_PLUGIN to block the save process. The below might work, but I've never tried it so you likely will need to trial and error it.

Global
Triggers: onBeforeUserUpdate
Type: Code
User: Automatic
Access: Everybody
Conditions
1: [var1_cb_editpassword] Not Equal To [var3_cb_editpassword]
Action
Method: PHP
Code:
Code:
global $_PLUGINS; $_PLUGINS->_setErrorMSG( CBTxt::T( 'Profile edit password is not valid.' ) );

The password would be set during registration. This will not allow them to change it unfortunately as it can't be changed and also validated at the same time. The profile owner would supply the password they set during registration which should allow profile edit to save. If they don't or it doesn't match then it should reject the profile edit save with the error supplied.

I suppose if they want to change that password they'd have to contact you to do so or you'd need to figure out some other way to validate profile edit permission.


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