470 Commits

Author SHA1 Message Date
moodler
9d829c681d Removing some notices 2006-09-22 05:17:57 +00:00
toyomoyo
5b5781f4f5 some new functions to help backuo 2006-09-22 01:46:45 +00:00
moodler
988ad08450 Use role sortorder when getting role lists 2006-09-22 01:21:01 +00:00
skodak
b5959f3071 partial rewrite of role manage script, improved notice_yesno(), other minor fixes and changes; I will work on assign and overide tomorrow ;-) 2006-09-21 22:34:45 +00:00
stronk7
85f101fa26 SQL ANDs mus be, always, "AND" :-P 2006-09-21 17:18:56 +00:00
stronk7
d7d05cf2f3 SQL ORs must be, always, "OR" 2006-09-21 17:09:28 +00:00
moodler
2d07587b4c Improvements to switchroles
1) You can have separate switchroles active in every course

2) Admins get a better view (doanything is supressed when switchroles active)
2006-09-21 15:58:59 +00:00
moodler
3a52e764e4 New "Switch Role" functionality to replace the old "Student view".
It's not well-tested yet and probably doesn't quite work.  I will keep debugging this tonight from home.
2006-09-21 09:16:41 +00:00
toyomoyo
01e52ac70a changes to backups (where the roles info are stored) 2006-09-21 09:09:16 +00:00
toyomoyo
4929302769 adding roles support for backups 2006-09-21 06:57:14 +00:00
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