summaryrefslogtreecommitdiffstats
path: root/examples/server/lib/render/trust.php
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2007-03-22 18:22:00 +0000
committertailor <cygnus@janrain.com>2007-03-22 18:22:00 +0000
commit8ab6cc345e221f1e931597faeadfd345baf3ffda (patch)
treecd2c33ecd8bd5602489d1d817fd1cc5cbaddb412 /examples/server/lib/render/trust.php
parent900ae4d1d1cbdda4ce918ca8a813d1364fd73907 (diff)
downloadphp-openid-8ab6cc345e221f1e931597faeadfd345baf3ffda.zip
php-openid-8ab6cc345e221f1e931597faeadfd345baf3ffda.tar.gz
php-openid-8ab6cc345e221f1e931597faeadfd345baf3ffda.tar.bz2
[project @ Example server overhaul; add OpenID 2 features]
Diffstat (limited to 'examples/server/lib/render/trust.php')
-rw-r--r--examples/server/lib/render/trust.php37
1 files changed, 32 insertions, 5 deletions
diff --git a/examples/server/lib/render/trust.php b/examples/server/lib/render/trust.php
index 9acfae7..681d456 100644
--- a/examples/server/lib/render/trust.php
+++ b/examples/server/lib/render/trust.php
@@ -5,25 +5,52 @@ require_once "lib/render.php";
define('trust_form_pat',
'<div class="form">
- <p>Do you wish to confirm your identity (<code>%s</code>) with <code>%s</code>?</p>
<form method="post" action="%s">
- <input type="checkbox" name="remember" value="on" id="remember"><label
- for="remember">Remember this decision</label>
- <br />
+ %s
<input type="submit" name="trust" value="Confirm" />
<input type="submit" value="Do not confirm" />
</form>
</div>
');
+define('normal_pat',
+ '<p>Do you wish to confirm your identity ' .
+ '(<code>%s</code>) with <code>%s</code>?</p>');
+
+define('id_select_pat',
+ '<p>You entered the server URL at the RP.
+Please choose the name you wish to use. If you enter nothing, the request will be cancelled.<br/>
+<input type="text" name="idSelect" /></p>
+');
+
+define('no_id_pat',
+'
+You did not send an identifier with the request,
+and it was not an identifier selection request.
+Please return to the relying party and try again.
+');
+
function trust_render($info)
{
$current_user = getLoggedInUser();
$lnk = link_render(idURL($current_user));
$trust_root = htmlspecialchars($info->trust_root);
$trust_url = buildURL('trust', true);
- $form = sprintf(trust_form_pat, $lnk, $trust_root, $trust_url);
+
+ if ($info->idSelect()) {
+ $prompt = id_select_pat;
+ } else {
+ $prompt = sprintf(normal_pat, $lnk, $trust_root);
+ }
+
+ $form = sprintf(trust_form_pat, $trust_url, $prompt);
+
return page_render($form, $current_user, 'Trust This Site');
}
+function noIdentifier_render()
+{
+ return page_render(no_id_pat, null, 'No Identifier Sent');
+}
+
?> \ No newline at end of file