because unenrol.php was doing wrong capability check when $userid set.o
Also improves the lanaguage used when unenrolling self.
merged from MOODLE_18_STABLE
* improved handling of dirty contexts in general - caching, switching in cron, marking, loading, etc.
* role_assing() and role_unassign() now marks dirty contexts because we use has_capability() in this function - we can not do it later outside to speedup bulk operations
* fixed some inline docs
* fixed notice from rs closing
* removed cached $CONTEXT from has_capability() - $context is now required parameter; this was hiding serious bugs when context did not exist or ppl passed false as parameter
* removed some ===, we can not use these on function parameters - we must support ints, strings, '', nulls, etc. - this could be a source of really dangerous bugs in future
* some other improvements and fixes - documented inline
Manually enrolling and unenrolling self, and other users should
transparently set the context dirty. So walk all callers to
role_assign() and role_unassign() and mark the context dirty
where appropriate.
OTOH, most automated-backend enrol/unenrol mechanisms should not.
The backend lookups that happen when you login are well covered
by the login/enrolment process, and don't need to be marked dirty.
OK, some big changes here to the front end, particularly in
course categories and course display.
Course categories can now be nested (to any level).
Courses and course categories can now be manually sorted
any way required.
There is a groovy front end for managing these, and a better
range of options for formatting the front page.
It all still needs some polishing, which I'll be doing over
the next couple of days, including better auto-sorting.
I would not use this on production systems just yet.
confirmation on deletions, removing deleted user from all student lists,
teacher lists and subscription lists and freeing up their username and
email to be used again.
servers that have register_globals turned off (this is the
default setting on newer version of PHP).
In fact it's partly a hack that globalises all GET, POST, FILES
AND COOKIE variables. Unfortunately though the SESSION and
USER global session variables are only available as $_SESSION["USER"]
and $_SESSION["SESSION"], which is cumbersome to use.
So, for every request I now make a copy of these two session variables
into $USER and $SESSION. Whenever I update them thoughout Moodle I
now have to call save_session("USER") which copies them back to the
session variable. This seems to be working well now.
Because I'm using $_SESSION etc now this will raise
the required minimum version of PHP to 4.1.0