} else {
$studentrole->id = 0;
}
+if ($userroles = get_roles_with_capability('moodle/legacy:user', CAP_ALLOW)) {
+ $userrole = array_shift($userroles); /// Take the first one
+} else {
+ $userrole->id = 0;
+}
$assignableroles = get_assignable_roles($context);
+$allroles = array();
+if ($roles = get_all_roles()) {
+ foreach ($roles as $role) {
+ $allroles[$role->id] = strip_tags(format_string($role->name, true));
+ }
+}
$temp->add(new admin_setting_configselect('notloggedinroleid', get_string('notloggedinroleid', 'admin'),
get_string('confignotloggedinroleid', 'admin'), $guestrole->id, $assignableroles ));
$temp->add(new admin_setting_configselect('defaultuserroleid', get_string('defaultuserroleid', 'admin'),
- get_string('configdefaultuserroleid', 'admin'), $guestrole->id, $assignableroles));
+ get_string('configdefaultuserroleid', 'admin'), $userrole->id, $allroles));
$temp->add(new admin_setting_configselect('defaultcourseroleid', get_string('defaultcourseroleid', 'admin'),
get_string('configdefaultcourseroleid', 'admin'), $studentrole->id, $assignableroles));
$string['configdefaultcourseroleid'] = 'Users who enrol in a course will be automatically assigned this role.';
$string['configdefaultrequestcategory'] = 'Courses requested by users will be automatically placed in this category.';
$string['configdefaultrequestedcategory'] = 'Default category to put courses that were requested into, if they\'re approved.';
-$string['configdefaultuserroleid'] = 'All logged in users will be given the capabilities of the role you specify here, at the site level, in ADDITION to any other roles they may have been given. The default is the Guest role. Note that this will not conflict with other roles they have, it just ensures that all users can do something useful at the site level (eg read forum discussions, resources, etc).';
+$string['configdefaultuserroleid'] = 'All logged in users will be given the capabilities of the role you specify here, at the site level, in ADDITION to any other roles they may have been given. The default is the Authenticated user role (or Guest role in older versions). Note that this will not conflict with other roles they have, it just ensures that all users have capabilities that are not assignable at the course level (eg post blog entries, manage own calendar, etc).';
$string['configdeleteunconfirmed'] = 'If you are using email authentication, this is the period within which a response will be accepted from users. After this period, old unconfirmed accounts are deleted.';
$string['configdenyemailaddresses'] = 'To deny email addresses from particular domains list them here in the same way. All other domains will be accepted. eg <strong>hotmail.com yahoo.co.uk</strong>';
$string['configdigestmailtime'] = 'People who choose to have emails sent to them in digest form will be emailed the digest daily. This setting controls which time of day the daily mail will be sent (the next cron that runs after this hour will send it).';
$string['assignstudentspass'] = 'All you may need to do is notify your students of the enrolment key for this course, which is currently set to: \'$a\'';
$string['assignteachers'] = 'Assign teachers';
$string['authentication'] = 'Authentication';
+$string['authenticateduser'] = 'Authenticated user';
+$string['authenticateduserdescription'] = 'All logged in users.';
$string['autosubscribe'] = 'Forum auto-subscribe';
$string['autosubscribeno'] = 'No: don\'t automatically subscribe me to forums';
$string['autosubscribeyes'] = 'Yes: when I post, subscribe me to that forum';
$string['legacy:guest'] = 'LEGACY ROLE: Guest';
$string['legacy:student'] = 'LEGACY ROLE: Student';
$string['legacy:teacher'] = 'LEGACY ROLE: Teacher (non-editing)';
+$string['legacy:user'] = 'LEGACY ROLE: Authenticated user';
$string['listallroles'] = 'List all roles';
$string['manageroles'] = 'Manage roles';
$string['metaassignerror'] = 'Can not assign this role to user \"$a\" because Manage metacourse capability is needed.';
addslashes(get_string('defaultcoursestudentdescription')), 'moodle/legacy:student');
$guestrole = create_role(addslashes(get_string('guest')), 'guest',
addslashes(get_string('guestdescription')), 'moodle/legacy:guest');
+ $userrole = create_role(addslashes(get_string('authenticateduser')), 'user',
+ addslashes(get_string('authenticateduserdescription')), 'moodle/legacy:user');
/// Now is the correct moment to install capabilities - after creation of legacy roles, but before assigning of roles
allow_override($adminrole, $editteacherrole);
allow_override($adminrole, $studentrole);
allow_override($adminrole, $guestrole);
+ allow_override($adminrole, $userrole);
/// Delete the old user tables when we are done
'contextlevel' => CONTEXT_SYSTEM
),
+ 'moodle/legacy:user' => array(
+
+ 'captype' => 'legacy',
+ 'contextlevel' => CONTEXT_SYSTEM
+ ),
'moodle/legacy:student' => array(
'contextlevel' => CONTEXT_SYSTEM,
'legacy' => array(
'guest' => CAP_ALLOW,
+ 'user' => CAP_ALLOW,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'legacy' => array(
- 'guest' => CAP_ALLOW, // needed for default role that allows everybody to post blog entries
- 'student' => CAP_ALLOW,
- 'teacher' => CAP_ALLOW,
- 'editingteacher' => CAP_ALLOW,
- 'coursecreator' => CAP_ALLOW,
+ 'user' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'legacy' => array(
- 'guest' => CAP_ALLOW, // needed for default role that allows everybody to add user entries
- 'student' => CAP_ALLOW,
- 'teacher' => CAP_ALLOW,
- 'editingteacher' => CAP_ALLOW,
- 'coursecreator' => CAP_ALLOW,
+ 'user' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
),
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
- $version = 2007012500; // YYYYMMDD = date
+ $version = 2007013100; // YYYYMMDD = date
// XY = increments within a single day
$release = '1.8 dev'; // Human-friendly version name