620 Commits

Author SHA1 Message Date
Sam Hemelryk
8432f5e6c5 files MDL-20635 Added support for cleaning up files associated with a context when it is deleted
Note: This is a temporary solution until we have a patch to clean them up in a cron run
2009-11-04 06:11:32 +00:00
Petr Skoda
117bd74897 MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup 2009-11-01 11:31:16 +00:00
Petr Skoda
df97c6ee57 MDL-14679 fixing old TODO, get_record now throws exception on error 2009-11-01 09:31:09 +00:00
Martin Dougiamas
7fde45a7e6 accesslib - Remove some notices when user is not logged in 2009-10-27 09:31:46 +00:00
Petr Skoda
b8affd4c8a MDL-12886 support for ws cap names in core 2009-10-26 19:41:06 +00:00
ericmerrill
4a09658ea8 My Moodle/Courses: MDL-20472 get_my_courses returns 2 more courses then limit. Repairs two off by one errors in get_my_courses and get_user_courses_bycap. 2009-10-08 04:52:33 +00:00
skodak
f1064cca78 MDL-19039 improved default frontpage role capability evealuation, needs to be manually enabled in config.php 2009-10-05 17:08:16 +00:00
mudrd8mz
bf66a674ce removing deletions from {blog_association} from the core
The {blog_association} is not defined but it is still referenced in the
core functions. This seems to be some blog subsystem mess that prevents
the core from removing any activity module and the context. I am sorry
Nico if I break something in your current work...
2009-10-01 14:41:20 +00:00
skodak
9a0df45a01 MDL-12886 new design of external service functions, groups api improved and known problems fixed - still work in progress with lots of todos - sorry 2009-09-14 23:52:08 +00:00
nicolasconnault
cae837087a MDL-19676 Blog improvements 2009-09-04 00:36:43 +00:00
nicolasconnault
aa9a686740 MDL-19799 Upgraded calls to helpbutton, print_simple_box* and notify 2009-08-18 05:20:12 +00:00
dongsheng
68bd9e5e13 "MDL-20024, fixed missing language string and support repository plugins" 2009-08-07 08:59:47 +00:00
skodak
0a127169fe MDL17980 reverting last commit - other devs agreed, to be explained in tracker 2009-08-03 07:35:41 +00:00
peterbulmer
1b509b3699 MDL17980 mnet improvements
* Allow multiple roles to be allocated by identity provider
* Allow existing enrolment plugins to manage mnet enrolments


Author: Peter Bulmer <peter.bulmer@catalyst.net.nz>
2009-08-03 03:38:23 +00:00
tjhunt
41e87d30bc accesslib: MDL-19882 require_capability no longer does an automatic require_login. 2009-07-21 06:24:44 +00:00
tjhunt
e92c286c20 block contexts: MDL-19098 every block should have a context
even non-course and sticky blocks.

The parent context is block_instances.parentcontextid.

The block context should be used for checking permissions directly
related to the block, like moodle/block:view or moodle/site:manageblocks.

However, if the block is displaying information about the current page,
for example the participants block showing who 'here', then it may be
better to use the context of the page where the bloack is appearing -
in other words $this->page->context - to check permissions about the
user's ability to see participants here.

Or, if the block is displaying something stronly related to courses,
for example, a course meny block, the block should probably use the
context for $this->page->course to check permissions.
2009-07-13 08:37:34 +00:00
tjhunt
13a0d3d3c9 blocks MDL-19536: rename block_instances.contextid to parentcontextid to avoid gross confusion 2009-07-10 05:58:59 +00:00
moodler
024f3f9749 accesslib MDL-19730 fixing regression from MDL-19077 where has_capability fails when $USER->id=0 (so they couldn't see blocks etc) 2009-07-07 07:06:19 +00:00
tjhunt
8a9c1c1c2d Add a warning that require_capabiliy can only be used before output is started. 2009-07-04 14:22:11 +00:00
tjhunt
c84a2dbea2 MDL-19077 - change how $OUTPUT is initialised.
Please read the comment at the top of bootstrap_renderer in setuplib.php
2009-06-29 05:00:45 +00:00
tjhunt
31a9987770 install: MDL-19610 encapsulate empty($CFG->rolesactive) checks in a during_initial_install() function. 2009-06-24 09:17:56 +00:00
skodak
17da2e6f28 MDL-16438 centralise information about plugins to avoid duplication, includes local customisation conversion to standard plugin structure + fixes for some recent regressions; see tracker for more details and links to docs and forums discussions 2009-06-19 14:25:56 +00:00
stronk7
f59309921b MDL-19465 accesslib - improve get_user_access_sitewide() performance (~10%) 2009-06-16 15:34:55 +00:00
skodak
a8f3a651c0 MDL-18293 removed obsoleted checking of return values from insert and update_record + unused strings cleanup 2009-06-13 18:16:08 +00:00
skodak
bb4b6010f3 MDL-18293 removed obsoleted checking of return values from insert and update_record + unused strings cleanup 2009-06-13 17:17:10 +00:00
skodak
bf8e93d704 MDL-18293 $DB->somethiong is using exceptions, no need for ifs tehre, removing useless strings 2009-06-03 20:00:08 +00:00
skodak
56f3599bb9 MDL-19288 fixed limiting cached context - array_shift() was breaking array keys; merged from MOODLE_19_STABLE 2009-05-23 20:08:48 +00:00
samhemelryk
cc3edaa47c accesslib.php MDL-19236 added phpdocs and copyrights 2009-05-22 02:03:55 +00:00
samhemelryk
d9ff0cc96e accesslib MDL-19237 corrected non existent fields 2009-05-19 08:02:55 +00:00
samhemelryk
46808d7ccc accesslib MDL-19236 added phpdocs and copyrights 2009-05-19 07:50:54 +00:00
skodak
5ca3c8386f MDL-19184, MDL-19212 - refactoring, cleanup and improvements in text editors support; localization support is not finished, inline docs incomplete, expect more commits soon 2009-05-16 20:53:21 +00:00
stronk7
0974051307 MDL-18746 get_user_courses_bycap() - avoid ambiguous (repeated) column names ; merged from 19_STABLE 2009-05-11 00:04:18 +00:00
tjhunt
e03c0c1d49 blocklib: MDL-19010 fix editing block config and block roles. 2009-05-08 07:47:50 +00:00
tjhunt
f474a4e583 blocks: MDL-19010 Fix further blocks-related breakage, including removing all references to blocks_insance_old outside blocklib.php 2009-05-07 08:55:10 +00:00
tjhunt
9d1d606e0d blocklib: MDL-19010 fix new install.
* Fix the blocks bit of build_context_path
* Replace blocks_repopulate_page
* Make starting_output work during setup
2009-05-07 07:05:22 +00:00
tjhunt
6bf44482c6 pagelib: MDL-12212 eliminate quiz_page 2009-05-06 09:24:45 +00:00
tjhunt
93d4a373f9 blocklib: MDL-19010 always include blocklib in setup.php, stip includes elsewhere 2009-05-06 09:13:16 +00:00
tjhunt
66b10689e2 blocklib: MDL-19010 upgrade database tables ready for now blocks system 2009-05-06 09:12:03 +00:00
skodak
8ead7b5983 MDL-19009 cleanup - there is no CONTEXT_GROUP and pinned block context 2009-05-04 20:23:20 +00:00
tjhunt
9434fef401 filters: MDL-18879 filter data not deleted when a context is deleted
Missed when implementing MDL-7336

Also, fix minor issues with deleting filters
2009-04-17 02:49:07 +00:00
sam_marshall
4d10247fdb MDL-18768: Limited size of context and modinfo caches to avoid memory problems with code that loops through many courses, also changed forum role_assign to use recordset for all-courses loops 2009-04-06 09:48:39 +00:00
sam_marshall
48f9c073ca MDL-18094: course/viewhiddenactivities didn't work (in some parts of the code) at module level 2009-04-02 16:32:12 +00:00
tjhunt
c468795ce9 switch roles: MDL-18132 New Role allow switches page finished.
I also set up a reasonable set of default allows, including setting up some sensible allow_overrides, whatever the rant in MDL-15841 says.
2009-03-25 04:20:57 +00:00
tjhunt
82701e2443 switch roles: MDL-18132 separate database table role_allow_switch instead of re-using role_allow_assign.
This is part 1 that does the back-end:

1. New table role_allow_switch.
2. Upgrade that copies all the allows from role_allow_assign, and then drops the old CFG->allowuserswitchrolestheycantassign.
3. Old function get_assignable_roles_for_switchrole renamed to get_switchable_roles and changed to use the new table. Fixes MDL-18604 in HEAD.
4. Switch callers to use the new function name.
5. Unit tests for this new function.
6. To make those unit tests work, new switch_global_user_id and revert_global_user_id methods in UnitTestCaseUsingDatabase for toggling $USER->id.

I still need to do the editing interface under Administration ► Users ► Permissions ► Define roles. That will be done as a second commit.
2009-03-23 08:15:21 +00:00
tjhunt
ffdd703a99 MDL-18637 fix Moodle 1.9-style {$CFG->prefix}tablename in HEAD, and a few missing $DB->s.
I did not fix all the DB problems in search, there are too many there for me to be prepared to clean up other people's mess.

(For once, it was not me making this mistake ;-))
2009-03-23 05:19:53 +00:00
tjhunt
d867e696aa accesslib: MDL-18620 do not used static to cache things, it makes unit testing impossible.
Instead we have a new $ACCESSLIB_PRIVATE for all caching. Regrettably, the only way to make this work in PHP (other than rewriting everything to be methods of a class rather than functions) is to make this a global variable. However $ACCESSLIB_PRIVATE should not be thought of a global, it is a private implementation detail of accesslib.php. (And there is a comment saying that.)

There is a new function accesslib_clear_all_caches_for_unit_testing(). In a unit test, you need to call this at the start of your test method, before you set up any test data, and again at the end, after you have discarded all your test data.

This new $ACCESSLIB_PRIVATE subsumes the old $ACCESS, $RDEFS and $DITRYCONTEXTS globals.

Also, I took the opportunity to refactor the (inconsistently) duplicated code for adding a context to the caches code into a cache_context function.
2009-03-23 03:54:50 +00:00
stronk7
004865e20d MDL-15748 get_user_access_sitewide() - reduce looking for perms in any context below category level.
Dramatic speed-up in sites with zillions of contexts and overrides. Credit goes to Samuli Karevaara.
Merged from 19_STABLE
2009-03-20 12:10:47 +00:00
tjhunt
ea26b22262 accesslib. Improve comment. 2009-03-20 07:41:49 +00:00
skodak
795a08adb7 MDL-17458 upgrade logging implemented + a lot more refactoring + exceptions implemented in install/upgrade code + lang pack cleanup + some more improvements 2009-01-31 20:07:32 +00:00
skodak
88582df496 MDL-17458 refactored guest and admin user creation + refactored roles install + added protection for installation hijacking + added reliable session test right before editting of admin account 2009-01-29 22:54:41 +00:00