Commit graph

945 commits

Author SHA1 Message Date
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
skodak
5bf243d131 MDL-10383 - groups/groupings refactoring nearly finished ;-) 2007-08-16 11:06:48 +00:00
jamiesensei
681666abe7 fix for MDL-10826 ' Moodle Impossible to delete a course because of non-existent question_delete_activity() ' 2007-08-13 13:58:04 +00:00
skodak
76317c73a2 MDL-10791 improve handling of localised floating point numbers in moodle; replaced/fixed some float_format() that were used instead of round(); expect some more patches soon 2007-08-10 15:00:35 +00:00
tjhunt
a8bb516dce lang files in plugin folder support for gradebook plugin types. 2007-08-10 12:21:55 +00:00
jamiesensei
3bee1ead40 merging MOODLE_19_QUESTIONS with HEAD 2007-08-09 21:50:59 +00:00
nicolasconnault
384960dd68 MDL-9628 Simplified and improved the expanding/collapsing of categories. There are now three view types: full, aggregates only and grades only. 2007-08-09 16:41:39 +00:00
skodak
f615fbaba0 MDL-10711 adding deleting of grade data when deleting module or course 2007-08-03 19:25:22 +00:00
moodler
621739e7e4 Now emails use the new supportemail, supportname and supportpage settings in emails sent out MDL-10529 2007-08-01 09:00:21 +00:00
toyomoyo
df9f4b0f07 fixing scale backup/restore 2007-08-01 06:24:15 +00:00
moodler
e9250d8c50 Added object_array_unique() needed for tags 2007-07-31 08:06:39 +00:00
nicolasconnault
5e623a335f MDL-10345 Fixed bug that changed a null scale finalgrade to 1 due to passing through bounded_number(1, null, 3) 2007-07-18 05:17:45 +00:00
moodler
708d13d159 Add some caching to get_list_of_timezones 2007-07-11 09:11:44 +00:00
Martin Langhoff
08103c9364 cvsimport fixups 2007-07-07 14:18:30 +12:00
mattc-catalyst
01e3838853 MDL-9473: Initialise navlinks array before use
Author: Matt Clarkson <mattc@catalyst.net.nz>
2007-07-05 04:55:24 +00:00
mattc-catalyst
3b27b0fe21 MDL-9615: Correct incorrect use of term breadcrumbs
- $crumbs -> $navlinks


Author: Matt Clarkson <mattc@catalyst.net.nz>
2007-07-05 04:40:48 +00:00
poltawski
4fa94a5639 MDL-10264 - fixed typo 2007-06-26 21:17:56 +00:00
nfreear
751457e6e4 Fixes bug MDL-10138 build_navigation needs hidden "You are here" heading. Also, white space. 2007-06-15 15:15:29 +00:00
martinlanghoff
97e9803b48 moodlelib:moodle_request_shutdown() - only call apache_child_terminate if child_terminate is true - MDL-9350
Apparently there _is_ a PHP ini setting controlling
it -- defaults to off.
2007-06-07 21:22:20 +00:00
jamiesensei
9368476553 MDL-9734 fix for clean_param PARAM_LOCALURL bug 2007-05-27 11:19:04 +00:00
nfreear
a84dea2c30 Follow-up fix bug MDL-9753, "THEME->larrow, rarrow don't work in stock IE6". 2007-05-14 13:28:21 +00:00
skodak
63c9ee991f MDL-9764 Require_course_login() should check cm visibility in frontpage course too; merged from MOODLE_18_STABLE 2007-05-10 09:02:41 +00:00
nfreear
ce3735d453 Fixes bug MDL-9753, "THEME->larrow, rarrow don't work in stock IE6" 2007-05-09 14:15:33 +00:00
poltawski
a044c05ddb MDL-9742 - changed tabs to spaces in a few places where there are one
or two
2007-05-08 15:07:25 +00:00
donal72
533f791072 MDL-8973 : Undo API change in previous commit 2007-04-30 03:14:43 +00:00