We need to specify a valid user id in the call to role_assign(). And we only
have to make the call if the user has been added successfully, not
otherwise.
Also make sure we lowercase the memberuser and group distinguished names
before comparing them. Depending on the LDAP server we can get mixed case
values for the DNs, and the user may have specified the creators group/ou
name in a different case.
By the way, this has been broken for ages (since the auth cleanup in 1.8, in
2007!). It's a bit strange nobody noticed before :-O
Credit goes to Joe Chryst.
Upgraded phpCAS to 1.1.2 and fixed https://issues.jasig.org/browse/PHPCAS-73 ,
as reported by Fred Woolard in MDL-23126 (the fix will be in upstream in the
next release)
Credit goes to Johan Reinalda.
Grrr! just spent ages debugging a really subtle bugs because moodle_urls can
change, and override_active_url was keeping a reference to the caller's URL
rathern than taking a private copy.
Suppose a quiz has a 60 min time limit, and an enforced delay of 60 mins between attempts.
Suppose a sudent starts an attempt, and then closes their browser, and then comes back 2 hours later. When they try to restart the quiz, it is submitted immediately by the timer.
Now they are blocked out for the next hour.
After this change, they would no longer be blocked, becuse if their attemtp had been submitted at the end of the first hour, then they would already have waited an hour.
That is, we compare the current time with both $lastattempt->timefinish + $delay and $lastattempt->timestart + $timelimit + $delay.
Suppose you have two load-balanced servers with badly-synchronised clocks, and
a student does a really quick quiz attempt.
Then it is possible that quiz_attemtp.timestart is greater than quiz_attemtp.timefinish.
And these columns are unsigned (on MySQL) so timefinish - timestart is compulted as
a number close to 2^64, which is about 42 times the age of the universe.
Do the subtraction in PHP instead. (But we still need to compute a duration columnin PHP
because sometimes we sort on it.)