4 years ago
1
Topic

Hi

In a front end user form we have a BEFORE STORE field that sets the usergroup of the logged user.

but the line

$config['storages']['#__users']['groups'][0]=xx;

has no effect

We also tried to put a conditional state on the user_groups field to set its value according to some other values in the form but there again no change when we submit the form


Is there some required privileges or somethig I forgot to allow the group change please?


thanks


Cyril

Get a VIP membership
4 years ago
0
Level 1

Hi

Since I didn't find the way to do it this way I found another way with an AFTER STORE field:

$db = JFactory::getDBO(); 

$pk=$config["pk"]; 

$myquery="UPDATE #__user_usergroup_map SET group_id=13 WHERE user_id=".$pk; 

$db->setQuery($myquery); 

$db->query(); 

$db->execute();

cyril

Get a VIP membership