Automatic installer.php lang files by installer_builder (20070726)
[moodle-linuxchix.git] / admin / settings / users.php
blob97094d18fd3bf336da425a3dd52807063eb00dee
1 <?php // $Id$
3 // This file defines settingpages and externalpages under the "users" category
6 $ADMIN->add('users', new admin_externalpage('userauthentication', get_string('authentication','admin'), "$CFG->wwwroot/$CFG->admin/auth.php"));
9 if(empty($CFG->loginhttps)) {
10 $securewwwroot = $CFG->wwwroot;
11 } else {
12 $securewwwroot = str_replace('http:','https:',$CFG->wwwroot);
14 // stuff under the "accounts" subcategory
15 $ADMIN->add('users', new admin_category('accounts', get_string('accounts', 'admin')));
16 $ADMIN->add('accounts', new admin_externalpage('editusers', get_string('userlist','admin'), "$CFG->wwwroot/$CFG->admin/user.php", array('moodle/user:update', 'moodle/user:delete')));
17 $ADMIN->add('accounts', new admin_externalpage('addnewuser', get_string('addnewuser'), "$securewwwroot/user/editadvanced.php?id=-1", 'moodle/user:create'));
18 $ADMIN->add('accounts', new admin_externalpage('uploadusers', get_string('uploadusers'), "$CFG->wwwroot/$CFG->admin/uploaduser.php", 'moodle/site:uploadusers'));
19 $ADMIN->add('accounts', new admin_externalpage('profilefields', get_string('profilefields','admin'), "$CFG->wwwroot/user/profile/index.php", 'moodle/site:config'));
22 // stuff under the "roles" subcategory
23 $ADMIN->add('users', new admin_category('roles', get_string('permissions', 'role')));
24 $ADMIN->add('roles', new admin_externalpage('defineroles', get_string('defineroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/manage.php"));
25 $sitecontext = get_context_instance(CONTEXT_SYSTEM);
26 $ADMIN->add('roles', new admin_externalpage('assignroles', get_string('assignglobalroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=" . $sitecontext->id));
29 // "userpolicies" settingpage
30 $temp = new admin_settingpage('userpolicies', get_string('userpolicies', 'admin'));
32 $context = get_context_instance(CONTEXT_SYSTEM);
33 if (!$guestrole = get_guest_role()) {
34 $guestrole->id = 0;
36 if ($studentroles = get_roles_with_capability('moodle/legacy:student', CAP_ALLOW)) {
37 $studentrole = array_shift($studentroles); /// Take the first one
38 } else {
39 $studentrole->id = 0;
41 if ($userroles = get_roles_with_capability('moodle/legacy:user', CAP_ALLOW)) {
42 $userrole = array_shift($userroles); /// Take the first one
43 } else {
44 $userrole->id = 0;
46 if (empty($CFG->creatornewroleid)) {
47 if ($teacherroles = get_roles_with_capability('moodle/legacy:editingteacher', CAP_ALLOW, $context)) {
48 $teachereditrole = array_shift($teacherroles);
49 set_config('creatornewroleid', $teachereditrole->id);
50 } else {
51 set_config('creatornewroleid', 0);
54 // we must not use assignable roles here:
55 // 1/ unsetting roles as assignable for admin might bork the settings!
56 // 2/ default user role should not be assignable anyway
57 $allroles = array();
58 if ($roles = get_all_roles()) {
59 foreach ($roles as $role) {
60 $allroles[$role->id] = strip_tags(format_string($role->name, true));
64 $temp->add(new admin_setting_configselect('notloggedinroleid', get_string('notloggedinroleid', 'admin'),
65 get_string('confignotloggedinroleid', 'admin'), $guestrole->id, $allroles ));
66 $temp->add(new admin_setting_configselect('guestroleid', get_string('guestroleid', 'admin'),
67 get_string('configguestroleid', 'admin'), $guestrole->id, $allroles));
68 $temp->add(new admin_setting_configselect('defaultuserroleid', get_string('defaultuserroleid', 'admin'),
69 get_string('configdefaultuserroleid', 'admin'), $userrole->id, $allroles));
71 $temp->add(new admin_setting_configcheckbox('nodefaultuserrolelists', get_string('nodefaultuserrolelists', 'admin'), get_string('confignodefaultuserrolelists', 'admin'), 0));
73 $temp->add(new admin_setting_configselect('defaultcourseroleid', get_string('defaultcourseroleid', 'admin'),
74 get_string('configdefaultcourseroleid', 'admin'), $studentrole->id, $allroles));
75 $temp->add(new admin_setting_configselect('creatornewroleid', get_string('creatornewroleid', 'admin'),
76 get_string('configcreatornewroleid', 'admin'), $CFG->creatornewroleid, $allroles));
78 $temp->add(new admin_setting_configcheckbox('autologinguests', get_string('autologinguests', 'admin'), get_string('configautologinguests', 'admin'), 0));
80 $temp->add(new admin_setting_configmultiselect('nonmetacoursesyncroleids', get_string('nonmetacoursesyncroleids', 'admin'),
81 get_string('confignonmetacoursesyncroleids', 'admin'), array(), $allroles));
83 //$temp->add(new admin_setting_configcheckbox('allusersaresitestudents', get_string('allusersaresitestudents', 'admin'), get_string('configallusersaresitestudents','admin'), 1));
84 $temp->add(new admin_setting_configmultiselect('hiddenuserfields', get_string('hiddenuserfields', 'admin'),
85 get_string('confighiddenuserfields', 'admin'), array(),
86 array('none' => get_string('none'),
87 'description' => get_string('description'),
88 'city' => get_string('city'),
89 'country' => get_string('country'),
90 'webpage' => get_string('webpage'),
91 'icqnumber' => get_string('icqnumber'),
92 'skypeid' => get_string('skypeid'),
93 'yahooid' => get_string('yahooid'),
94 'aimid' => get_string('aimid'),
95 'msnid' => get_string('msnid'),
96 'lastaccess' => get_string('lastaccess'))));
97 //$temp->add(new admin_setting_special_adminseesall());
100 $ADMIN->add('roles', $temp);