From aef709f1ae76e57eff2c087ea305c2d353793f02 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 7 Mar 2013 15:32:10 +0100 Subject: [PATCH] If not category code is available return all courses see BT#5944 --- main/inc/lib/auth.lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main/inc/lib/auth.lib.php b/main/inc/lib/auth.lib.php index 9f95afb5d0..4ffe6316b6 100644 --- a/main/inc/lib/auth.lib.php +++ b/main/inc/lib/auth.lib.php @@ -500,7 +500,11 @@ class Auth { $sql = "SELECT * FROM $tbl_course WHERE id IN($id_in)"; } else { $category_code = Database::escape_string($category_code); - $sql = "SELECT * FROM $tbl_course WHERE category_code='$category_code' $without_special_courses ORDER BY title "; + if (empty($category_code)) { + $sql = "SELECT * FROM $tbl_course WHERE 1=1 $without_special_courses ORDER BY title "; + } else { + $sql = "SELECT * FROM $tbl_course WHERE category_code='$category_code' $without_special_courses ORDER BY title "; + } //showing only the courses of the current Chamilo access_url_id if ($_configuration['multiple_access_urls']) {