server.php 956 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. $path_extra = dirname(dirname(dirname(__FILE__)));
  3. $path = ini_get('include_path');
  4. $path = $path_extra . PATH_SEPARATOR . $path;
  5. ini_set('include_path', $path);
  6. $try_include = @include 'config.php';
  7. if (!$try_include) {
  8. header("Location: setup.php");
  9. }
  10. header('Cache-Control: no-cache');
  11. header('Pragma: no-cache');
  12. if (function_exists('getOpenIDStore')) {
  13. require_once 'lib/session.php';
  14. require_once 'lib/actions.php';
  15. init();
  16. $action = getAction();
  17. if (!function_exists($action)) {
  18. $action = 'action_default';
  19. }
  20. $resp = $action();
  21. writeResponse($resp);
  22. } else {
  23. ?>
  24. <html>
  25. <head>
  26. <title>PHP OpenID Server</title>
  27. <body>
  28. <h1>PHP OpenID Server</h1>
  29. <p>
  30. This server needs to be configured before it can be used. Edit
  31. <code>config.php</code> to reflect your server's setup, then
  32. load this page again.
  33. </p>
  34. </body>
  35. </head>
  36. </html>
  37. <?php
  38. }
  39. ?>