### Eclipse Workspace Patch 1.0
#P 19stable
Index: user/view.php
===================================================================
RCS file: /cvsroot/moodle/moodle/user/view.php,v
retrieving revision 1.168.2.30
diff -u -r1.168.2.30 view.php
--- user/view.php	18 Mar 2010 22:54:28 -0000	1.168.2.30
+++ user/view.php	22 May 2010 07:39:41 -0000
@@ -332,7 +332,12 @@
 
 
     if (!isset($hiddenfields['mycourses'])) {
-        if ($mycourses = get_my_courses($user->id, 'visible DESC,sortorder ASC', null, false, 21)) {
+        $courses_limit=21;
+    	if (isset($CFG->mycoursesperpage)) {
+        	$courses_limit = $CFG->mycoursesperpage;
+    	}
+        
+        if ($mycourses = get_my_courses($user->id, 'visible DESC,sortorder ASC', null, false, $courses_limit)) {
             $shown=0;
             $courselisting = '';
             foreach ($mycourses as $mycourse) {
@@ -353,7 +358,7 @@
                     }
                 }
                 $shown++;
-                if($shown==20) {
+                if($shown==$courses_limit-1) {
                     $courselisting.= "...";
                     break;
                 }
