Updated copyright year.
[mailer.git] / ajax.php
index 8ef804fb8f6e2cf56ae54b11781e5833d1f611c2..7ebbaae429ac3f78588e44685f8b2279afec684b 100644 (file)
--- a/ajax.php
+++ b/ajax.php
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : AJAX-Abfragescript                               *
  * -------------------------------------------------------------------- *
- * $Revision::                                                        $ *
- * $Date::                                                            $ *
- * $Tag:: 0.2.1-FINAL                                                 $ *
- * $Author::                                                          $ *
- * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -42,7 +37,7 @@
 require('inc/libs/security_functions.php');
 
 // Init start time
-$GLOBALS['__start_time'] = microtime(true);
+$GLOBALS['__start_time'] = microtime(TRUE);
 
 /*
  * Set output to "AJAX mode", proper module and prevent HTML headers/footers
@@ -63,19 +58,19 @@ loadIncludeOnce('inc/ajax-functions.php');
 initAjax();
 
 // Load header here
-loadIncludeOnce('inc/header.php');
+loadPageHeader();
 
 // Process only POST requests and that at least 'level' is set
 if ((getHttpRequestMethod() == 'POST') && (isPostRequestElementSet('level'))) {
        // Okay, that is valid, now check that the requested level right is valid
-       if (isAjaxRequestLevelValid()) {
+       if (isValidAjaxRequestLevel()) {
                // Process the request
                processAjaxRequest();
 
-               // Do we have an error? ('200 OK' is fine)
-               if ((getHttpStatus() != '200 OK') && (getHttpStatus() != '404 NOT FOUND')) {
+               // Is there an error which is not fine?
+               if (!isAjaxHttpStatusAccepted()) {
                        // The process was handled but didn't work
-                       reportBug(__FUNCTION__, __LINE__, 'AJAX request is valid but does not do anything.');
+                       reportBug(__FUNCTION__, __LINE__, 'AJAX request level=' . isPostRequestElementSet('level') . ',status=' . getHttpStatus() . ',callback[' . gettype($GLOBALS['ajax_callback_function']) . ']=' . $GLOBALS['ajax_callback_function'] . ' is valid but does not do anything.');
                } // END - if
        } else {
                // Not allowed
@@ -84,7 +79,7 @@ if ((getHttpRequestMethod() == 'POST') && (isPostRequestElementSet('level'))) {
 } // END - if
 
 // Footer
-loadIncludeOnce('inc/footer.php');
+loadPageFooter();
 
 // [EOF]
 ?>