summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2006-03-01 21:41:13 +0000
committertailor <cygnus@janrain.com>2006-03-01 21:41:13 +0000
commit0e69837b1afeb4fe0a1a81f0ece517e6df0a225e (patch)
tree8d3330b6c7b4bd452382079f6b299cce181485f1
parent2a42bd06486a01a5c017d0f27e9bd706a5447589 (diff)
downloadphp-openid-0e69837b1afeb4fe0a1a81f0ece517e6df0a225e.zip
php-openid-0e69837b1afeb4fe0a1a81f0ece517e6df0a225e.tar.gz
php-openid-0e69837b1afeb4fe0a1a81f0ece517e6df0a225e.tar.bz2
[project @ Removed config.php from server example and updated server to redirect to setup if config.php is absent]
-rw-r--r--examples/server/config.php74
-rw-r--r--examples/server/server.php6
-rw-r--r--examples/server/setup.php5
3 files changed, 8 insertions, 77 deletions
diff --git a/examples/server/config.php b/examples/server/config.php
deleted file mode 100644
index 28f06ce..0000000
--- a/examples/server/config.php
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-/**
- * OpenID server example settings
- *
- * The variables in this file must be customized before you can use
- * the server.
- *
- * @package OpenID.Examples
- * @author JanRain, Inc. <openid@janrain.com>
- * @copyright 2005 Janrain, Inc.
- * @license http://www.gnu.org/copyleft/lesser.html LGPL
- */
-
-/**
- * Set any extra include paths needed to use the library
- */
-//$path_extra = dirname(dirname(dirname(__FILE__)));
-//$path = ini_get('include_path');
-//$path = $path_extra . ':' . $path;
-//ini_set('include_path', $path);
-
-/**
- * The URL for the server.
- *
- * This is the location of server.php. For example:
- *
- * $server_url = 'http://example.com/~user/server.php';
- *
- * This must be a full URL.
- */
-$server_url = false;
-
-/**
- * Initialize an OpenID store
- *
- * @return object $store an instance of OpenID store (see the
- * documentation for how to create one)
- */
-function getOpenIDStore()
-{
- // Example for using a FileStore:
- //
- // require_once "Auth/OpenID/FileStore.php";
- // return new Auth_OpenID_FileStore("/tmp/_server_test_store");
- return false;
-}
-
-/**
- * Users who are allowed to log in to this OpenID server.
- *
- * This is an array from URL to password hash. The URL must include
- * the proper OpenID server information in order to work with this
- * server.
- *
- * This must be set for the server to be usable. If it is not set, no
- * users will be able to log in.
- *
- * Example:
- * $openid_users = array(
- * 'http://joe.example.com/' => sha1('foo')
- * )
- */
-$openid_users = false;
-
-/**
- * Trusted sites is an array of trust roots.
- *
- * Sites in this list will not have to be approved by the user in
- * order to be used. It is OK to leave this value as-is.
- *
- * In a more robust server, this site should be a per-user setting.
- */
-$trusted_sites = array();
-?> \ No newline at end of file
diff --git a/examples/server/server.php b/examples/server/server.php
index cab01f1..aa0e7ef 100644
--- a/examples/server/server.php
+++ b/examples/server/server.php
@@ -1,6 +1,10 @@
<?php
-require_once 'config.php';
+$try_include = @include 'config.php';
+
+if (!$try_include) {
+ header("Location: setup.php");
+}
if (function_exists('getOpenIDStore') && isset($openid_users)) {
require_once 'lib/session.php';
diff --git a/examples/server/setup.php b/examples/server/setup.php
index 6dbc3ae..818cad7 100644
--- a/examples/server/setup.php
+++ b/examples/server/setup.php
@@ -260,8 +260,9 @@ if ($messages) {
?>
<p>
-This form will auto-generate an OpenID example server configuration
-for use with the OpenID server example.
+Your browser has been redirected to this page so you can configure the
+server example. This form will auto-generate an OpenID example server
+configuration for use with the OpenID server example.
</p>
<form>