Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 php 为活动用户分配不同的用户组?
我相信我可以通过使用以下代码获得活跃用户:
$user =& JFactory::getUser(); $user_id = $user->get('id');
但是如何更改用户组?
谢谢!
您通过以下编码更改用户组
$user = JFactory::getUser(); $group_id = '6'; //Group ID $user->set('gid', $group_id);