Hi,
I'm Alessandro, an Italian user. I have one important question.
I have create a form for registering new joomla user. It work correctly but it isn't complete because I can't associate the new user to a specific group.
How can I make it? Wich strument, on the events panel, I should use for do it?
Thanks for your future answer,
Alessandro
I'm Alessandro, an Italian user. I have one important question.
I have create a form for registering new joomla user. It work correctly but it isn't complete because I can't associate the new user to a specific group.
How can I make it? Wich strument, on the events panel, I should use for do it?
Thanks for your future answer,
Alessandro
Many idea?
Hi,
thank for the answer. I've use your code but don't work. If I change $form with $Registrazione (Registrazione is the name of my form) nothing happen. Why? This is my code:
azienda is the factory, is the field name of the multychoose box of my form. GU, LU, MA, ME are the name of the groups, the same in the form. 9, 10, 11, 12 are the ID of the corresponding group.
Thank for answer.
thank for the answer. I've use your code but don't work. If I change $form with $Registrazione (Registrazione is the name of my form) nothing happen. Why? This is my code:
<?php
if ( !isset($Registrazione->data['azienda']) || !$Registrazione->data['azienda'] ) {
// Non ci sono gruppi selezionati
return false;
}
$group_array = array (
'GU' => '9', // GU
'LU' => '10', // LU
'MA' => '11', // MA
'ME' => '12', // ME
);
$group_id = $group_array[$Registrazione->data['azienda']];
$user_id = $Registrazione->data['_PLUGINS_']['joomla_registration']['id'];
jimport('joomla.user.helper');
JUserHelper::addUserToGroup($user_id, $group_id);
?> azienda is the factory, is the field name of the multychoose box of my form. GU, LU, MA, ME are the name of the groups, the same in the form. 9, 10, 11, 12 are the ID of the corresponding group.
Thank for answer.
Hi Allessandro,
Please see this FAQ which I have just written.
Bob
Hi,
thank for the answer. I've use your code but don't work. If I change $form with $Registrazione (Registrazione is the name of my form) nothing happen. Why? This is my code:
<?php
if ( !isset($Registrazione->data['azienda']) || !$Registrazione->data['azienda'] ) {
// Non ci sono gruppi selezionati
return false;
}
$group_array = array (
'GU' => '9', // GU
'LU' => '10', // LU
'MA' => '11', // MA
'ME' => '12', // ME
);
$group_id = $group_array[$Registrazione->data['azienda']];
$user_id = $Registrazione->data['_PLUGINS_']['joomla_registration']['id'];
jimport('joomla.user.helper');
JUserHelper::addUserToGroup($user_id, $group_id);
?> azienda is the factory, is the field name of the multychoose box of my form. GU, LU, MA, ME are the name of the groups, the same in the form. 9, 10, 11, 12 are the ID of the corresponding group.
Thank for answer.
Hi Allessandro,
There is nothing in the FAQ that says "change $form with $Registrazione" :-(
Please put it back.
Bob
There is nothing in the FAQ that says "change $form with $Registrazione" :-(
Please put it back.
Bob
Hi Allessandro,
There is nothing in the FAQ that says "change $form with $Registrazione" :-(
Please put it back.
Bob
Ahaha:) It's true. I change the $form with $Registrazione because with $form don't work too.
Alessandro
Sorry for my error...work very well! I've find one my error...when I worked with $form I missed " ' " on ['id]...now it work with $form!
Thanks a lot!
Alessandro
Thanks a lot!
Alessandro
This topic is locked and no more replies can be posted.
