Skip to content

Bug in JUserHelper class, setUserGroups method #114

@jamesmoey

Description

@jamesmoey

Affected Version:

  • 1.7.2 or greater
  • 2.5

In method setUserGroups, inside file libraries\joomla\user\helper.php

// Set the titles for the user groups.
for ($i = 0, $n = count($results); $i < $n; $i++) {
$user->groups[$results[$i]->id] = $results[$i]->title;
}

This code will overwrite the index of the groups parameter pass into the function. Also in the method addUserToGroup in this class, the group information is store as

// Add the group data to the user object.
$user->groups[$title] = $groupId;

not the otherway around.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions