try following code :
$user = JFactory::getUser();
var_dump($user->group);
var_dump(JUserHelper::getUserGroups($user->id));
both should produce same results.
null
and
array (size=1)
2 => string '2' (length=1)
Database Version : 5.5.38-0ubuntu0.14.04.1
PHP Version : 5.5.9-1ubuntu4.4
Web Server : Apache/2.4.7 (Ubuntu)
WebServer to PHP Interface : apache2handler
Joomla Version : Joomla! 3.3
Joomla Platform Version : Joomla Platform 13.1.0 Stable
Set to "closed" on behalf of @vdespa by The JTracker Application at issues.joomla.org
Status | New | ⇒ | Expected Behaviour |
Status | Expected Behaviour | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-09-18 23:06:25 |
What about $user->groups (note plural) - should that be null also? Many 3rd party extensions reference it.
Labels |
Added:
?
|
$user->group is actually null, as it is not defined in the API.
This comment was created with the J!Tracker Application at http://issues.joomla.org/.