I am using JM3.4. I added some customized user groups. And I added a field let user select user group when registration. I am going to hack following code:
// Get the default new user group, Registered if not specified.
$system = $params->get('new_usertype', 2);
$this->data->groups[] = $system;
I am going to check what user selected and override the system configured group. So I added following code between previous two lines of code:
if (!strcmp($this->data->role, "group0"))
{
$system = 10;
}
elseif (!strcmp($this->data->role, "group1"))
{
$system = 11;
}
My question is how can I not hardcoding group id here, instead of 10,11, it should be something like: getGroupID('group0')
, getGroupID('group1')