I am about to use the Change User Action to automatically change the user group of a given user if he clicks a button (in a mini form). I looked at the action properties, and on tab1 I see the username, pw, email, etc. And on tab2 I see the user group and a selection to "update self" and to "enable old password".
Before I go on a lengthy trial and error trip, can you tell me whether I can just leave tab1 fields empty, select a new user group on tab2 and set "update self" and "enable old password"? Or will I have to read the current user and pull all values into all fields? And if the latter, how do I do it?
;-)
Thanks much for your help.
Hi iko,
I've never used the Joomla! User Create/Update action so probably don't know much more than you do. Looking at the Help tab and the code I think that: (a) you can ignore all the fields that you don't need updated; (b) It will get the User Object for the current User so you don't need to pre-load that data; and (c) the 'Enable Old Password' option is a security check that requires the user to enter their password before their details can be updated.
Hope that helps
Bob
Thanks Bob, I will give it a go and report back.
Unfortunately, no luck.
I tried changing the user group by setting a new one in SETTINGS, and I selected Update SELF. I tried both Enable Old Password YES and NO. I left all other fields and options empty. The action fails.
Can we get MAX to explain the usage in a little more detail?
Me stuck.
;-)
So I ended up changing the code and it works nicely, however it would be better to put my stuff into another action. Any guidance on how to write new actions and make them available in the admin backend?
Hi Iko,
I'm still learning about actions so hard to write a full manual (even if I had the time). I usually pick one similar (or very simple) action and modify it to do what I want - easy to say and harder to do.
The most important thing to do is to change **every** instance of the action name to be consistent with your new action name - and some of these are tucked away.
If you look at one of my more recent ones (the Mollie action is the latest but isn't free) you'll see that I have modified the underlying code to make some of the updating simpler - for example defining the action name in a variable. The Mollie action is also multi-language enabled and uses included files quite a lot.
The action_name.ctf file defines the admin display
The action_name.php file defines the action functionality
The cfaction_action_name.php file - I think this optional file defines the action functionality when the Show HTML action runs (but I'm still not certain).
The cfaction_action_name.ctp file - is a helper file needed if you have a cfaction_action_name.php file in the action.
Bob
Thanks for putting this together for me. That's a good starting point ...
Hi guys,
it seems that it requires name, email, username no matter whether you want to update self or not
Yes, just like the "update details" page in Joomla, you have all the fields so you can update all your details, is this wrong ? 🙂
Please remember that you can override the fields values after the form is submitted using a custom code action:
<?php
$form->data['field_name'] = 'any value here';
?>
Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?