index.php 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. require_once('config.inc');
  3. require_once('common.inc');
  4. require_once('cross_domain.inc');
  5. require_once('plugins/'.$config['auth_method'].'.inc'); // configured module - it defines the 'MODULE_authenticate()' function
  6. if(call_user_func($config['auth_method'].'_authenticate')!==1)
  7. {
  8. // HTTP authentication (exit if unsuccessfull)
  9. if($config['auth_send_authenticate_header'])
  10. header('WWW-Authenticate: Basic realm="Inf-IT Auth Module"');
  11. header('HTTP/1.0 401 Unauthorized');
  12. echo <<<HTML
  13. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  14. <html>
  15. <head>
  16. <title>401 Authorization Required</title>
  17. </head>
  18. <body>
  19. <h1>Authorization Required</h1>
  20. <p>This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.</p>
  21. </body>
  22. </html>
  23. HTML;
  24. exit(0);
  25. }
  26. else
  27. {
  28. header('Content-type: text/xml; charset="utf-8"');
  29. header('Cache-Control: max-age=0, must-revalidate, no-cache, no-store, no-transform, private');
  30. echo array_to_xml($config['accounts']);
  31. }
  32. ?>