Commit Graph

989 Commits

Author SHA1 Message Date
poltawski fc4b2decc0 MDL-13179 - avoid calling get_admin() when unecessary.
It uses a relatively complex query and its not needed except
for a minority of users so we may as well avoid it..
merged from MOODLE_19_STABLE
2008-01-26 17:00:03 +00:00
poltawski efae27bb45 MDL-13068 - fix typo causing course delete to fail
merged from MOODLE_19_STABLE
2008-01-25 21:09:36 +00:00
nicolasconnault 1bf7621ca4 MDL-13103 merging from 1.9 2008-01-25 13:00:45 +00:00
skodak fd6fefb790 MDL-13084 SORT_LOCALE_STRING not defined < PHP 4.4.0; merged from MOODLE_19_STABLE 2008-01-21 18:18:07 +00:00
skodak ff396fd597 MDL-13063 fixed comments and changeme password reset; merged from MOODLE_19_STABLE 2008-01-19 20:05:21 +00:00
mjollnir_ 6a91692518 Merged from MOODLE_19_STABLE: MDL-13001 - adding support for language files in local/ directory. 2008-01-15 01:40:02 +00:00
skodak 3e475991f9 MDL-12793 PARAM_HOST incorrect cleaning; merged from MOODLE_19_STABLE 2008-01-01 17:23:05 +00:00
poltawski 1a4de3618b MDL-4692 - initalise var, merged from MOODLE_19_STABLE 2007-12-28 22:56:42 +00:00
mchurch 19c8cf7917 MDL-12703 - Use the 'welcometocourse' language string if there is no 'welcomemessage' property set in the course object. Currently, there does not seem to be any code or data items that would set this property. 2007-12-28 17:14:01 +00:00
skodak e69499c8df MDL-12729 show recoverable fatal errors in DEBUG_ALL and DEBUG_DEVELOPER; merged from MOODLE_19_STABLE 2007-12-26 13:33:25 +00:00
skodak 4ef8e74c53 MDL-12725 remove_dir() does not return correct status and fails if dir does not exist + improved sanity test in check_dir_exists(); merged from MOODLE_19_STABLE 2007-12-24 21:16:30 +00:00
moodler e0e322d9e7 Something really old we'll need later 2007-12-20 06:45:32 +00:00
skodak 9c305ba15a MDL-12655 set_config() should cast values to string because get_config does that too; merged from MOODLE_19_STABLE 2007-12-19 22:32:43 +00:00
skodak 220a90c5a1 MDL-11561 admin tree improvements and bugfixing 2007-12-19 17:35:20 +00:00
skodak 6265d4630b MDL-12103 new config option for mail newline chars; merged from MOODLE_19_STABLE 2007-12-17 23:44:25 +00:00
skodak 3f6ba95bc6 MDL-12570 option to disable lang autodetect from browser; merged from MOODLE_19_STABLE 2007-12-15 13:28:01 +00:00
sam_marshall d5fe85d5cc MDL-12431 Added ability for filters to contain lang files 2007-12-04 11:47:28 +00:00
toyomoyo 0c07a1c458 MDL-12399, shorten_text() truncates all closing tags 2007-12-04 05:10:12 +00:00
skodak 0b5a80a1a5 MDL-7028 rewritten course reset + forum role_unassign cleanup fixes; merged from MOODLE_19_STABLE 2007-11-29 14:43:04 +00:00
scyrma 61b420ace2 Replaces 'GMT' by 'UTC' where it showed in user interface and fixes MDL-9164. 2007-11-22 06:28:58 +00:00
martinlanghoff 6fd511eb1c MDL-9399 moodlelib: set_config() deletes config entries if the value is NULL
New! Improved! If you pass NULL as the value, it will delete the
config entry for you.
2007-11-14 22:10:21 +00:00
martinlanghoff 8f9e1d2c4d 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.

To be followed by callers cleanup...
2007-11-14 22:04:05 +00:00
martinlanghoff a238e822a2 login/index, moodlelib: move session setup logic to complete_user_login()
Move most of the user session setup logic from login/index.php to
complete_user_login().
2007-11-14 22:03:46 +00:00
stronk7 23610d6ff7 Adding lang support within profile fields to make them selfcontained.
Merged from MOODLE_19_STABLE
2007-11-09 19:11:40 +00:00
skodak 6d11d0ee0e MDL-12020 can not bulk delete users with the same email - new username collision 2007-11-04 13:51:26 +00:00
stronk7 5fab4931b4 Changed check_dir_exists() behaviour to be more robust
and to work better when used recursively under sites
with open_basedir enabled. Credit goes to René Samselnig. MDL-11437

Merged from MOODLE_19_STABLE
2007-11-02 09:53:32 +00:00
nicolasconnault 98a85772f5 MDL-11912 Creating 1000's layer directory first, then userid directory: no need for recursion 2007-11-01 08:45:30 +00:00
skodak 18f2700959 MDL-11904 deny/accept Email settings conflict with text - now .example.com means all subdomains 2007-10-29 20:04:14 +00:00
skodak 1504e26135 MDL-11927 fixed cookiepaths; patch by Kevin 2007-10-28 14:20:20 +00:00
nicolasconnault ddaadc7c78 MDL-8605 More changes to upgrade and restore, and some unit tests with db and rs mock objects 2007-10-12 19:13:18 +00:00
nicolasconnault 56a1a88228 MDL-8605 New user directories implemented 2007-10-11 09:01:29 +00:00
nicolasconnault b7064779f5 Updated copyright notice in header 2007-10-10 05:25:14 +00:00
skodak b51ece5b3b MDL-11660
* user_lastaccess deleted when deleting course
* rewritten deleting of contexts - does not use get_context_instance() anymore because it is much more strict now
* added deleting of grade_letters and settings when deleting course
2007-10-09 16:07:15 +00:00
skodak 128f098418 MDL-11640
* 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
2007-10-09 12:49:54 +00:00
stronk7 4b3f69957e Modify notify_login_failures() for better scale. MDL-11661 2007-10-09 00:11:07 +00:00
ikawhero 323ccc26b6 Include custom profile fields when setting up a user object 2007-10-08 07:23:18 +00:00
nicolasconnault ece966f06e MDL-11482 Resolved the sum icon issue (added a new x-bar icon) and resolved a dependency problem in moodlelib 2007-10-03 12:22:25 +00:00
martinlanghoff bafd7e78e9 moodlelib: Introducing the cache_flags functions
These are functions for handling the volatile entries in the
cache_flags table.

 get_cache_flags() - get array of current flags
 set_cache_flag()  - set a single flag
 unset_cache_flag() - unset a single flag
 gc_cache_flags() - garbage-collect expired flags
2007-10-02 08:39:44 +00:00
skodak 41b7618ba2 MDL-11462 fixed PARAM_URL inline focs, uncommented old regex in URL validation library - official TLD not required anymore 2007-09-29 11:01:34 +00:00
jmg324 ef0bd87b3f generate_email_supportuser needs to set maildisplay for email_to_user to include proper support details. 2007-09-27 12:38:40 +00:00
skodak ae8adf77c0 MDL-10791 format_float() now supports non-localised output too (. decimal separator forced) 2007-09-27 09:58:40 +00:00
skodak e2fa911b73 MDL-11440 working fix for require_user_key_login() 2007-09-25 12:31:39 +00:00
martinlanghoff 0df35335ba moodlelib: isediting() uses $PAGE->user_allowed_editing(), drop editcourseallowed()
With this commit, isediting() checks with the page if the user is
allowed editing. And as the last caller of editcourseallowed() is gone,
remove it.
2007-09-19 07:48:03 +00:00
martinlanghoff 2a2057736e moodlelib: moodle_request_shutdown() prints included files
If MDL_PERFINC is defined, we now print to errorlog a listing
of the files included, their size, and then a total size.

The total size isn't the most important metric, though it does give us
a good idea of how much PHP the PHP engine is parsing for us. The main
cost is still in the seeks involved.

Even when using precompilers -- our best-case scenario -- each include
or require forces at least 2 stat()s to compare timestamps in the php
file vs the precompiled file. If the working set fits in buffers we are
fine, but our 60+ stat() calls per page is quite a bit.
2007-09-19 07:46:39 +00:00
martinlanghoff 21e2dcd946 moodlelib: require_login() rework
A bit of rework around require_login()

 - Fixed a subtle bug in the check whether a user can see sitecourse
   hidden activities

 - Save 1 DBq and 2 includes per call by only calling
   get_auth_plugin() only when needed.

 - Grab the contexts we are interested in only once and keep them in
   variables.
2007-09-19 07:25:49 +00:00
martinlanghoff 1cf2e21b6e moodlelib: require_login() - rework course/category visibility checks
Reworked the logic of the visibility checks so that we evaluate in a
chain:

   - can view course   (visible or user can see hidden)
   - can view category (visible or user can see hidden)

Without this patch, users that could see hidden categories could not get
into courses inside of them.

While at it, fix reference to the old $USER->switchrole
2007-09-19 07:19:20 +00:00
martinlanghoff 20aecba887 moodlelib:remove_course_contents() does not need to 'clearcache'
Now that delete_context() marks things dirty, we no longer
need to clearcache. Which is deprecated anyway.
2007-09-19 07:17:45 +00:00
martinlanghoff 955679bcf3 moodlelib: require_login() - assign tempguest role using load_temp_role()
And remove the explicit handling of deprecated $USER->capabilities
2007-09-19 07:16:43 +00:00
martinlanghoff 51be70d2e2 accesslib/moodlelib: check $USER->access[rsw] for roleswitches 2007-09-19 07:15:50 +00:00
martinlanghoff a9d4ea7849 All interactive enrol/unenrol codepaths mark the context dirty
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.
2007-09-19 07:11:42 +00:00