551 Commits

Author SHA1 Message Date
tjhunt
8ed5dd63ee course categories: Fix many bugs with category editing and permissions. Clean up code.
Bugs: MDL-17479, MDL-16426, MDL-16063, MDL-16013, MDL-15658, MDL-15556, MDL-15161, MDL-14925, MDL-13742, MDL-11557.

* Simplify category editing permissions to just moodle/category:manage and moodle/category:seehiddencategories.
* Enforce those correctly. (Note MDL 17502 is still outstanding.)
* Don't screw up category sort order when you just edit name or description.
* Niceties like where redirects go when you cancel or submit forms.
* Make sure a global course creator can see the site admin block.
* Don't allow a category to be made the child of one of its children!
* General code cleanup to bring key files more in line with best pracitice.

Apologies for the fact it is one big patch, rather than a series of smaller patches. However, categoryedit.php, category.php and index.php where in pretty bad shape and needed significant cleaning up. categoryedit.php, in particular, was almost completely rewritten.

Merged from MOODLE_19_STABLE.
2008-12-04 08:53:10 +00:00
skodak
9b1ad47be8 MDL-17372 new course reports string - role definition improvement; merged from MOODLE_19_STABLE 2008-11-29 16:33:58 +00:00
skodak
95f0446147 MDL-17372 course reports: Added full plugin support for course reports 2008-11-27 20:30:14 +00:00
skodak
a0005f678f MDL-17372 admin reports: Added full plugin support for admin reports; added specail capability for unittest execution, minor refactoring 2008-11-26 19:27:40 +00:00
skodak
d994ced22b MDL-17372 admin reports: Added full plugin support for admin reports; added specail capability for unittest execution, minor refactoring 2008-11-26 19:27:39 +00:00
jamiesensei
bbf4f440ee MDL-15326 "allow for per report capabilities to replace mod/quiz:viewreports" 2008-11-25 12:11:27 +00:00
tjhunt
759adfffa9 user's role / capabiltiy report: sort the context tree. 2008-11-25 07:29:14 +00:00
tjhunt
e86ecf1f04 Fix typo. 2008-11-24 07:27:11 +00:00
tjhunt
490740d6cb role assign: MDL-17323 Show users from parent contexts ... Refine group labels. 2008-11-21 06:19:52 +00:00
tjhunt
698ae7eb24 role assign: MDL-17323 Show users with the role in a parent context as disabled opitons in the existing users box 2008-11-21 05:46:45 +00:00
tjhunt
bed9cec80b define roles: MDL-16966 etc. polishing the new roles UI following a meeting with Martin.
* Move the show/hide advanced button a bit down the page.
* Improve save button caption when creating a role.
* Don't show defaults on the basic define roles screen.
* Explain the background shading on the advanced roels screen.
* Fix the problem with the risks link to Moodle docs.
* Help icon by the permissions column heading.
* Tables with rotated <th>s, make them vertical-align: bottom.
* Rename explain.php and explainhascapability.php to check.php and explain.php
* Tool tips on the number headers in the explain table.
* Explain table - role names were missing.
* Allow link_to_popup_window to work with full URLs.
2008-11-20 09:57:20 +00:00
skodak
0ecff22d84 MDL-17267 fixed regression caused by my last commit 2008-11-19 14:43:38 +00:00
skodak
26c46d0ed6 MDL-17267 roles, install: fixed allow role assign table duplicates problem during install - see tracker for more details 2008-11-18 09:56:59 +00:00
tjhunt
716dd16327 install / accesslib: Fix install problem 2008-11-18 09:28:05 +00:00
tjhunt
4659454ac6 manage roles: MDL-8313 fix bugs with safe overrides. 2008-11-18 08:08:18 +00:00
tjhunt
bbdb7070ca manage roles: MDL-8313 Provide a basic mode for the manage roles page.
* New basic define roles mode, with just an Allow checkbox for each capability.
* Button to toggle this form to/from advanced mode.
* Also, a separate mode for viewing a role definition, rather than just showing disabled checkboxes.
* Now duplicating a role just takes to you a pre-populated add role form, so you can double-check things before saving the new role.
* Deleting a role is now logged.
* Role reordering code cleaned up.
* You can now no longer delete the last role that has admin permissions.
* This includes a general refactor of manage.php, which eliminates manage.html, and splits of define.php.
2008-11-18 07:10:00 +00:00
tjhunt
a4df1cbbe5 role manage ui: MDL-8313 Refactoring and clean-up prior to basic/adv manage page. 2008-11-14 10:38:06 +00:00
tjhunt
bef12c997a course settings: MDL-16327 when creating a course, the role renames were not saved. 2008-11-13 08:11:10 +00:00
tjhunt
1e8e46879c roles interface: Code reorganisation and adding boilerplate comments.
I have collected code that used to be in lib/adminlib.php, lib/accesslib.php and user/selector/lib.php into a new admin/roles/lib.php file.

And I added standard GPL and Moodle comments to all the files in admin/roles.
2008-11-13 04:07:01 +00:00
tjhunt
e8155bc338 Fix typo. 2008-11-12 10:12:33 +00:00
tjhunt
7906379c9a role assign: MDL-13325 when assigning roles inside front page activites, list all users as potential users. 2008-11-11 07:23:25 +00:00
tjhunt
8f52ac3708 accesslib: MDL-17159 Fix regression I caused with MDL-8312. 2008-11-07 02:51:47 +00:00
tjhunt
01a80f51e5 role assign: MDL-8312 Restrict which roles can be assigned at which contextlevels.
* New table role_context_levels
* Populate table with defaults on install
* Populate table on upgrade with the same defaults, plus any additional ones needed to ensure all the role assignments already in the database are allowed.
* Change get_assignable_roles to respect these settings.
* UI for these settings on the add/edit role form.
* Save these settings when a role definition is saved.
* If in a context, there are no roles you can assign, display a polite message.
* Back up these settings.
* Restore these settings. When resotring a <=1.9.x backup file, any newly imported roles are set to be assignable at all contextlevels.

Restore not tested because it is broken in HEAD.
2008-11-06 07:34:01 +00:00
tjhunt
faf75fe715 role overrides: MDL-17070 Improve override roles page to match the recent usability improvements on the assign page.
Including:
MDL-11529 When assigning/overriding roles, the dropdown for switching to another role should have a number in brackets

MDL-16549 Should not be able to edit the permission associated with moodle/site:doanything on any role.
2008-11-05 08:17:30 +00:00
skodak
cbc08f3bfc MDL-17130 dml: eliminated $CFG->dbfamily 2008-11-05 00:12:30 +00:00
skodak
c23b0ea11b MDL-17129 dml: implemented exceptions in new drivers, yay! 2008-11-04 23:07:14 +00:00
tjhunt
6cab02ac52 user selection: MDL-16993 Convert the assign roles page to use the new components.
At the same time, I took the opportunity to try to work on some of the usability issues on this page. Note that I have not quite finished! So don't comment until tomorrow.

In the course of doing this, I also did: half of

MDL-11529 Show the number of assignees of each role in the change role dropdown on this page.
MDL-17067 Make it clear in the UI that admins are not allowed to unassign themselves.
2008-10-30 10:49:15 +00:00
tjhunt
96f1a7a265 roles admin: Improve the usability of the assign roles interface - this is the first half of the work. Part of MDL-16993.
To do this, I found a way to clean up the method signatures of a couple of accesslib methods, so I did, hence the fact that this seems to touch some unrelated files.

Also, there is a nice new method in accesslib get_context_url, which gives you the natural URL for a context, so the course view page, or the user profile, etc.
2008-10-30 06:26:18 +00:00
skodak
655bbf511d MDL-16669 dml: improved sql_substring(), added unit tests 2008-10-28 15:11:10 +00:00
nicolasconnault
7b2f3680a3 MDL-16892 Fixed bug in accesslib role_fix_names method. Merging from MOODLE_19_STABLE 2008-10-20 13:47:08 +00:00
poltawski
386c151ec5 MDL-16816 - fix role_assign() to match php docs
Return role assignment id on succesful assignment
2008-10-09 13:52:39 +00:00
stronk7
8c44681c23 Substring MSSQL function *requires* 3rd parameter - MDL-16655 ; merged from 19_STABLE 2008-09-24 17:35:42 +00:00
stronk7
3128242122 Prevent get_users_by_capability() to return deleted users. MDL-16323 ; merged from 19_STABLE 2008-09-11 22:17:20 +00:00
scyrma
3bea11c8c1 MDL-14679: regression caused by a missing '>'. 2008-09-09 02:23:47 +00:00
tjhunt
ad944e7832 MDL-16343 New PARAM_ type, PARAM_CAPABILITY. 2008-09-08 07:00:49 +00:00
nicolasconnault
837e6a44f7 MDL-16369 Added error info in accesslib 2008-09-06 13:19:26 +00:00
nicolasconnault
f689028c7e MDL-16369 Added error info in accesslib 2008-09-06 13:17:15 +00:00
tjhunt
8238f44f16 MDL-12336 Inconsistent naming of the Front page area of the question bank, and the front page context more generally. 2008-09-05 04:06:17 +00:00
stronk7
4ce763762e Fix some problems with named parameters and improve
get_user_courses_bycap() queries. MDL-16209 ; merged from 19_STABLE
2008-08-28 18:08:06 +00:00
stronk7
082e777a54 Avoid "some" ra's duplicates. MDL-14817 ; merged from 19_STABLE 2008-08-18 22:46:40 +00:00
stronk7
8ac8f06afe Making some accesslib queries cross-db. Avoid using DISTINCT clauses on TEXT fields. MDL-16034
(plus minor unmerged change in comment)
2008-08-18 18:36:53 +00:00
scyrma
b98e7c62ff MDL-16096: required library was included in the wrong function - this removes the old one. 2008-08-18 06:26:45 +00:00
scyrma
11dca3eed6 MDL-16096: missing library require - Fix by Joseph Morwick. 2008-08-18 06:20:50 +00:00
skodak
775f811a66 MDL-16002 rewritten upgrade locking and better upgrade progress tracking; MDL-16070 Do not use $a[0] syntax in lang packs + various other upgrade improvements and fixes 2008-08-16 12:16:01 +00:00
skodak
44df8fa94c MDL-15941 block view permissions override regression fixed 2008-08-06 05:07:46 +00:00
moodler
2edde5c7be MDL-15841 Removed the default safe overrides for new installs (MDL-8521)
This MAY be reversed in Moodle 2.0, pending other roles work and discussion
2008-07-28 03:18:32 +00:00
skodak
f432bebff2 MDL-11421 context levels fixed in capability definitions, sorting of caps by name, plug-ins may report used core caps, fixed some risks; merged from MOODLE_19_STABLE 2008-07-24 21:59:13 +00:00
skodak
3a0c6cca33 MDL-8521 new feature - safe overrides, see tracker for details; merged from MOODLE_19_STABLE 2008-07-23 16:10:06 +00:00
skodak
ffc670d931 MDL-9983 role_unassign should not touch group members table directly - we need events; merged from MOODLE_19_STABLE 2008-07-06 22:54:46 +00:00
skodak
96608a55bd MDL-9983 role assignment related triggers; merged from MOODLE_19_STABLE 2008-07-06 19:30:12 +00:00