I've just been looking at this now.
I think you should get Petr to have a quick look a the SQL, he has a better eye for the enrolments stuff than me.
I did spot a couple of things however:
- The SQL query is counting ue.id but it's not actually being used anywhere. It looks like it could be removed.
- Lines 412-416... is that meant to be $this->users[$user->id]
>suspendedenrolment = !array_key_exists($user>id, $useractiveenrolments);
- Given you've already got an in_or_equal for the userid in the code above would it be pertinent to use it as part of this query... if its safe to I'm sure itd be better for performance.
- I think the icon should be renamed to something like suspendedenrolment.gif its much more obvious what it is being used for and less likely themer's will replace it with a media player pause button or the like.
Other than that looks good to me.