Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-35216 My Moodle - Admin setting for controlling guest access to …

…my moodle
  • Loading branch information...
commit 110831ceaade1541405ba1dce5e16fe801d9559d 1 parent 2f6073c
Itamar Tzadok itamart authored danpoltawski committed
1  admin/settings/appearance.php
@@ -97,6 +97,7 @@
97 97 HOMEPAGE_USER => new lang_string('userpreference', 'admin')
98 98 );
99 99 $temp->add(new admin_setting_configselect('defaulthomepage', new lang_string('defaulthomepage', 'admin'), new lang_string('configdefaulthomepage', 'admin'), HOMEPAGE_SITE, $choices));
  100 + $temp->add(new admin_setting_configcheckbox('allowguestmymoodle', new lang_string('allowguestmymoodle', 'admin'), new lang_string('configallowguestmymoodle', 'admin'), 1));
100 101 $temp->add(new admin_setting_configcheckbox('navshowcategories', new lang_string('navshowcategories', 'admin'), new lang_string('confignavshowcategories', 'admin'), 1));
101 102 $temp->add(new admin_setting_configcheckbox('navshowmycoursecategories', new lang_string('navshowmycoursecategories', 'admin'), new lang_string('navshowmycoursecategories_help', 'admin'), 0));
102 103 $temp->add(new admin_setting_configcheckbox('navshowallcourses', new lang_string('navshowallcourses', 'admin'), new lang_string('confignavshowallcourses', 'admin'), 0));
2  lang/en/admin.php
@@ -49,6 +49,7 @@
49 49 $string['allowemailaddresses'] = 'Allowed email domains';
50 50 $string['allowframembedding'] = 'Allow frame embedding';
51 51 $string['allowframembedding_help'] = 'Allow embedding of this site in frames on external sites. Enabling of this feature is not recommended for security reasons.';
  52 +$string['allowguestmymoodle'] = 'Allow guest access to My Moodle';
52 53 $string['allowobjectembed'] = 'Allow EMBED and OBJECT tags';
53 54 $string['allowthemechangeonurl'] = 'Allow theme changes in the URL';
54 55 $string['allowuserblockhiding'] = 'Allow users to hide blocks';
@@ -123,6 +124,7 @@
123 124 $string['configallowcategorythemes'] = 'If you enable this, then themes can be set at the category level. This will affect all child categories and courses unless they have specifically set their own theme. WARNING: Enabling category themes may affect performance.';
124 125 $string['configallowcoursethemes'] = 'If you enable this, then courses will be allowed to set their own themes. Course themes override all other theme choices (site, user, or session themes)';
125 126 $string['configallowemailaddresses'] = 'If you want to restrict all new email addresses to particular domains, then list them here separated by spaces. All other domains will be rejected. To allow subdomains add the domain with a preceding \'.\'. eg <strong>ourcollege.edu.au .gov.au</strong>';
  127 +$string['configallowguestmymoodle'] = 'If enabled guests can access My Moodle, otherwise guests are redirected to the site front page.';
126 128 $string['configallowobjectembed'] = 'As a default security measure, normal users are not allowed to embed multimedia (like Flash) within texts using explicit EMBED and OBJECT tags in their HTML (although it can still be done safely using the mediaplugins filter). If you wish to allow these tags then enable this option.';
127 129 $string['configallowoverride'] = 'You can allow people with the roles on the left side to override some of the column roles';
128 130 $string['configallowoverride2'] = 'Select which role(s) can be overridden by each role in the left column.<br />Note that these settings only apply to users who have either the capability moodle/role:override or the capability moodle/role:safeoverride allowed.';
5 my/index.php
@@ -48,6 +48,11 @@
48 48 $strmymoodle = get_string('myhome');
49 49
50 50 if (isguestuser()) { // Force them to see system default, no editing allowed
  51 + // If guests are not allowed my moodle, send them to front page.
  52 + if (empty($CFG->allowguestmymoodle)) {
  53 + redirect(new moodle_url('/', array('redirect' => 0)));
  54 + }
  55 +
51 56 $userid = NULL;
52 57 $USER->editing = $edit = 0; // Just in case
53 58 $context = context_system::instance();

0 comments on commit 110831c

Please sign in to comment.
Something went wrong with that request. Please try again.