393 Commits

Author SHA1 Message Date
fmarier
6508931bc3 Fix typo 2009-05-15 03:37:07 +00:00
tjhunt
93d4a373f9 blocklib: MDL-19010 always include blocklib in setup.php, stip includes elsewhere 2009-05-06 09:13:16 +00:00
dongsheng
b8aa76c1a4 "MDL-19037, use getremoteaddr to get remote ip address" 2009-05-01 03:04:10 +00:00
stronk7
2a88f626f7 MDL-18577 drop enums support - step2: enums out from editor, dbmanager and all upgrade scripts. 2009-05-01 01:19:16 +00:00
iarenaza
eee34307b9 Cache LDAP connections: MDL-18130 Properly handle open LDAP connections.
Both CAS and LDAP auth plugins open new connections to the LDAP server
to get the user account details. While this is the desired behaviour
for regular logins (we probably don't have an already open connection
to the LDAP server), this is a ressource hog when we are doing user
synchronization, as the closed connections remain in the TCP_WAIT
state for a while before the server can reuse them. If we are syncing
a lot of users, we can make the server run out of available TCP
ressources.

So we cache the connection the first time we establish it and return
the same connection handle everytime, unless we've closed all the
'open' connections, or the auth object is destroyed.

In addition to that, there were a few missing calls to ldap_close().
2009-02-15 15:03:33 +00:00
iarenaza
16ceeb6436 NTLM SSO: MDL-13760 Speed up ntlm sign on with conditional redirect for msie
Provides an option, configurable by admin, to make the ntlm test happen
only if MSIE is not used. This speeds things up for IE.
2009-02-14 16:21:58 +00:00
iarenaza
4194d32185 NTLM SSO: MDL-14584 Fix for several outstanding NTLM SSO issues.
These include:

MDL-14078: redirect() doubles the specified timeout when we haven't printed
           the page header and uses javascript to execute the redirect. This
           is interacting badly with some versions of IE and FF (at least
           3.0.x Windows version) that fireup javascript timers even if
           we already left the page where we set those up. Just print
           the page header (we are printing other content anyway) to
           make redirect respect our timeouts.

MDL-14071: All the relevant details are in the description of the bug :)

MDL-14297: This is probably the same as MDL-14078
2009-02-14 16:21:14 +00:00
skodak
b7b64ff2e0 MDL-17754 next round of session related refactoring 2009-01-02 20:32:05 +00:00
iarenaza
997bcd9e26 auth/ldap: MDL-9405 sync_users() can create duplicated users
Merged from MOODLE_18_STABLE

If we are using auth_ldap_sync_users.php to synchronize our users, and we
have a database which is case-sensitive when doing comparisons (Postgres and
Oracle at least), and any of our users has the vale of the username attribute
in mixed-case (like 'John Smith'), we get duplicated users.

This is because we don't make sure the username attribute value is 'lowercased'
after we retrive it from the LDAP server and before we insert it into the
database.
2008-12-26 16:01:30 +00:00
dongsheng
771dc7b298 "MDL-14129, fix error() in moodle2" 2008-12-12 05:45:43 +00:00
stronk7
f679d73093 Found another get_record() call when looking to MDL-16245. Fixed. 2008-08-28 23:00:43 +00:00
iarenaza
5261baf11e MDL-16061 Revert incorrect fix for "Remove 'username' from the $moodleattributes array"
Merged from MOODLE_18_STABLE.

The fix is wrong, as it breaks auth_db_sync_users.php and
auth_ldap_sync_users.php at least. No new users are added to Moodle, as the
username is missing from the new user info record.

The fix needs to go into update_user_record() in lib/moodlelib.php to make it
skip the 'username' key, as we really need get_userinfo() to return the
username as part of the user info array.
2008-08-25 22:44:45 +00:00
iarenaza
cfcb7a17cb MDL-15799 LDAP - user data mapping doesn't work. Merged from MOODLE_18_STABLE
The Right Way(tm) to write a LDAP filter is enclosing it in parentheses (see
RFC 4515/2254).
2008-08-24 20:46:49 +00:00
iarenaza
19ac43c7a6 MDL-16061 Remove 'username' from the $moodleattributes array.
It doesn't make sense at all (username is not part of the externally mapped
fields) and produces a notice that breaks HTTP headers with debugging enabled.
2008-08-15 11:22:57 +00:00
stronk7
8dd009f379 Fixed copy&paste error. Credit goes to Sergio Rabellino.
http://moodle.org/mod/forum/discuss.php?d=102933 ; merged from HEAD
2008-08-07 17:10:28 +00:00
skodak
2942a5cd34 MDL-9983, MDL-13998 core events related cleanup; merged from MOODLE_19_STABLE 2008-07-06 17:57:06 +00:00
Francois Marier
6800d78e06 Drift between CVS and git
- large deletions
- lucene updates
- error() => print_error()
- NO_MOODLE_COOKIES define
- various other things
2008-06-25 17:31:23 +00:00
skodak
31693d6fe7 MDL-15398 reverting previous incorrect patch 2008-06-24 22:10:30 +00:00
fmarier
874487c0d8 auth/ldap: fix PHP warnings and remove bad "Choose one" id
Merged from MOODLE_19_STABLE
2008-06-19 02:30:37 +00:00
skodak
df884cd852 MDL-15098 dml auth conversion 2008-06-07 15:41:25 +00:00
iarenaza
15f80fd887 MDL-4248 Fix error when updating user profiles and any of these fields is empty
According to http://es2.php.net/manual/en/function.ldap-modify.php#43216 we
need to specify an array() value to delete an attribute's value, instead of an
empty string.

Merged from MOODLE_18_STABLE
2008-05-31 15:00:42 +00:00
skodak
185721a498 MDL-14679 towards /admin/auth conversion 2008-05-31 13:57:49 +00:00
skodak
b9a6636029 MDL-14679 towards /admin conversion 2008-05-31 10:43:51 +00:00
skodak
5d910388bb MDL-14679 towards /user conversion 2008-05-30 22:11:31 +00:00
skodak
be544ec380 MDL-14679 towards authlib conversion 2008-05-30 20:54:19 +00:00
skodak
576c063b31 MDL-14679 towards authlib conversion 2008-05-30 20:54:19 +00:00
skodak
ae040d4bcc MDL-14679 finished moodlelib conversion 2008-05-30 19:59:50 +00:00
iarenaza
f0a729bf9b MDL-14987 Default attribute for Active Directory password expiry is missing
Merged from MOODLE_18_STABLE
2008-05-25 21:53:23 +00:00
skodak
f33e1ed4ae MDL-14679 ok, here is the big patch with new dmllib and ddlib API, some code is already converted, XML db editor works; see tracker for details of regressions and TODOs 2008-05-15 21:40:00 +00:00
dongsheng
3db241b342 "MDL-14129, fix print_error" 2008-05-08 06:27:28 +00:00
skodak
59669b63f0 MDL-14543 fixed broken deleting from auth sync - credit goes to Juris Treibahs ; merged from MOODLE_19_STABLE 2008-04-25 13:22:02 +00:00
skodak
1569ebe603 MDL-14301 wrong label - credit goes to Daniele Cordella; merged from MOODLE_19_STABLE 2008-04-10 09:08:25 +00:00
skodak
6b87f63845 MDL-14300 unclosed input - credit goes to Daniele Cordella; merged from MOODLE_19_STABLE 2008-04-10 09:05:33 +00:00
dongsheng
4105cafff9 MDL-12531, make the new member value available to all the affected plugins, thanks, Robert 2008-04-08 05:53:12 +00:00
dongsheng
5a2a53316f MDL-14129, remove all the other error() call 2008-04-04 02:54:20 +00:00
dongsheng
6f87ef52b9 MDL-14055, change to human-readable strings from hard-coded integer, thanks for Matt's patch. 2008-03-26 01:35:04 +00:00
iarenaza
066de339a5 MDL-12858 fix print_error() usage.
print_error()'s third parameter is the URL we jump to (defaults to
$CFG->wwwroot if not set) when we click the 'Continue' button, not the message
string parameter object.

Forward ported from MOODLE_18_STABLE
2008-01-08 00:13:49 +00:00
iarenaza
1e3eee5fe8 MDL-12323 MDL-4061 Don't connect to the LDAP server if update external is not set for any field.
Forward ported from MOODLE_18_STABLE.
2007-12-28 12:06:22 +00:00
martinlanghoff
0cbcc8efc1 user_login() was not converted to using get_cache_flags().
It was still using the 'old' get_config() interface, so the 'cookie'
set by ntlmsso_finish() wasn't retrieved at all, and the automatic
login always failed.

Signed-off-by: Iñaki Arenaza <iarenuno@eteo.mondragon.edu>


Author: Iñaki Arenaza <iarenuno@eteo.mondragon.edu>
Committer: Martin Langhoff <martin@catalyst.net.nz>
2007-11-19 02:43:48 +00:00
martinlanghoff
58eada356d If the cache flag is not set, it doesn't make sense trying to test its value
Signed-off-by: Iñaki Arenaza <iarenuno@eteo.mondragon.edu>


Author: Iñaki Arenaza <iarenuno@eteo.mondragon.edu>
Committer: Martin Langhoff <martin@catalyst.net.nz>
2007-11-19 02:43:34 +00:00
martinlanghoff
a44240fa89 Fix typo in ntlmsso_finish()
Signed-off-by: Iñaki Arenaza <iarenuno@eteo.mondragon.edu>


Author: Iñaki Arenaza <iarenuno@eteo.mondragon.edu>
Committer: Martin Langhoff <martin@catalyst.net.nz>
2007-11-19 02:43:16 +00:00
martinlanghoff
6626b9ab48 MDL-12178 auth/ldap: "creators" role assignment now also supports contexts
Now the DNs that indicate a course-creator role can also be contexts.
This way we support one more widely used practice in the weird and
wonderful LDAP world...
2007-11-14 22:23:45 +00:00
martinlanghoff
4025cf8031 MDL-9399 - auth/ldap NTLM SSO - fix missing global 2007-11-14 22:17:58 +00:00
martinlanghoff
065e2cc094 MDL-9399 auth/ldap: NTLM temp sessions now use cache_flags
cache_flags is now the apropriate way to manage this kind of temp
data. It gives us time expiry and GC for free, so it's a perfect fit
for the job, as it simplifies the code a bit.
2007-11-14 22:12:57 +00:00
martinlanghoff
19987407ab MDL-9399 auth/ldap: NTLM SSO - fix hardcoded strings
From Iñaki Arenaza
And here is a little patch with the last remaining non-traslated
strings (unless I missed something).
2007-11-14 22:12:25 +00:00
martinlanghoff
6221a32121 MDL-9399 auth/ldap: NTLM SSO - move textlib conversion earlier
From Iñaki Arenaza - fix for

... I forgot to put the textlib conversion
call before the block of code that uses $extusername, so it
completely breaks the user validation process.
2007-11-14 22:12:07 +00:00
martinlanghoff
83cd2dce5a MDL-9399 auth/ldap: NTLM SSO - cleanup of sesskey handling
Fix a bug in ntlmsso_finish(), and tighten up user_login() to avoid a
pointless DB lookup if the password doesn't match the sesskey.

Hopefully this makes things work again...
(thanks I~naki for the testing!)
2007-11-14 22:11:48 +00:00
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