Index: lang/en_utf8/moodle.php
===================================================================
--- lang/en_utf8/moodle.php	(revision 26)
+++ lang/en_utf8/moodle.php	(revision 27)
@@ -1190,6 +1190,7 @@
 $string['previoussection'] = 'Previous section';
 $string['primaryadminsetup'] = 'Setup administrator account';
 $string['profile'] = 'Profile';
+$string['profilecourses'] = 'Show my courses on my profile page';
 $string['publicdirectory'] = 'Public directory';
 $string['publicdirectory0'] = 'Please do not publish this site';
 $string['publicdirectory1'] = 'Publish the site name only';
Index: user/view.php
===================================================================
--- user/view.php	(revision 26)
+++ user/view.php	(revision 27)
@@ -321,8 +321,7 @@
     /// Print the Custom User Fields
     profile_display_fields($user->id);
 
-
-    if ($mycourses = get_my_courses($user->id, null, null, false, 21)) {
+    if ($user->profilecourses && $mycourses = get_my_courses($user->id, null, null, false, 21)) {
         $shown=0;
         $courselisting = '';
         foreach ($mycourses as $mycourse) {
Index: user/editlib.php
===================================================================
--- user/editlib.php	(revision 26)
+++ user/editlib.php	(revision 27)
@@ -91,6 +91,12 @@
     $mform->setDefault('maildisplay', 2);
 
     $choices = array();
+    $choices[0] = get_string('no');
+    $choices[1] = get_string('yes');
+    $mform->addElement('select', 'profilecourses', get_string('profilecourses'), $choices);
+    $mform->setDefault('profilecourses', 0);
+
+    $choices = array();
     $choices['0'] = get_string('emailenable');
     $choices['1'] = get_string('emaildisable');
     $mform->addElement('select', 'emailstop', get_string('emailactive'), $choices);
