MDL-8096 - user edit form splitting, refactoring, cleanup and fixing - work in progre...
[moodle.git] / admin / settings / users.php
CommitLineData
50999a0b 1<?php // $Id$
2
3// This file defines settingpages and externalpages under the "users" category
4
50999a0b 5
bee4702d 6$ADMIN->add('users', new admin_externalpage('userauthentication', get_string('authentication','admin'), "$CFG->wwwroot/$CFG->admin/auth.php"));
50999a0b 7
69833712 8
9// stuff under the "accounts" subcategory
10$ADMIN->add('users', new admin_category('accounts', get_string('accounts', 'admin')));
38d2d43b 11$ADMIN->add('accounts', new admin_externalpage('editusers', get_string('userlist','admin'), "$CFG->wwwroot/$CFG->admin/user.php", array('moodle/user:update', 'moodle/user:delete')));
ad6226fb 12$ADMIN->add('accounts', new admin_externalpage('addnewuser', get_string('addnewuser'), "$CFG->wwwroot/user/editadvanced.php?id=-1", 'moodle/user:create'));
6df3c7df 13$ADMIN->add('accounts', new admin_externalpage('uploadusers', get_string('uploadusers'), "$CFG->wwwroot/$CFG->admin/uploaduser.php", 'moodle/site:uploadusers'));
841f143d 14$ADMIN->add('accounts', new admin_externalpage('profilefields', get_string('profilefields','admin'), "$CFG->wwwroot/user/profile/index.php", 'moodle/user:update'));
69833712 15
16
17// stuff under the "roles" subcategory
18$ADMIN->add('users', new admin_category('roles', get_string('permissions', 'role')));
19$ADMIN->add('roles', new admin_externalpage('defineroles', get_string('defineroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/manage.php"));
e4814bbc 20$sitecontext = get_context_instance(CONTEXT_SYSTEM);
21$ADMIN->add('roles', new admin_externalpage('assignroles', get_string('assignroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=" . $sitecontext->id));
69833712 22
23
8f8ed475 24// "userpolicies" settingpage
25$temp = new admin_settingpage('userpolicies', get_string('userpolicies', 'admin'));
8f8ed475 26
27$context = get_context_instance(CONTEXT_SYSTEM, SITEID);
28if (!$guestrole = get_guest_role()) {
88af238c 29 $guestrole->id = 0;
8f8ed475 30}
88af238c 31if ($studentroles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW)) {
32 $studentrole = array_shift($studentroles); /// Take the first one
33} else {
34 $studentrole->id = 0;
35}
36$assignableroles = get_assignable_roles($context);
37
eef868d1 38$temp->add(new admin_setting_configselect('notloggedinroleid', get_string('notloggedinroleid', 'admin'),
88af238c 39 get_string('confignotloggedinroleid', 'admin'), $guestrole->id, $assignableroles ));
eef868d1 40$temp->add(new admin_setting_configselect('defaultuserroleid', get_string('defaultuserroleid', 'admin'),
88af238c 41 get_string('configdefaultuserroleid', 'admin'), $guestrole->id, $assignableroles));
eef868d1 42$temp->add(new admin_setting_configselect('defaultcourseroleid', get_string('defaultcourseroleid', 'admin'),
88af238c 43 get_string('configdefaultcourseroleid', 'admin'), $studentrole->id, $assignableroles));
8f8ed475 44
8e00b731 45$temp->add(new admin_setting_configcheckbox('autologinguests', get_string('autologinguests', 'admin'), get_string('configautologinguests', 'admin'), 0));
b3170072 46
47$temp->add(new admin_setting_configmultiselect('nonmetacoursesyncroleids', get_string('nonmetacoursesyncroleids', 'admin'),
6b65a111 48 get_string('confignonmetacoursesyncroleids', 'admin'), array(), $assignableroles));
b3170072 49
10e17638 50//$temp->add(new admin_setting_configcheckbox('allusersaresitestudents', get_string('allusersaresitestudents', 'admin'), get_string('configallusersaresitestudents','admin'), 1));
eef868d1 51$temp->add(new admin_setting_configmultiselect('hiddenuserfields', get_string('hiddenuserfields', 'admin'),
52 get_string('confighiddenuserfields', 'admin'), array(),
10e17638 53 array('none' => get_string('none'),
54 'description' => get_string('description'),
55 'city' => get_string('city'),
56 'country' => get_string('country'),
57 'webpage' => get_string('webpage'),
58 'icqnumber' => get_string('icqnumber'),
59 'skypeid' => get_string('skypeid'),
60 'yahooid' => get_string('yahooid'),
61 'aimid' => get_string('aimid'),
62 'msnid' => get_string('msnid'),
63 'lastaccess' => get_string('lastaccess'))));
64//$temp->add(new admin_setting_special_adminseesall());
65
66
69833712 67$ADMIN->add('roles', $temp);
8f8ed475 68
69
bee4702d 70?>