summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/consumer/common.php1
-rw-r--r--examples/consumer/finish_auth.php1
-rw-r--r--examples/consumer/index.php10
-rw-r--r--examples/consumer/try_auth.php1
-rw-r--r--examples/detect.php2
-rw-r--r--examples/discover.php28
-rw-r--r--examples/server/index.php1
-rw-r--r--examples/server/lib/actions.php1
-rw-r--r--examples/server/lib/common.php1
-rw-r--r--examples/server/lib/render.php1
-rw-r--r--examples/server/lib/render/about.php1
-rw-r--r--examples/server/lib/render/idpXrds.php3
-rw-r--r--examples/server/lib/render/idpage.php2
-rw-r--r--examples/server/lib/render/login.php1
-rw-r--r--examples/server/lib/render/trust.php1
-rw-r--r--examples/server/lib/render/userXrds.php3
-rw-r--r--examples/server/lib/session.php1
-rw-r--r--examples/server/server.php3
-rw-r--r--examples/server/setup.php92
19 files changed, 70 insertions, 84 deletions
diff --git a/examples/consumer/common.php b/examples/consumer/common.php
index 2f01ba0..446c6cc 100644
--- a/examples/consumer/common.php
+++ b/examples/consumer/common.php
@@ -94,4 +94,3 @@ function getTrustRoot() {
dirname($_SERVER['PHP_SELF']));
}
-?> \ No newline at end of file
diff --git a/examples/consumer/finish_auth.php b/examples/consumer/finish_auth.php
index b19a665..0e71b9d 100644
--- a/examples/consumer/finish_auth.php
+++ b/examples/consumer/finish_auth.php
@@ -95,4 +95,3 @@ function run() {
run();
-?> \ No newline at end of file
diff --git a/examples/consumer/index.php b/examples/consumer/index.php
index 343a39c..dd2f391 100644
--- a/examples/consumer/index.php
+++ b/examples/consumer/index.php
@@ -2,7 +2,7 @@
require_once "common.php";
global $pape_policy_uris;
-?>
+
<html>
<head><title>PHP OpenID Authentication Example</title></head>
<style type="text/css">
@@ -48,9 +48,9 @@ global $pape_policy_uris;
is your identity URL.
</p>
- <?php if (isset($msg)) { print "<div class=\"alert\">$msg</div>"; } ?>
- <?php if (isset($error)) { print "<div class=\"error\">$error</div>"; } ?>
- <?php if (isset($success)) { print "<div class=\"success\">$success</div>"; } ?>
+ <?php if (isset($msg)) { print "<div class=\"alert\">$msg</div>"; }
+ <?php if (isset($error)) { print "<div class=\"error\">$error</div>"; }
+ <?php if (isset($success)) { print "<div class=\"success\">$success</div>"; }
<div id="verify-form">
<form method="get" action="try_auth.php">
@@ -63,7 +63,7 @@ global $pape_policy_uris;
<?php foreach ($pape_policy_uris as $i => $uri) {
print "<input type=\"checkbox\" name=\"policies[]\" value=\"$uri\" />";
print "$uri<br/>";
- } ?>
+ }
</p>
<input type="submit" value="Verify" />
diff --git a/examples/consumer/try_auth.php b/examples/consumer/try_auth.php
index 7efec76..61d1828 100644
--- a/examples/consumer/try_auth.php
+++ b/examples/consumer/try_auth.php
@@ -80,4 +80,3 @@ function run() {
run();
-?> \ No newline at end of file
diff --git a/examples/detect.php b/examples/detect.php
index 2d06ae1..36b612f 100644
--- a/examples/detect.php
+++ b/examples/detect.php
@@ -514,4 +514,4 @@ if (!$_include) {
$out .= $body . $r->end();
print $out;
-?>
+
diff --git a/examples/discover.php b/examples/discover.php
index 31e6b61..4f21465 100644
--- a/examples/discover.php
+++ b/examples/discover.php
@@ -17,7 +17,7 @@ function escape($x)
$identifier = getOpenIDIdentifier();
-?>
+
<html>
<head>
<title>OpenID discovery</title>
@@ -38,40 +38,40 @@ if ($identifier) {
list($normalized_identifier, $endpoints) = Auth_OpenID_discover(
$identifier, $fetcher);
-?>
- <h3>Discovery Results for <?= escape($identifier) ?></h3>
+
+ <h3>Discovery Results for <?= escape($identifier) </h3>
<table cellpadding="7" cellspacing="0">
<tbody>
<tr>
<th>Claimed Identifier</th>
- <td><?= escape($normalized_identifier) ?></td>
+ <td><?= escape($normalized_identifier) </td>
</tr>
<?
if (!$endpoints) {
-?>
+
<tr>
<td colspan="2">No OpenID services discovered.</td>
</tr>
<?
} else {
-?>
+
<tr>
<td colspan="2">Discovered OpenID services:</td>
</tr>
<?
foreach ($endpoints as $endpoint) {
-?>
+
<tr>
<td colspan="2"><hr/></td>
</tr>
<tr>
<th>Server URL</th>
- <td><tt><?= escape($endpoint->server_url) ?></tt></td>
+ <td><tt><?= escape($endpoint->server_url) </tt></td>
</tr>
<tr>
<th>Local ID</th>
- <td><tt><?= escape($endpoint->local_id) ?></tt></td>
+ <td><tt><?= escape($endpoint->local_id) </tt></td>
</tr>
<tr>
<td colspan="2">
@@ -79,22 +79,22 @@ foreach ($endpoints as $endpoint) {
<ul>
<?
foreach ($endpoint->type_uris as $type_uri) {
-?>
- <li><tt><?= escape($type_uri) ?></tt></li>
+
+ <li><tt><?= escape($type_uri) </tt></li>
<?
}
-?>
+
</ul>
</td>
</tr>
<?
}
}
-?>
+
</tbody>
</table>
<?
}
-?>
+
</body>
</html> \ No newline at end of file
diff --git a/examples/server/index.php b/examples/server/index.php
index 7a95064..b42c5b3 100644
--- a/examples/server/index.php
+++ b/examples/server/index.php
@@ -2,4 +2,3 @@
header("Location: server.php");
-?> \ No newline at end of file
diff --git a/examples/server/lib/actions.php b/examples/server/lib/actions.php
index 50dc19a..9f825e3 100644
--- a/examples/server/lib/actions.php
+++ b/examples/server/lib/actions.php
@@ -161,4 +161,3 @@ function action_userXrds()
return userXrds_render($identity);
}
-?> \ No newline at end of file
diff --git a/examples/server/lib/common.php b/examples/server/lib/common.php
index 80d05f5..8b45da7 100644
--- a/examples/server/lib/common.php
+++ b/examples/server/lib/common.php
@@ -92,4 +92,3 @@ function doAuth($info, $trusted=null, $fail_cancels=false,
}
}
-?> \ No newline at end of file
diff --git a/examples/server/lib/render.php b/examples/server/lib/render.php
index 33d2aef..afa059d 100644
--- a/examples/server/lib/render.php
+++ b/examples/server/lib/render.php
@@ -111,4 +111,3 @@ function page_render($body, $user, $title, $h1=null, $login=false)
return array($headers, $text);
}
-?> \ No newline at end of file
diff --git a/examples/server/lib/render/about.php b/examples/server/lib/render/about.php
index bd35836..7e7cf1a 100644
--- a/examples/server/lib/render/about.php
+++ b/examples/server/lib/render/about.php
@@ -55,4 +55,3 @@ function about_render($error=false, $internal=true)
return page_render($body, $current_user, 'OpenID Server Endpoint');
}
-?> \ No newline at end of file
diff --git a/examples/server/lib/render/idpXrds.php b/examples/server/lib/render/idpXrds.php
index 6e4ae1c..6dde930 100644
--- a/examples/server/lib/render/idpXrds.php
+++ b/examples/server/lib/render/idpXrds.php
@@ -5,7 +5,7 @@ require_once "lib/render.php";
require_once "Auth/OpenID/Discover.php";
-define('idp_xrds_pat', '<?xml version="1.0" encoding="UTF-8"?>
+define('idp_xrds_pat', '<?xml version="1.0" encoding="UTF-8"
<xrds:XRDS
xmlns:xrds="xri://$xrds"
xmlns="xri://$xrd*($v*2.0)">
@@ -29,4 +29,3 @@ function idpXrds_render()
return array($headers, $body);
}
-?> \ No newline at end of file
diff --git a/examples/server/lib/render/idpage.php b/examples/server/lib/render/idpage.php
index 48c2486..a10f46d 100644
--- a/examples/server/lib/render/idpage.php
+++ b/examples/server/lib/render/idpage.php
@@ -28,4 +28,4 @@ function idpage_render($identity)
return array($headers, $body);
}
-?>
+
diff --git a/examples/server/lib/render/login.php b/examples/server/lib/render/login.php
index 986a885..8568648 100644
--- a/examples/server/lib/render/login.php
+++ b/examples/server/lib/render/login.php
@@ -62,4 +62,3 @@ function loginError_render($errors)
}
return sprintf("<ul class=\"error\">\n%s</ul>\n", $text);
}
-?> \ No newline at end of file
diff --git a/examples/server/lib/render/trust.php b/examples/server/lib/render/trust.php
index 681d456..5972e5d 100644
--- a/examples/server/lib/render/trust.php
+++ b/examples/server/lib/render/trust.php
@@ -53,4 +53,3 @@ function noIdentifier_render()
return page_render(no_id_pat, null, 'No Identifier Sent');
}
-?> \ No newline at end of file
diff --git a/examples/server/lib/render/userXrds.php b/examples/server/lib/render/userXrds.php
index a9ea95e..0f0239e 100644
--- a/examples/server/lib/render/userXrds.php
+++ b/examples/server/lib/render/userXrds.php
@@ -5,7 +5,7 @@ require_once "lib/render.php";
require_once "Auth/OpenID/Discover.php";
-define('user_xrds_pat', '<?xml version="1.0" encoding="UTF-8"?>
+define('user_xrds_pat', '<?xml version="1.0" encoding="UTF-8"
<xrds:XRDS
xmlns:xrds="xri://$xrds"
xmlns="xri://$xrd*($v*2.0)">
@@ -31,4 +31,3 @@ function userXrds_render($identity)
return array($headers, $body);
}
-?> \ No newline at end of file
diff --git a/examples/server/lib/session.php b/examples/server/lib/session.php
index 201b6ee..13b0ec9 100644
--- a/examples/server/lib/session.php
+++ b/examples/server/lib/session.php
@@ -175,4 +175,3 @@ function idFromURL($url)
return @$parts['user'];
}
-?> \ No newline at end of file
diff --git a/examples/server/server.php b/examples/server/server.php
index f054be8..cbb8288 100644
--- a/examples/server/server.php
+++ b/examples/server/server.php
@@ -29,7 +29,7 @@ if (function_exists('getOpenIDStore')) {
writeResponse($resp);
} else {
-?>
+
<html>
<head>
<title>PHP OpenID Server</title>
@@ -45,4 +45,3 @@ if (function_exists('getOpenIDStore')) {
</html>
<?php
}
-?> \ No newline at end of file
diff --git a/examples/server/setup.php b/examples/server/setup.php
index e25ef34..9ec35f8 100644
--- a/examples/server/setup.php
+++ b/examples/server/setup.php
@@ -192,7 +192,7 @@ function render_form() {
$pgsql_found = true;
}
-?>
+
<html>
<head>
<style type="text/css">
@@ -256,7 +256,7 @@ if ($messages) {
print "</div>";
}
-?>
+
<p>
Your browser has been redirected to this page so you can configure the
@@ -269,13 +269,13 @@ configuration for use with the OpenID server example.
<p>
The server URL is the URL that points to the "server.php" file. It
- looks like your server URL should be <code><?php print build_url(); ?></code>.
+ looks like your server URL should be <code><?php print build_url(); </code>.
</p>
<span class="label"><label for="i_server_url">Server URL:</label></span>
<span>
<input type="text" id="i_server_url" size="35" name="server_url"
- value="<?php print $_SESSION['server_url'] ?>">
+ value="<?php print $_SESSION['server_url'] ">
</span>
</div>
@@ -292,7 +292,7 @@ configuration for use with the OpenID server example.
</span>
<span>
<input type="text" id="i_include_path" size="35" name="include_path"
- value="<?php print $_SESSION['include_path'] ?>">
+ value="<?php print $_SESSION['include_path'] ">
</span>
</div>
@@ -308,64 +308,64 @@ configuration for use with the OpenID server example.
<div>
<input type="radio" name="store_type" value="Filesystem"
- id="i_filesystem"<?php if ($_SESSION['store_type'] == 'Filesystem') { print " CHECKED"; } ?>>
+ id="i_filesystem"<?php if ($_SESSION['store_type'] == 'Filesystem') { print " CHECKED"; } >
<label for="i_filesystem">Filesystem</label>
<div>
<label for="i_fs_path" class="field">Filesystem path:</label>
<input type="text" name="fs_path" id="i_fs_path"
- value="<?php print @$_SESSION['store_data']['fs_path']; ?>">
- <?php print $basedir_msg; ?>
+ value="<?php print @$_SESSION['store_data']['fs_path']; ">
+ <?php print $basedir_msg;
</div>
</div>
-<?php if ($sqlite_found) { ?>
+<?php if ($sqlite_found) {
<div>
<input type="radio" name="store_type" value="SQLite"
- id="i_sqlite"<?php if ($_SESSION['store_type'] == 'SQLite') { print " CHECKED"; } ?>>
+ id="i_sqlite"<?php if ($_SESSION['store_type'] == 'SQLite') { print " CHECKED"; } >
<label for="i_sqlite">SQLite</label>
<div>
<label for="i_sqlite_path" class="field">SQLite database path:</label>
- <input type="text" value="<?php print @$_SESSION['store_data']['sqlite_path']; ?>"
+ <input type="text" value="<?php print @$_SESSION['store_data']['sqlite_path']; "
name="sqlite_path" id="i_sqlite_path">
- <?php print $basedir_msg; ?>
+ <?php print $basedir_msg;
</div>
</div>
-<?php } ?>
+<?php }
-<?php if ($mysql_found || $pgsql_found) { ?>
+<?php if ($mysql_found || $pgsql_found) {
<div>
-<?php if ($mysql_found) { ?>
+<?php if ($mysql_found) {
<input type="radio" name="store_type" value="MySQL"
- id="i_mysql"<?php if ($_SESSION['store_type'] == 'MySQL') { print " CHECKED"; } ?>>
+ id="i_mysql"<?php if ($_SESSION['store_type'] == 'MySQL') { print " CHECKED"; } >
<label for="i_mysql">MySQL</label>
-<?php } ?>
+<?php }
-<?php if ($pgsql_found) { ?>
+<?php if ($pgsql_found) {
<input type="radio" name="store_type" value="PostgreSQL"
- id="i_pgsql"<?php if ($_SESSION['store_type'] == 'PostgreSQL') { print " CHECKED"; } ?>>
+ id="i_pgsql"<?php if ($_SESSION['store_type'] == 'PostgreSQL') { print " CHECKED"; } >
<label for="i_pgsql">PostgreSQL</label>
-<?php } ?>
+<?php }
<div>
<label for="i_m_host" class="field">Host:</label>
- <input type="text" value="<?php print @$_SESSION['store_data']['host']; ?>" name="host" id="i_m_host">
+ <input type="text" value="<?php print @$_SESSION['store_data']['host']; " name="host" id="i_m_host">
</div>
<div>
<label for="i_m_database" class="field">Database:</label>
- <input value="<?php print @$_SESSION['store_data']['database']; ?>" type="text" name="database" id="i_m_database">
+ <input value="<?php print @$_SESSION['store_data']['database']; " type="text" name="database" id="i_m_database">
</div>
<div>
<label for="i_m_username" class="field">Username:</label>
- <input type="text" name="username" id="i_m_username" value="<?php print @$_SESSION['store_data']['username']; ?>">
+ <input type="text" name="username" id="i_m_username" value="<?php print @$_SESSION['store_data']['username']; ">
</div>
<div>
<label for="i_m_password" class="field">Password:</label>
- <input type="password" name="password" id="i_m_password" value="<?php print @$_SESSION['store_data']['password']; ?>">
+ <input type="password" name="password" id="i_m_password" value="<?php print @$_SESSION['store_data']['password']; ">
</div>
</div>
-<?php } ?>
+<?php }
</div>
</div>
@@ -416,14 +416,14 @@ function generate_config($download = false) {
header("Content-disposition: attachment; filename=config.php");
print "<?php\n";
} else {
-?>
+
<html>
<body>
<h2>OpenID Example Server Configuration</h2>
<p>
-Put the following text into <strong><?php print dirname(__FILE__); print DIRECTORY_SEPARATOR; ?>config.php</strong>.
+Put the following text into <strong><?php print dirname(__FILE__); print DIRECTORY_SEPARATOR; config.php</strong>.
</p>
<p>
@@ -438,16 +438,16 @@ Put the following text into <strong><?php print dirname(__FILE__); print DIRECTO
<?php
print "&lt;?php\n";
}
-?>
-<?php if ($_SESSION['include_path']) { ?>
+
+<?php if ($_SESSION['include_path']) {
/**
* Set any extra include paths needed to use the library
*/
set_include_path(get_include_path() . PATH_SEPARATOR . "<?php
print $_SESSION['include_path'];
-?>");
+");
-<?php } ?>
+<?php }
/**
* The URL for the server.
*
@@ -459,7 +459,7 @@ print $_SESSION['include_path'];
*/
$server_url = "<?php
print $_SESSION['server_url'];
-?>";
+";
/**
* Initialize an OpenID store
@@ -488,14 +488,14 @@ function getOpenIDStore()
case "MySQL":
- ?>require_once 'Auth/OpenID/MySQLStore.php';
+ require_once 'Auth/OpenID/MySQLStore.php';
require_once 'DB.php';
$dsn = array(
'phptype' => 'mysql',
- 'username' => '<?php print $_SESSION['store_data']['username']; ?>',
- 'password' => '<?php print $_SESSION['store_data']['password']; ?>',
- 'hostspec' => '<?php print $_SESSION['store_data']['host']; ?>'
+ 'username' => '<?php print $_SESSION['store_data']['username']; ',
+ 'password' => '<?php print $_SESSION['store_data']['password']; ',
+ 'hostspec' => '<?php print $_SESSION['store_data']['host']; '
);
$db =& DB::connect($dsn);
@@ -504,7 +504,7 @@ function getOpenIDStore()
return null;
}
- $db->query("USE <?php print $_SESSION['store_data']['database']; ?>");
+ $db->query("USE <?php print $_SESSION['store_data']['database']; ");
$s =& new Auth_OpenID_MySQLStore($db);
@@ -516,15 +516,15 @@ function getOpenIDStore()
case "PostgreSQL":
- ?>require_once 'Auth/OpenID/PostgreSQLStore.php';
+ require_once 'Auth/OpenID/PostgreSQLStore.php';
require_once 'DB.php';
$dsn = array(
'phptype' => 'pgsql',
- 'username' => '<?php print $_SESSION['store_data']['username']; ?>',
- 'password' => '<?php print $_SESSION['store_data']['password']; ?>',
- 'hostspec' => '<?php print $_SESSION['store_data']['host']; ?>',
- 'database' => '<?php print $_SESSION['store_data']['database']; ?>'
+ 'username' => '<?php print $_SESSION['store_data']['username']; ',
+ 'password' => '<?php print $_SESSION['store_data']['password']; ',
+ 'hostspec' => '<?php print $_SESSION['store_data']['host']; ',
+ 'database' => '<?php print $_SESSION['store_data']['database']; '
);
$db =& DB::connect($dsn);
@@ -542,17 +542,17 @@ function getOpenIDStore()
break;
}
- ?>
+
}
<?php
- print "?>";
+ print "";
if (!$download) {
-?>
+
</pre>
</body>
</html>
<?php
}
} // end function generate_config ()
-?>
+