Browse Source

Fixing create course button see #5588

Yoselyn Castillo 12 years ago
parent
commit
38fe26b53d
1 changed files with 8 additions and 2 deletions
  1. 8 2
      main/inc/lib/userportal.lib.php

+ 8 - 2
main/inc/lib/userportal.lib.php

@@ -804,7 +804,13 @@ class IndexManager {
 		$show_create_link = false;
 		$show_course_link = false;
 				
-		$display_add_course_link = api_is_allowed_to_create_course() && ($_SESSION['studentview'] != 'studentenview');
+		if ((api_get_setting('allow_users_to_create_courses') == 'false' && !api_is_platform_admin()) || api_is_student()) {
+            $display_add_course_link = false;
+        } else {
+            $display_add_course_link = true;
+        }
+        //$display_add_course_link = api_is_allowed_to_create_course() && ($_SESSION['studentview'] != 'studentenview');
+        
 		if ($display_add_course_link) {
 			$show_create_link = true;
 		}
@@ -1099,4 +1105,4 @@ class IndexManager {
 	function return_hot_courses() {
 		return CourseManager::return_hot_courses();		
 	}
-}
+}