Index: branches/5.2.x/core/units/users/users_item.php =================================================================== diff -u -N -r14432 -r14437 --- branches/5.2.x/core/units/users/users_item.php (.../users_item.php) (revision 14432) +++ branches/5.2.x/core/units/users/users_item.php (.../users_item.php) (revision 14437) @@ -1,6 +1,6 @@ GetID() . ') AND ( (MembershipExpires IS NULL) OR ( MembershipExpires >= UNIX_TIMESTAMP() ) ) - ORDER BY PrimaryGroup DESC'; + ORDER BY IF(GroupId = ' . $this->GetDBField('PrimaryGroupId') . ', 1, 0) DESC'; return $this->Conn->GetCol($sql); } @@ -69,15 +69,14 @@ } } + /** + * Checks that user is subscriber only + * + * @return bool + */ function isSubscriberOnly() { - $subscribers_group_id = $this->Application->ConfigValue('User_SubscriberGroup'); - $sql = 'SELECT PortalUserId - FROM '.TABLE_PREFIX.'UserGroup - WHERE GroupId = '.$subscribers_group_id.' AND - PortalUserId = '.$this->GetDBField('PortalUserId').' AND - PrimaryGroup = 1'; - return $this->Conn->GetOne($sql) == $this->GetDBField('PortalUserId'); + return $this->GetDBField('PrimaryGroupId') == $this->Application->ConfigValue('User_SubscriberGroup'); } function Create($force_id=false, $system_create=false)