Commit Graph

185 Commits

Author SHA1 Message Date
toyomoyo 826153a73d fixing progress count 2006-10-30 05:39:52 +00:00
toyomoyo 1e76d6529c ignore site level course teacher assignments during upgrade from 1.6 or below 2006-10-30 05:25:53 +00:00
moodler e60154c553 Users not logged in may have capabilities but no id 2006-10-29 15:56:36 +00:00
sam_marshall 6266a81cf7 MDL-7250 typo ARGH sorry. 2006-10-27 16:26:02 +00:00
sam_marshall d0f6aa914a MDL-7250 update to previous change to do in SQL as suggested 2006-10-27 16:24:26 +00:00
sam_marshall b1d476b800 MDL-7250 Slight change to load_defaultuser_role so that it doesn't load 0s into $USER->capabilities. 2006-10-27 16:16:35 +00:00
moodler 6cdd66e3c5 Added a top-level cache to has_capability() to make it perform better
in cases where it's called a lot with repetitive values (which happens
a lot in things like forum mailouts) with only a small memory cost.
2006-10-26 09:42:58 +00:00
toyomoyo 6f0c99c7a8 fixing a bug where context with override and assignments are adding 2006-10-26 03:56:38 +00:00
moodler 5c0cd26dbf ALtered new SQL in load_user_capability to make it more friendly with MS SQL 2006-10-25 08:33:40 +00:00
moodler 8e9aa7d060 Just some tidy-ups, removed redundant SITEIDs etc 2006-10-25 08:31:09 +00:00
toyomoyo d91d2fa6d3 use limited fields instead of u.* 2006-10-25 07:19:30 +00:00
toyomoyo 1ca7a8001b fix for load_user_capability() when 2 contexts in overrides are not related 2006-10-25 03:47:05 +00:00
moodler 63d4e986d0 This new function called load_all_capabilities() should be used whenever
you want to completely reload the capabilities for the current user.

Basically it will deal nicely with the default site-wide permissions
depending on the current user.

More background in the comments on MDL-6963
2006-10-23 15:14:23 +00:00
skodak 83e674cd7f fix has_capability() to work when $nomoodlecookie = true; MDL-7156 - needed for RSS file.php that is serving feeds 2006-10-21 20:41:41 +00:00
moodler 55a96b2f3e Please please please be defensive about values returned from the database. Always.
In this case moodle.org had some bad data that caused this code to crash.

MDLSITE-55
2006-10-21 14:51:56 +00:00
toyomoyo 8807ea9497 fix for MDL-7113, removing DISTINCT on TEXT fields 2006-10-20 02:43:32 +00:00
toyomoyo 43059890b7 making the site context same as the site course context 2006-10-19 06:15:42 +00:00
toyomoyo f3726ba3b2 fix for MDL-7055 - prohibts at site level not working 2006-10-18 06:44:45 +00:00
moodler 252b76e7aa Switch roles now works properly for admins at module level! 2006-10-11 05:47:36 +00:00
toyomoyo 770f2e2ab1 fixed assign_capability() function so that it's no longer writing '0's into db 2006-10-11 02:13:46 +00:00
skodak 4dd5d7513d fixed wrong capability name and function name typo 2006-10-09 10:07:15 +00:00
skodak 17e5635c36 fixed 'capabilitities' typos and removed forgotten debug_print_backtrace() commited with MDL-6728 2006-10-08 11:00:49 +00:00
skodak ab61d01b06 Typo in lib/accesslib.php MDL-6728, found by Nicolas Martignoni. 2006-10-08 10:52:54 +00:00
moodler 83ea392ee1 Drop the user_xxx tables after Roles install 2006-10-06 06:47:12 +00:00
moodler 7b37cb9a01 Added new function
function user_has_role_assignment($userid, $roleid, $contextid=0)
2006-10-04 07:07:57 +00:00
toyomoyo 9b5d7a463e fixing typo 2006-10-04 02:43:29 +00:00
toyomoyo 5e67946d6c adding support for 1.6->1.7 backups 2006-10-03 08:54:46 +00:00
skodak 5fe9a11d96 more diagnostics in has_capability() - number instead of context object detected and debug message displayed 2006-10-02 22:10:36 +00:00
moodler e9c82dca8f Fixed capability soring on course and coursecat override MDL-6780 2006-10-02 08:57:00 +00:00
toyomoyo 8020a0162f roles and capability support for backups. role mapping is in, please help test, thanks 2006-10-02 08:49:07 +00:00
moodler b16de84980 get_role_users() can now get all the people who have any role in that context,
which is useful
2006-10-01 08:34:36 +00:00
moodler 7ea02fe987 FIxed some typos in get_role_users and count_role_users to do with parent contexts 2006-10-01 07:02:53 +00:00
moodler 9343a7333a Fixed a bug where load_user_capability() was not checking in the
specified context when it was provided (only in the parents)
2006-10-01 05:27:36 +00:00
skodak ba8d802720 MDL-6673 duplicate capabilities in list 2006-09-30 20:11:44 +00:00
moodler aae37b638c Added progress bar to role assignments during upgrade 2006-09-29 06:41:10 +00:00
moodler 72da504606 Added a progress bar for the role assignments 2006-09-29 06:19:47 +00:00
moodler 459c1ff12a Just tidying up code while reading it 2006-09-29 05:35:37 +00:00
moodler 41763b02da One more debugging removed 2006-09-28 08:38:27 +00:00
moodler 130672189c Removed excess debugging that is no longer very useful 2006-09-28 08:37:19 +00:00
moodler bac2f88ae8 Added count_role_users() as a more efficient thing to do than get_role_users() 2006-09-28 04:42:49 +00:00
skodak 250934b8e0 fixed logic of moodle_install_roles() - it now calls update_capabilities() after creation of default roles, but before first role_assign(). The problem was that role_assign calls code from forum lib which already uses capabilities, this might cause even bigger problems later. 2006-09-27 22:59:37 +00:00
skodak 1cd3eba948 fixed validation of course category for site course MDL-6715 2006-09-27 20:43:04 +00:00
skodak 7bfa3101df add checks for stale contextid in role_assignments and overrides into load_user_capability() MDL-6708 2006-09-27 18:11:36 +00:00
skodak a36a3a3f98 added strict context level checks to get_context_instance() MDL-6709 , the reason is to find typos and buggy code that would be otherwise unnoticed 2006-09-27 17:58:17 +00:00
skodak 3ca2dea51d sanitise request in create_context() and show debug info when appropriate MDL-6715 2006-09-27 17:50:53 +00:00
moodler bccdf22764 Fixed a possible notice 2006-09-27 08:01:22 +00:00
moodler f1dcf0000a Checked in Nick's patch from MDL-6699 to aid installation when there
are a LOT of students (it was running out of memory)
2006-09-26 13:31:57 +00:00
toyomoyo c76e095f70 some fixes for the main load_user_capablitiies() function, need pair c1, c2 to impose uniqueness. should use c2.id instead for override. no restriction on c2 for assignments 2006-09-25 07:50:03 +00:00
moodler 0a3e970319 FIxed some problems when getting teacher lists for print_course 2006-09-25 06:09:06 +00:00
moodler 1d546bb125 Fix for get_users_by_capability() so the caller can choose whether
they want users with doanything included or not
2006-09-25 03:00:50 +00:00