546 Commits

Author SHA1 Message Date
martinlanghoff
355bd271ac MDL-9399 auth/ldap: NTLM SSO - use sesskey and other tidyups
Several tidyups:

- use moodle_strtolower() for utf-8 correctness

 - use sesskey as the key instead of IP addr to support
   proxied users

 - clean the sesskey after success!

 - pull timeout out to a constant: AUTH_NTLMTIMEOUT
2007-11-14 22:11:35 +00:00
martinlanghoff
f8bf0f4afc 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.
2007-11-14 22:09:59 +00:00
martinlanghoff
ddf3de6720 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.
2007-11-14 22:09:45 +00:00
martinlanghoff
0a1c2f4a43 MDL-9399 auth/ldap: NTLM redirect only on initial GET
We only want to redirect when users are being shown the login page (on
GET) but not when users are POSTing to it, actually trying to login.
2007-11-14 22:09:29 +00:00
martinlanghoff
02c7f3d98a MDL-9399 auth/ldap: NTLM SSO - lots of fixes from Iñaki
Lots of typos and minor errors fixed by Iñaki. Thanks!
2007-11-14 22:09:15 +00:00
martinlanghoff
3357a506bd MDL-9399 auth/ldap: NTLM SSO - Resolve Moodle cookies issue, tighten config.php require()s
Use $nomoodlecookie global to avoid session troubles. Also

 * Ensure we load the appropriate config.php, even if we are executing
   under a strange environment (ie: with a user's credentials!)

 * Test we have a spacer gif to open before we open it
2007-11-14 22:08:55 +00:00
martinlanghoff
977f5b56e1 MDL-9399 auth/ldap: Add NTLM SSO pages
These pages control the process of attempting an NTLM SSO login
safely. This is very draft and needs real-world testing and polish.

And string localisation too ;-)

  * If NTLM SSO is enabled, and the user's IP addr is in the right
    subnet, the loginpage_hook() of auth/ldap redirects to
    ntlmsso_attempt.php

  * ntlmsso_attempt.php will display a "redirect" msg with an img tag
    pointing to ntlmsso_magic.php, a 3s wait, and a redirect to
    ntlmsso_finish.php

  * ntlmsso_magic.php should be configured to have "Integrated
    Windows Authentication". If it does, it will serve a spacer gif
    and call ntlmsso_magic()

  * ntlmsso_finish.php calls ntlmsso_finish() to complete the SSO
    and handles failures.
2007-11-14 22:08:38 +00:00
martinlanghoff
decd80163d 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.
2007-11-14 22:08:11 +00:00
martinlanghoff
1e8713ea64 MDL-9399 auth/ldap: Introducing loginpage_hook(), ntlmsso_attempt(), ntlmsso_finish()
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.

Does NTLM auth thingy support proxies?
2007-11-14 22:07:53 +00:00
martinlanghoff
b95b46a897 MDL-9399 auth/ldap: Manage 2 new config settings for NTLM SSO
Changes in the forms and forms handling to set and edit NTLM SSO
related config options.
2007-11-14 22:07:16 +00:00
martinlanghoff
cfab8f3946 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...
2007-11-14 22:06:17 +00:00
martinlanghoff
be41678c5e auth/mnet: when landing, user complete_user_login()
By using complete_user_login() we ensure that the session is fully
setup, and that enrolment plugins are called correctly.
2007-11-14 22:04:23 +00:00
toyomoyo
3ddcc29e62 MDL-10509, LDAP username to be always in lowercase 2007-11-06 01:01:09 +00:00
donal72
32d651c853 Test for empty dataset to suppress a warning 2007-11-01 06:11:08 +00:00
donal72
b263e3b721 MDL-11040: get_complete_user_data doesn't get the complete user data. Replace with get_record to bring over the user's description. 2007-10-16 08:51:57 +00:00
nicolasconnault
56a1a88228 MDL-8605 New user directories implemented 2007-10-11 09:01:29 +00:00
skodak
03cedd6283 MDL-11432 eliminated majority of RecordCount uses, added several missing rs_close() - this should help improve perf on some platforms - Eloy says ;-) 2007-10-10 12:19:27 +00:00
iarenaza
0baafc173a Fix MDL-11632: Multiple files with emtpy lines outside PHP open/close tags
There are multiple issues with Moodle files containing empty or blank lines
(lines consisting of white spaces or tabs only) and/or white space before or
after the PHP open and close tags, notably with config.php and theme files.
2007-10-09 21:43:28 +00:00
skodak
e5245c73a5 MDL-11448 FirstClass Authentication does not hold settings and has cosmetic and info leakage issues, patch by Dan Trockman 2007-10-07 14:08:37 +00:00
exe-cutor
1432ac143d Adapted README due to attribute requirement change 2007-10-03 12:36:48 +00:00
iarenaza
bb4e530b93 MDL-11299 - Make objectClass string comparison case insensitive.
LDAP serves accept attribute names in a case insensitive way, so don't
force the users to use any particular spelling.
2007-09-17 21:30:20 +00:00
jgutierr25
c39e721374 Pb with autologinguest 2007-09-11 07:54:55 +00:00
jgutierr25
5128f0b3fa problem with autologinguest 2007-08-31 09:49:15 +00:00
skodak
f6c80923bf MDL-10921 LDAP Auth to Active Directory requires LDAP_OPT_REFERRALS option set 2007-08-29 20:42:41 +00:00
skodak
90afcf3280 MDL-10260 added new user_delete() hook into auth plugins; refactored user delete code = new function delete_user() in moodlelib.php + improved cleanup in core tables when deleting user 2007-08-21 20:52:36 +00:00
ikawhero
831d450e3f Adding custom profile fields to the signup page.
The only two authentication plugins this affects are email and ldap.
2007-08-20 08:30:34 +00:00
nicolasconnault
e295df447f MDL-10870 All files updated to new build_navigation() method. 2007-08-17 11:18:58 +00:00
moodler
0c5e6027d2 I merged all changes over from 1.8 to HEAD.
None of it looked too serious but I'VE NOT TESTED THIS AT ALL.

MDL-10366
2007-08-11 12:58:08 +00:00
stronk7
6817efbc2f Added Id tag 2007-08-06 22:16:36 +00:00
donal72
2f33c23492 MDL-9288 : An additional addslashes() that was in Petr's patch but didn't get committed. Tested and required. 2007-08-03 11:16:22 +00:00
poltawski
c31f631baa MDL-9742 - converting tabs to spaces 2007-07-23 15:38:31 +00:00
jgutierr25
6dfddff7ce *** empty log message *** 2007-07-23 11:37:21 +00:00
poltawski
63b1cf1fe2 MDL-10343 - abort early when can't create temporary tables when syning users
from LDAP
2007-07-22 21:33:31 +00:00
jgutierr25
df5b8b8895 test if auth cas activated and no parameters 2007-07-17 12:08:26 +00:00
jgutierr25
017f1a617d *** empty log message *** 2007-07-17 11:46:19 +00:00
mjollnir_
2520258128 Merged Donal's changes to MNET to allow moodle to also network with mahara.
changelog follows

    [MNET-manual] added version.php, install.xml and upgrade.php patches
    Route remote users back to their home server without going through jump.php and land.php
    Display app-specific strings in the user view
    Display the application icon in the Remote Host block
    Hide the 'logs' tab if the application under review is not Moodle
    Hide the 'logs' tab if the application under review is not Moodle
    Update user record to note that picture == 1 once a picture has been
    transferred.
    Change 2 to uri - is this fluid?
    Add application paramter to bootstrap function
    Find the application
    Workaround for PHP5.2.2 bug: http://bugs.php.net/bug.php?id=41293
    $HTTP_RAW_POST_DATA was not being populated
    Ensure we get an application for our Peer
    Update the URI to use for MNET
    The default 'wantsurl' should be empty
    Use the appropriate 'land' url for the remote application
    Add hidden form elements for 'application'
    Add awareness of new Application concept
    Add awareness of new Application concept
    Add awareness of new Application concept
    Add awareness of new Application concept
    Add awareness of new Application concept
    Add awareness of new Application concept
    Add awareness of new Application concept
2007-07-14 03:00:12 +00:00
exe-cutor
73f1e3b28b Merged changes from stable 2007-07-11 08:30:01 +00:00
exe-cutor
f309632a05 Merged changes from stable version 2007-07-11 08:04:12 +00:00
jgutierr25
f535ea21fd *** empty log message *** 2007-07-09 08:49:47 +00:00
Martin Langhoff
a9b24e489b cvsimport fixups - new files 2007-07-07 14:30:55 +12:00
Martin Langhoff
08103c9364 cvsimport fixups 2007-07-07 14:18:30 +12:00
skodak
e5d31b2f1b MDL-10355 fixed typo 2007-07-05 20:39:41 +00:00
skodak
9347082d10 MDL-10309 Broken password expiration support for LDAP user types rfc2307 and rfc2307bis, patch by Iñaki Arenaza; merged from MOODLE_18_STABLE 2007-07-01 15:42:36 +00:00
jgutierr25
74c9f514ab pb case sensitive when get ldap attribute 2007-06-28 09:35:32 +00:00
skodak
4225d4ba3a MDL-10068 "Lost Password" button does not work for ldap auth 2007-06-10 19:26:12 +00:00
skodak
7a4025d0b6 MDL-10061 LDAP user creation broken for Novell eDirectory since 1.8; patch by Iñaki Arenaza 2007-06-09 15:33:22 +00:00
jgutierr25
209596cb6a automatic authentication when direct access from another CAS application and multiauth 2007-06-05 08:35:57 +00:00
skodak
bffe39c6d5 MDL-4687 Password expiration support for AD (with patch) - patch by Iñaki Arenaza, thanks! 2007-05-30 08:54:52 +00:00
skodak
66fc70dd2e MDL-9954 LDAP auth settings form problem with 'Member Attribute' and 'Member Attribute uses dn'; patch by Iñaki Arenaza - thanks! 2007-05-30 08:49:19 +00:00
skodak
81fb221d31 MDL-9626 Enable user signup with Active Directory (via LDAP); patch by Iñaki Arenaza - thanks! 2007-05-30 08:47:00 +00:00