Commit Graph

969 Commits

Author SHA1 Message Date
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
martinlanghoff
a1244706be user_set_preference(): minor optimisation
Don't update if the values already match...
2007-09-19 07:01:41 +00:00
skodak
fce1ff5aa1 MDL-11297 adding new PARAM_TAG - numeric tags not allowed 2007-09-16 19:31:56 +00:00
skodak
8e1ec6be58 MDL-11298 use textlib_get_instance() instead of new textlib() 2007-09-16 18:49:41 +00:00
skodak
4eb718d801 MDL-11048 + MDL-11297 improved tag normalisation, more security 2007-09-16 18:41:57 +00:00
skodak
bcef031984 MDL-11297 adding new PARAM_TAG and PARAM_TAGLIST that are needed for blog and interest tags 2007-09-16 14:20:32 +00:00
donal72
c824d47823 Uninitialized variable 2007-09-12 03:25:43 +00:00
martinlanghoff
cf1348caae PERF logging - move handling to moodle_request_shutdown()
By moving the performance profile logging to the very
end of PHP processing, we cover more pages, notably those
that don't end up with a footer or a redirect, like file
serving.

This should improve quality of our performance logs, and
help catch some piggies...
2007-09-12 02:57:26 +00:00
moodler
edea42f96a Don't show message popups for guests 2007-09-04 06:47:02 +00:00
moodler
3a1ac34002 Fixed some notices on some custom pages 2007-08-31 03:45:59 +00:00
skodak
e436033fb8 MDL-11026 private user key - implement ip restrictions 2007-08-29 18:06:18 +00:00
skodak
61c6071f40 MDL-10984 support for user private keys when accession scripts without normal sessions 2007-08-28 08:29:40 +00:00
skodak
e6260a456b MDL-10635 improved performance of update_course_icon() and friends; fixed parameter of iseditting() - removed $userid which was not used and did not make much sense there anyway 2007-08-25 11:28:37 +00:00
nicolasconnault
3565ff92e4 MDL-10970 Someone was using
$locations = array('location1');
$locations += array('location2', 'location3', 'location4');

to save the hassle of doing one $locations[] = 'location1'; for each location.

But += doesn't add any entry if the key of the new array already exists in the original array. So, using my example, the resulting array would be:

$locations: array('location1', 'location3', 'location4');
2007-08-24 06:01:15 +00:00
nicolasconnault
364fffda3b MDL-10723 Removed all uses of print_navigation() throughout moodle, the function call is now entirely deprecated. 2007-08-24 04:22:30 +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
Martin Langhoff
13534ef716 cvsimport fixups 2007-08-29 13:10:11 +12:00
nicolasconnault
33a34cd4d0 MDL-10875 Corrected bug in averaging plus a couple of typos 2007-08-20 07:29:05 +00:00
nicolasconnault
0be6f67819 MDL-10870 All files updated to new build_navigation() method. Most are untested, because they are not easily accessible within a moodle site. 2007-08-17 19:09:11 +00:00
skodak
f8e3d5f0c2 MDL-10888 groupmembers only checks in require_login() 2007-08-17 12:15:32 +00:00
nicolasconnault
73c24ef80b MDL-10870 All files updated to new build_navigation() method. 2007-08-16 15:01:25 +00:00