Index: branches/5.1.x/core/units/groups/groups_event_handler.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/groups/groups_event_handler.php (.../groups_event_handler.php) (revision 12127) +++ branches/5.1.x/core/units/groups/groups_event_handler.php (.../groups_event_handler.php) (revision 12657) @@ -1,6 +1,6 @@ Special) { case 'user': $user_id = $this->Application->GetVar('u_id'); + if ($user_id !== false) { // show only groups, that user doesn't belong to $table_name = $this->Application->GetTempName(TABLE_PREFIX.'UserGroup', 'prefix:u'); + $sql = 'SELECT GroupId - FROM '.$table_name.' - WHERE PortalUserId = '.$user_id; + FROM ' . $table_name . ' + WHERE PortalUserId = ' . (int)$user_id; $group_ids = $this->Conn->GetCol($sql); array_push($group_ids, 14, 15); // Guest & Everyone groups are set dynamically @@ -41,6 +45,4 @@ break; } } - } - -?> \ No newline at end of file + } \ No newline at end of file