Browse Source

[svn r12489] Added optional param to api_protect_course_script() to print headers when calling api_not_allowed(). Defaults to false so that current scripts remain the same.

Yannick Warnier 18 years ago
parent
commit
bb5cb81fe1
1 changed files with 3 additions and 3 deletions
  1. 3 3
      main/inc/lib/main_api.lib.php

+ 3 - 3
main/inc/lib/main_api.lib.php

@@ -144,16 +144,16 @@ define('PLATFORM_AUTH_SOURCE', 'platform');
 * visibility and user status).
 *
 * This is only the first proposal, test and improve!
-*
+* @param	boolean	Option to print headers when displaying error message. Default: false
 * @todo replace global variable
 * @author Roan Embrechts
 */
-function api_protect_course_script()
+function api_protect_course_script($print_headers=false)
 {
 	global $is_allowed_in_course;
 	if (!isset ($_SESSION["_course"]) || !$is_allowed_in_course)
 	{
-		api_not_allowed();
+		api_not_allowed($print_headers);
 	}
 }