Commit aac74bcc authored by William Paul Liggett's avatar William Paul Liggett

Fixed an error reporting glitch when trying to directly access PHP pages intended for Ajax.

parent e37b748d
......@@ -15,14 +15,15 @@
// Maintains the authenticated user session across different admin pages.
// Ensures only valid administrators can do anything.
session_start();
// Function: output_json_response($successful, $error_message)
require_once "output_json_response.php";
if(!isset($_SESSION['ov_admin_user'])) {
output_json_response(false, "Not logged on as an administrator.");
return;
}
// Function: output_json_response($successful, $error_message)
require_once "output_json_response.php";
// -------------------------------------------------------------------------------
// POST input variables sent by the web browser.
// Note: The login_code cannot be set by an OV admin. The code is auto-generated.
......
......@@ -16,14 +16,15 @@
// Maintains the authenticated user session across different admin pages.
// Ensures only valid administrators can do anything.
session_start();
// Function: output_json_response($successful, $error_message)
require_once "output_json_response.php";
if(!isset($_SESSION['ov_admin_user'])) {
output_json_response(false, "Not logged on as an administrator.");
return;
}
// Function: output_json_response($successful, $error_message)
require_once "output_json_response.php";
// ------------------------------------------------------------------------------------
// POST input variables sent by the web browser.
// Note: The login_code cannot be modified by an OV admin. The code is auto-generated.
......
......@@ -12,19 +12,18 @@
* Output: JSON array as defined in ``output_json_response.php''.
* -------------------------------------------------------------------------------------------------------------- */
error_reporting(E_ALL);
// Maintains the authenticated user session across different admin pages.
// Ensures only valid administrators can do anything.
session_start();
// Function: output_json_response($successful, $error_message)
require_once "output_json_response.php";
if(!isset($_SESSION['ov_admin_user'])) {
output_json_response(false, "Not logged on as an administrator.");
return;
}
// Function: output_json_response($successful, $error_message)
require_once "output_json_response.php";
// -------------------------------------------------------------------------------
// POST input variables sent by the web browser.
// Note: The login_code cannot be set by an OV admin. The code is auto-generated.
......@@ -71,9 +70,9 @@ if($successful_deletion) {
else {
// Extra Data
$extra_data1 = 'sk = ' . strval($sk) .', subject_id = ' . strval($subject_id) .', test_condition = ' . strval($test_condition) . ', login_code = ' . strval($login_code);
//$extra_data1 = 'sk = ' . strval($sk) .', subject_id = ' . strval($subject_id) .', test_condition = ' . strval($test_condition) . ', login_code = ' . strval($login_code);
// The database was not properly updated for some reason.
output_json_response(false, "The database could not be updated at this time for some reason.", $extra_data1);
output_json_response(false, "The database could not be updated at this time for some reason.");
return;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment