Hey man,
i have progressed in the developpement of the component and i made it possible to make user plugins for Add user frontend.
I have made the first plugin which maybe can help you with your question.
This plugin makes add user frontend work together with K2. When you add a user in add user frontend this plugin will add the user to the K2 userlist and assign it to the user group of your choice.
Attention: You cant choose which user group you want to add the user to in the add user form. You can only configure it in the plugin parameters backend! So on the frontend you will be limited to one user group.
If you want to have a dropdown in the add user form to choose the usergroup you should edit the component. You can make the selectbox in the form yourself and then pass the data on to the plugin with the "onAfterStoreUserAuftoK2" event which looks like this:
// Fire the onAfterStoreUser trigger for K2 synchronization
$dispatcher->trigger('onAfterStoreUserAuftoK2', array($userdataexport, true, true, $this->getError()));
the array: $userdataexport contains the data, so you need to ad your data in it first like for example:
// Get userdata for export
$userdataexport = array (
"username" => "$username",
"email" => "$email",
"name" => "$name",
"password" => "$password",
"id" => "$user_id",
"k2groupid" => "$user_id", <----- adding your data from the form to the array
);
After that you can continue editing the plugin
But this is not an exact tuturial. It can only help you if you have enough knowledge about forms, php, etc..
Why dont i write the code myself?
I will but not in the way i suggested to you. Because i dont want to alter the code of the component. I want it to work from the plugin only. But thats more complicated. So i still need some time for that
The plugins only works with Add userfrontend v1.2.5 and above.
You can download the component here:
http://www.ghanja.be/en/downloads/components/add-user-frontend/details.html
And the plugin here:
http://www.ghanja.be/en/downloads/k2-user-sync-for-add-user-frontend/details.html
Grtz Kim
