You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
574 B

  1. <?php
  2. /**
  3. * @file ajax.php
  4. * @brief Most ajax-requests call this file, it calls the specified function.
  5. */
  6. ?>
  7. <?php include "conf.php"; /* load a local configuration */ ?>
  8. <?php session_start(); ?>
  9. <?php include "modulekit/loader.php"; /* loads all php-includes */ ?>
  10. <?php
  11. call_hooks("ajax_start");
  12. function error($msg) {
  13. /// Do something with this error
  14. }
  15. Header("Content-Type: application/json; charset=UTF-8");
  16. $postdata = file_get_contents("php://input");
  17. $fun = "ajax_{$_REQUEST['__func']}";
  18. $return = $fun($_REQUEST, $postdata);
  19. print json_encode($return);