summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Shepard <lshepard@devrs006.snc1.facebook.com>2009-05-27 13:54:28 -0700
committerLuke Shepard <lshepard@devrs006.snc1.facebook.com>2009-05-27 13:54:28 -0700
commitf963a700e4440074a5b86d382789e75795206482 (patch)
tree4cd13dd8658fa76da4c253402eaf1ead4a20b33d
parenta2bdc5c6129ff11b1c1e29a207b1b80153ac6fb0 (diff)
downloadphp-openid-f963a700e4440074a5b86d382789e75795206482.zip
php-openid-f963a700e4440074a5b86d382789e75795206482.tar.gz
php-openid-f963a700e4440074a5b86d382789e75795206482.tar.bz2
[ correct errors in removing trailing ?> ]
In the last commit, I over-aggressively removed closing PHP tags. While I dislike the practice of using close tags within templates, it is how this library works, so let's put them back. Checked that all PHP compiles with "php -l".
-rw-r--r--Tests/Auth/OpenID/OpenID_Yadis.php2
-rw-r--r--Tests/Auth/OpenID/RPVerify.php10
-rw-r--r--examples/consumer/index.php18
-rw-r--r--examples/discover.php28
-rw-r--r--examples/server/lib/render/idpXrds.php2
-rw-r--r--examples/server/lib/render/userXrds.php2
-rw-r--r--examples/server/server.php2
-rw-r--r--examples/server/setup.php93
8 files changed, 84 insertions, 73 deletions
diff --git a/Tests/Auth/OpenID/OpenID_Yadis.php b/Tests/Auth/OpenID/OpenID_Yadis.php
index 923dfd3..f013d96 100644
--- a/Tests/Auth/OpenID/OpenID_Yadis.php
+++ b/Tests/Auth/OpenID/OpenID_Yadis.php
@@ -9,7 +9,7 @@ require_once "Auth/Yadis/XRDS.php";
require_once "Auth/OpenID/Discover.php";
global $__XRDS_BOILERPLATE;
-$__XRDS_BOILERPLATE = '<?xml version="1.0" encoding="UTF-8"
+$__XRDS_BOILERPLATE = '<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS xmlns:xrds="xri://$xrds"
xmlns="xri://$xrd*($v*2.0)"
xmlns:openid="http://openid.net/xmlns/1.0">
diff --git a/Tests/Auth/OpenID/RPVerify.php b/Tests/Auth/OpenID/RPVerify.php
index d219f7b..e09138a 100644
--- a/Tests/Auth/OpenID/RPVerify.php
+++ b/Tests/Auth/OpenID/RPVerify.php
@@ -90,7 +90,7 @@ class Tests_Auth_OpenID_ExtractReturnToURLs extends PHPUnit_Framework_TestCase {
function test_noEntries()
{
- $this->failUnlessXRDSHasReturnURLs('<?xml version="1.0" encoding="UTF-8"
+ $this->failUnlessXRDSHasReturnURLs('<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS xmlns:xrds="xri://$xrds"
xmlns="xri://$xrd*($v*2.0)"
>
@@ -102,7 +102,7 @@ class Tests_Auth_OpenID_ExtractReturnToURLs extends PHPUnit_Framework_TestCase {
function test_noReturnToEntries()
{
- $this->failUnlessXRDSHasReturnURLs('<?xml version="1.0" encoding="UTF-8"
+ $this->failUnlessXRDSHasReturnURLs('<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS xmlns:xrds="xri://$xrds"
xmlns="xri://$xrd*($v*2.0)"
>
@@ -118,7 +118,7 @@ class Tests_Auth_OpenID_ExtractReturnToURLs extends PHPUnit_Framework_TestCase {
function test_oneEntry()
{
- $this->failUnlessXRDSHasReturnURLs('<?xml version="1.0" encoding="UTF-8"
+ $this->failUnlessXRDSHasReturnURLs('<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS xmlns:xrds="xri://$xrds"
xmlns="xri://$xrd*($v*2.0)"
>
@@ -134,7 +134,7 @@ class Tests_Auth_OpenID_ExtractReturnToURLs extends PHPUnit_Framework_TestCase {
function test_twoEntries()
{
- $this->failUnlessXRDSHasReturnURLs('<?xml version="1.0" encoding="UTF-8"
+ $this->failUnlessXRDSHasReturnURLs('<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS xmlns:xrds="xri://$xrds"
xmlns="xri://$xrd*($v*2.0)"
>
@@ -155,7 +155,7 @@ class Tests_Auth_OpenID_ExtractReturnToURLs extends PHPUnit_Framework_TestCase {
function test_twoEntries_withOther()
{
- $this->failUnlessXRDSHasReturnURLs('<?xml version="1.0" encoding="UTF-8"
+ $this->failUnlessXRDSHasReturnURLs('<?xml version="1.0" encoding="UTF-8"?>
<xrds:XRDS xmlns:xrds="xri://$xrds"
xmlns="xri://$xrd*($v*2.0)"
>
diff --git a/examples/consumer/index.php b/examples/consumer/index.php
index dd2f391..b2ad176 100644
--- a/examples/consumer/index.php
+++ b/examples/consumer/index.php
@@ -2,6 +2,7 @@
require_once "common.php";
global $pape_policy_uris;
+?>
<html>
<head><title>PHP OpenID Authentication Example</title></head>
@@ -48,9 +49,17 @@ 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>";
+ }
+ if (isset($error)) {
+ print "<div class=\"error\">$error</div>";
+ }
+ if (isset($success)) {
+ print "<div class=\"success\">$success</div>";
+ }
+ ?>
<div id="verify-form">
<form method="get" action="try_auth.php">
@@ -63,7 +72,8 @@ 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/discover.php b/examples/discover.php
index 4f21465..5ba0af9 100644
--- a/examples/discover.php
+++ b/examples/discover.php
@@ -17,6 +17,7 @@ function escape($x)
$identifier = getOpenIDIdentifier();
+?>
<html>
<head>
@@ -37,41 +38,41 @@ if ($identifier) {
$fetcher = Auth_Yadis_Yadis::getHTTPFetcher();
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 +80,23 @@ 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
+</html>
diff --git a/examples/server/lib/render/idpXrds.php b/examples/server/lib/render/idpXrds.php
index 6dde930..e83d031 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)">
diff --git a/examples/server/lib/render/userXrds.php b/examples/server/lib/render/userXrds.php
index 0f0239e..1936f2c 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)">
diff --git a/examples/server/server.php b/examples/server/server.php
index cbb8288..71b9b97 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>
diff --git a/examples/server/setup.php b/examples/server/setup.php
index 9ec35f8..5778b87 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,8 +504,8 @@ 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);
$s->createTables();
@@ -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,16 @@ function getOpenIDStore()
break;
}
-
+ ?>
}
<?php
- print "";
+ print "?>";
if (!$download) {
-
+?>
</pre>
</body>
</html>
<?php
}
} // end function generate_config ()
-