Commit graph

860 commits

Author SHA1 Message Date
toyomoyo
e38f38c326 fix for MDL-6571, added get_roles_on_exact_context() for backup 2006-09-21 03:21:33 +00:00
skodak
eef868d17d major whitespace cleanup - fixed trailng whitespace in new files and admin area 2006-09-20 21:00:45 +00:00
toyomoyo
dc5586907d replacing deprecated calls and references to capability calls 2006-09-20 09:00:04 +00:00
vyshane
759ac72de1 Added new function function fetch_context_independent_capabilities(). Modified fetch_context_capabilities() to use the former.
Fixed get_roles_used_in_context() sql query. r.sortorder must be selected if it is to be used in an ORDER BY clause.
2006-09-20 08:30:49 +00:00
skodak
8521d83aff role_context_capabilities should handle current context too and role override simply use parent context 2006-09-20 06:24:55 +00:00
moodler
c4381ef5d2 FIxed a bug where $context had not been defined in enrol_into_course 2006-09-20 02:19:08 +00:00
moodler
7f7cacdf4e Made the debugging message a bit less passive 2006-09-20 01:52:49 +00:00
tjhunt
a8a7300acc In debug mode, warn people if they are asking for an unknown capability. 2006-09-19 22:57:17 +00:00
skodak
a6b02b652b RISK_ADMIN replaced with RISK_CONFIG 2006-09-19 07:33:22 +00:00
toyomoyo
2d9965e1dc function should be looking up parent contexts too 2006-09-19 02:47:55 +00:00
toyomoyo
d76a5a7fed replacing references to user_* tables 2006-09-19 01:44:33 +00:00
skodak
21b6db6eff added capabilty risks into access.php and GUI for define role and override; minor fixes for capability types in forum 2006-09-18 21:32:49 +00:00
skodak
31f267963a MDL-6568 shortname added to roles 2006-09-18 17:40:22 +00:00
skodak
1aad431080 metacourse sync now uses roles, I will continue with fixing of GUIs tomorrow 2006-09-17 22:21:37 +00:00
moodler
b963384f41 Added new convenience funtions:
get_default_course_role()  - gets default role for enrolment

   enrol_into_course() - enrols a person using the default role
2006-09-17 16:06:25 +00:00
moodler
b29ab53d31 Removed the setting of default values. The default is now just zero. 2006-09-17 09:08:47 +00:00
skodak
86e2c51da8 infinite loop prevention when unassigning recursively 2006-09-17 08:53:57 +00:00
skodak
4e5f3064bf role assignment and unassignment now propagates to metacourses 2006-09-17 08:42:42 +00:00
moodler
ff64aaeaec Just tidying a couple of functions 2006-09-17 07:00:47 +00:00
moodler
746a04c500 Adding defaultrole to course table 2006-09-17 06:37:59 +00:00
moodler
ec6eb11097 Sort get_user_roles from most local to most general 2006-09-17 03:33:22 +00:00
moodler
5b6306677b extending get_user_roles with more options and more returned info 2006-09-16 15:22:55 +00:00
moodler
64026e8c1e Tidy up get_users_with_capability 2006-09-16 13:54:57 +00:00
skodak
a05708ad61 fixed $groupidsql in get_users_by_capability() 2006-09-16 05:56:51 +00:00
moodler
11c40e2f4e Fixed a bad bug in get_user_roles :-) 2006-09-15 14:56:32 +00:00
moodler
4b10f08b88 Rename CONTEXT_USERID --> CONTEXT_USER for consistency 2006-09-15 14:09:16 +00:00
tjhunt
f00b7f8d8e The ISNULL() function is a nasty mysql-ism. The standard SQL syntax is "xxx IS NULL". Even mysql supports this, whereas noone else supports the mysql syntax. 2006-09-15 14:00:30 +00:00
moodler
5081e7868d Some SQL fixes 2006-09-15 13:51:42 +00:00
moodler
405f64c7fd Fixed some SQL error 2006-09-15 13:42:40 +00:00
moodler
2f089dd5f9 Guest account could be getting the default role 2006-09-15 13:28:18 +00:00
tjhunt
4e5a0168f8 Fix typo. 2006-09-15 13:18:28 +00:00
toyomoyo
71dea306b4 changing lib functions to work with roles, some functions might not work as expected now 2006-09-15 09:08:48 +00:00
moodler
e49e61bfe9 Updates for visual stuff 2006-09-15 06:07:29 +00:00
moodler
ca23ffdb74 Don't overwrite capabilities when loading default role 2006-09-14 09:41:09 +00:00
moodler
8f8ed475f7 Added a new setting called $CFG->defaultuserroleid which defines
the role that ALL users get by default when they log in.
2006-09-14 09:39:23 +00:00
toyomoyo
ea8158c118 changing sql calls from user_students table to role_assignments table 2006-09-14 09:08:07 +00:00
moodler
ea82d6b638 CHanged a lot of CFG->debug stuff to use the new debuggin() function 2006-09-13 09:45:07 +00:00
toyomoyo
17d6a25e5c adding capabilitiies 2006-09-13 09:08:14 +00:00
moodler
0f161e1fee role_assign() and role_unassign() now call these hooks in each module:
xxx_role_assign()

    xxx_role_unassign()

so that modules can do stuff they might need to do (eg subscriptions etc)
2006-09-13 08:07:14 +00:00
moodler
d74067e8e7 1) Fixed API of require_capability() so it matches has_capability()
2) Extended role_unassign to clean up forum subscriptions etc as well
2006-09-13 06:35:25 +00:00
vyshane
0c4d9f492e moodle/site:manageblocks tweak 2006-09-13 03:56:38 +00:00
skodak
be382aafb3 get_component_string() now works for all enrollment plugins MDL-6522 2006-09-12 20:03:08 +00:00
skodak
69eb59f28a Changed sort order in Role definition page MDL-6522 2006-09-12 19:54:33 +00:00
toyomoyo
ae9e4c064e replacing iscreator() calls with capabilty 2006-09-12 08:56:10 +00:00
toyomoyo
ab5c904411 added function get_role_users - returns all users assigned this role in this context (or higher) not very useful for participants list because of the count and paging. Could possibly expand it 2006-09-12 07:37:23 +00:00
moodler
2e85fffeb1 FIxed some typos and other logic related to assign_capabilities 2006-09-12 07:07:30 +00:00
moodler
e7876c1e34 Added new load_guest_role() for guest access, and made assign_capability()
smarter about pre-existing capabilities (new param allows overwriting or not)
2006-09-12 06:15:33 +00:00
toyomoyo
1c45e42e3c adding capabilities 2006-09-11 08:56:23 +00:00
skodak
e46c09873a fixed warning during initial install when creating admin roles 2006-09-10 20:29:44 +00:00
stronk7
ccfc5ecca1 Only send contexts to cache if the aren't empty. At initial installations
some empty contexts were being cached and used later, causing insertion
of null values to every DB but MySQL.
2006-09-08 19:28:03 +00:00