summaryrefslogtreecommitdiffstats
path: root/examples/server/server.php
diff options
context:
space:
mode:
Diffstat (limited to 'examples/server/server.php')
-rw-r--r--examples/server/server.php36
1 files changed, 27 insertions, 9 deletions
diff --git a/examples/server/server.php b/examples/server/server.php
index b7d4219..95f2ba6 100644
--- a/examples/server/server.php
+++ b/examples/server/server.php
@@ -1,18 +1,36 @@
<?php
require_once 'config.php';
-require_once 'lib/session.php';
-require_once 'lib/actions.php';
-init();
+if ($server_url) {
+ require_once 'lib/session.php';
+ require_once 'lib/actions.php';
-$action = getAction();
-if (!function_exists($action)) {
- $action = 'action_default';
-}
+ init();
-$resp = $action();
+ $action = getAction();
+ if (!function_exists($action)) {
+ $action = 'action_default';
+ }
-writeResponse($resp);
+ $resp = $action();
+ writeResponse($resp);
+} else {
+?>
+<html>
+ <head>
+ <title>PHP OpenID Server</title>
+ <body>
+ <h1>PHP OpenID Server</h1>
+ <p>
+ This server needs to be configured before it can be used. Edit
+ <code>config.php</code> to reflect your server's setup, then
+ load this page again.
+ </p>
+ </body>
+ </head>
+</html>
+<?php
+}
?> \ No newline at end of file