mirror of
https://github.com/moodle/moodle.git
synced 2025-02-22 19:06:51 +01:00
people who enrol in the course. $course->defaultrole defines the value for each course for what role should be used in the same case. Naturally it defaults to the site config (when it is zero). This role is retained even when the person editing the course settings doesn't actually have that role in their list of assignable rights (however they are prevented from actually switching to any such role themselves). Note that enrol plugins are free to ignore these values and use whatever roles they like. Generally, though, they should respect these settings.
65 lines
3.5 KiB
PHP
65 lines
3.5 KiB
PHP
<?php // $Id$
|
|
|
|
// This file defines settingpages and externalpages under the "users" category
|
|
|
|
|
|
$ADMIN->add('users', new admin_externalpage('userauthentication', get_string('authentication','admin'), "$CFG->wwwroot/$CFG->admin/auth.php"));
|
|
|
|
|
|
// stuff under the "accounts" subcategory
|
|
$ADMIN->add('users', new admin_category('accounts', get_string('accounts', 'admin')));
|
|
$ADMIN->add('accounts', new admin_externalpage('editusers', get_string('userlist','admin'), "$CFG->wwwroot/$CFG->admin/user.php"));
|
|
$ADMIN->add('accounts', new admin_externalpage('addnewuser', get_string('addnewuser'), "$CFG->wwwroot/$CFG->admin/user.php?newuser=true"));
|
|
$ADMIN->add('accounts', new admin_externalpage('uploadusers', get_string('uploadusers'), "$CFG->wwwroot/$CFG->admin/uploaduser.php"));
|
|
|
|
|
|
// stuff under the "roles" subcategory
|
|
$ADMIN->add('users', new admin_category('roles', get_string('permissions', 'role')));
|
|
$ADMIN->add('roles', new admin_externalpage('defineroles', get_string('defineroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/manage.php"));
|
|
$ADMIN->add('roles', new admin_externalpage('assignroles', get_string('assignroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=" . SITEID));
|
|
|
|
|
|
// "userpolicies" settingpage
|
|
$temp = new admin_settingpage('userpolicies', get_string('userpolicies', 'admin'));
|
|
|
|
$context = get_context_instance(CONTEXT_SYSTEM, SITEID);
|
|
if (!$guestrole = get_guest_role()) {
|
|
$guestrole->id = 0;
|
|
}
|
|
if ($studentroles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW)) {
|
|
$studentrole = array_shift($studentroles); /// Take the first one
|
|
} else {
|
|
$studentrole->id = 0;
|
|
}
|
|
$assignableroles = get_assignable_roles($context);
|
|
|
|
$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));
|
|
$temp->add(new admin_setting_configselect('defaultcourseroleid', get_string('defaultcourseroleid', 'admin'),
|
|
get_string('configdefaultcourseroleid', 'admin'), $studentrole->id, $assignableroles));
|
|
|
|
//$temp->add(new admin_setting_configcheckbox('autologinguests', get_string('autologinguests', 'admin'), get_string('configautologinguests', 'admin'), 0));
|
|
//$temp->add(new admin_setting_configcheckbox('allusersaresitestudents', get_string('allusersaresitestudents', 'admin'), get_string('configallusersaresitestudents','admin'), 1));
|
|
$temp->add(new admin_setting_configmultiselect('hiddenuserfields', get_string('hiddenuserfields', 'admin'),
|
|
get_string('confighiddenuserfields', 'admin'), array(),
|
|
array('none' => get_string('none'),
|
|
'description' => get_string('description'),
|
|
'city' => get_string('city'),
|
|
'country' => get_string('country'),
|
|
'webpage' => get_string('webpage'),
|
|
'icqnumber' => get_string('icqnumber'),
|
|
'skypeid' => get_string('skypeid'),
|
|
'yahooid' => get_string('yahooid'),
|
|
'aimid' => get_string('aimid'),
|
|
'msnid' => get_string('msnid'),
|
|
'lastaccess' => get_string('lastaccess'))));
|
|
//$temp->add(new admin_setting_special_adminseesall());
|
|
|
|
|
|
$ADMIN->add('roles', $temp);
|
|
|
|
|
|
?>
|