[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.

skala
Yannick Warnier 19 years ago
parent 0e9260f0c2
commit bb5cb81fe1
  1. 6
      main/inc/lib/main_api.lib.php

@ -144,16 +144,16 @@ define('PLATFORM_AUTH_SOURCE', 'platform');
* visibility and user status). * visibility and user status).
* *
* This is only the first proposal, test and improve! * 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 * @todo replace global variable
* @author Roan Embrechts * @author Roan Embrechts
*/ */
function api_protect_course_script() function api_protect_course_script($print_headers=false)
{ {
global $is_allowed_in_course; global $is_allowed_in_course;
if (!isset ($_SESSION["_course"]) || !$is_allowed_in_course) if (!isset ($_SESSION["_course"]) || !$is_allowed_in_course)
{ {
api_not_allowed(); api_not_allowed($print_headers);
} }
} }

Loading…
Cancel
Save