Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

Password Reset (Set password) via Auto-actions possible?

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
8 years 10 months ago #275030 by nant

xengent wrote: So I can use this method to register a user and set their password initially on registration: www.joomlapolis.com/forum/153-professional-member-support/231927-rest-api-style-cb-user-registration-direct-url-using-auto-actions

I wanna do the same thing (via URL) to reset a password for an existing user. Is there a use case for updating user profile field data via URL request?

In the autoactions section I see a couple of things that look promising:
1. First screenshot - Type/Action and Action/Profile-Update
2. Second screenshot - Type/Field and Action/Password

Thanks for looking into this.


Hi again.

As this thread involves coding proposals it is really out of scope of normal support and requires (if possible and doable) developer feedback.

There are no guarantees that devs will be able to propose code for you but I have marked the thread for devs to give feedback to as soon as possible.

Thank you for your patience.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48464
  • Thanks: 8280
  • Karma: 1443
8 years 10 months ago #275187 by krileon
Yes it's possible, but what you're asking is dangerous. The security problems surrounding this are going to bite you somewhere down the road. You can change the password field using a Field action, but you can not reset it from a Field action.

To randomize it you need to use a Code action with PHP method, construct the user object, and run setRandomPassword() function on it followed by a store. Example as follows.

Code:
$user = CBuser::getInstance( '[user_id]' ); $user->setRandomPassword(); $user->store();

Again, I really don't recommend doing this. Always use manual action for password reset (e.g. use Forgot Login).


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.
The following user(s) said Thank You: nant

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

Moderators: beatnantkrileon
Powered by Kunena Forum