martinlanghoff [Wed, 14 Nov 2007 22:09:59 +0000 (22:09 +0000)]
MDL-9399 auth/ldap: Tighten NTLM AD checks to the appropriate OU
From Iñaki Arenaza...
Right now, if someone logs in via NTLM magic, we don't check if that
user is inside the contexts specified in the LDAP settings. I mean,
if I want to restrict my Moodle site to those users inside a given OU
or subtree of my LDAP directory, with the current code any valid user
in my whole AD domain (and if we are using a GC as the LDAP server,
the whole forest) can log in. We should check that the user is inside
one of the configured contexts before allowing his/her to log in.
Something along the lines of the attached patch could do it.
martinlanghoff [Wed, 14 Nov 2007 22:09:45 +0000 (22:09 +0000)]
MDL-9399 auth/ldap: ntlmsso_finish() now completes the user session setup
As Iñaki points out, ntlmsso_finish() needs to do all the setup that
login/index.php would do for a user once auth succeeds. With this
patch, the session setup is complete so the logon is usable.
martinlanghoff [Wed, 14 Nov 2007 22:08:11 +0000 (22:08 +0000)]
MDL-9399 auth/ldap: flesh out ntlmsso_* functions
Flesh out the functions that get the job done. These will be triggered
by PHP files sitting under auth/ldap/ ...
ntlmsso_magic() - here is where the magic happens. Call it serving
something harmless, like a space GIF, from a URL that is blessed with
Integrated Windows Authentication. If the IWA is successful, it will
set a special session cookie in config_plugins table.
It won't complete the job because when we are under IWA magic we
cannot change (even read!) the session data, as the execution happens
under the OS privileges of the actual user acct being logged in (!!!)
ntlmsso_finish() - if it finds the session set by ntlmsso_magic() and
it hasn't expired, it will finish the job of logging in the user, by
calling authenticate_user_login() and exercising the whole auth
machinery.
user_login() - when called by authenticate_user_login() it will check
to see if there's a session setup by ntlmsso_magic() and OK the login
without really asking the AD backend to proof a password we don't have
anyway.
A work in progress -- initial loginpage_hook() and headers for the
remaining functions. One thing to consider here is that this won't
work if there's a proxy in the middle.
martinlanghoff [Wed, 14 Nov 2007 22:06:17 +0000 (22:06 +0000)]
MDL-9399 - auth/shibboleth: ensure we load enrolments
Most of this code should be replaced with complete_user_login() but it
does a few odd things, so we'll play it safe for now, specially since
I don't have a Shib setup to test...
martinlanghoff [Wed, 14 Nov 2007 22:04:05 +0000 (22:04 +0000)]
accesslib: Move check_enrolment_plugins() to complete_user_login()
... where it belongs ;-)
load_all_capabiloties() gets called at several points where we don't
want to be re-querying the enrolment backends. It needs to be called
before load_all_capabilities() and only by callers that are setting up
a logon session.
Those callers need to be calling complete_user_login() anyway, as they
need to set the Moodle cookie, log the logon action, etc. In fact,
those callers duplicate a lot of that code already.
The callers that don't duplicate code for the login are actually the
cases where the backend enrolment plugins should not be queried.
tjhunt [Wed, 14 Nov 2007 17:03:32 +0000 (17:03 +0000)]
MDL-12066 - Links in the HTML block are not recoded on backup and restore.
This is messy because the links are hidden in the configdata column, which is serialized and base64encoded. So we have to untangle that, then ask the block whether there are any bits of $config that need to be fixed, then re-encode it before backup up. And reverse that on restore. It needs to remain base64 encoded in the backup file, so that the file format is backwards compatible.
martinlanghoff [Wed, 14 Nov 2007 01:25:20 +0000 (01:25 +0000)]
htmlarea: fix in FF - MDL-11242
The previous fix for IE left some problems in the FF side of
things because we were trying additions/substractions on
width once its had turned to a string of value + unit.
poltawski [Tue, 13 Nov 2007 20:03:27 +0000 (20:03 +0000)]
Adding a comment pointing to MDL-3964 which explains why we leave the
badword in the filter span title (as I almost 'fixed it' so it couldn't
be hovered over)
nicolasconnault [Tue, 13 Nov 2007 09:08:43 +0000 (09:08 +0000)]
Managed to remove static calls from the core gradebook classes without removing support for such calls in gradebook interface code. I used a singleton pattern for this (get_instance in grade_object).
nicolasconnault [Tue, 13 Nov 2007 07:36:00 +0000 (07:36 +0000)]
Managed to remove static calls from the core gradebook classes without removing support for such calls in gradebook interface code. I used a singleton pattern for this (get_instance in grade_object).
urs_hunkler [Mon, 12 Nov 2007 20:22:04 +0000 (20:22 +0000)]
merged from 1.9 :: The XHTML of the actual tab has been changed. Therefor the actual tab was not shown in front of the line any more. I changed the CSS to correct this introduced bug.
skodak [Mon, 12 Nov 2007 17:12:35 +0000 (17:12 +0000)]
MDL-12130 and MDL-12129 - fixed advanced status of elements when header not closed; disableIf now works inside grouped elements too; code cleanup in focus() and _getElNamesRecursive()
gbateson [Mon, 12 Nov 2007 08:54:35 +0000 (08:54 +0000)]
fix for MDL-9713 : use XMLDB functions to create tables when mod/hotpot/db/mysql.sql is not found. This allows upgrade direct from Moodle 1.5 (or earlier) to Moodle 1.8 (or later)
martinlanghoff [Mon, 12 Nov 2007 04:13:24 +0000 (04:13 +0000)]
htmlarea: Fix fullscreen editor on IE6/7 -- MDL-11242
Only say px if the width is a pure number. Under IE we
get the "100%" for the width of the editor, so blindly
appending "px" results in a JS execution error.
With this patch we only attach px if it's a pure int.
Also tested the sizing of HTMLArea in the messaging
window. So both should be working now.
urs_hunkler [Sun, 11 Nov 2007 15:04:34 +0000 (15:04 +0000)]
merged from 1.9 :: Added the check, if all opend custom_corners are closed. This way it's possible to add the close call in the footer which closes eventually open ccs.
urs_hunkler [Sun, 11 Nov 2007 11:22:54 +0000 (11:22 +0000)]
merged form 1.9 and corrected a CSS bug :: MDL-12045 :: the extra "clearer" div broke the custom_corners theme on IE7. I removed the "clearer" div and added the class "clerafix" to the surrounding coursebox.
In FF and Safari floating is a mess now. I removed float:left for "coursebox" to get the page working in all browsers. It is a single element and should not need floating.
nicolasconnault [Wed, 7 Nov 2007 17:59:33 +0000 (17:59 +0000)]
Unit test refactoring using mock objects. NOT FINISHED: testgradecategory and testgradeitem are incomplete. The other tests work great however, and no longer a need for DB data