summaryrefslogtreecommitdiff
path: root/lib/openid.php
diff options
context:
space:
mode:
authorsarven <csarven@plantard.controlezvous.ca>2009-01-23 01:20:48 +0000
committersarven <csarven@plantard.controlezvous.ca>2009-01-23 01:20:48 +0000
commit0711d45ef315e2349bb37f24b8a7cf85eafef96e (patch)
tree1e4d11b6ca70c0dbe4c04ab475bda194cc8fc064 /lib/openid.php
parent135f00c51bfd71e1ecb112f6813ed12c84549621 (diff)
parentf54f0a179a0369e145f02c8caed44644a8be6167 (diff)
Merge branch 'master' of ../trunk
Diffstat (limited to 'lib/openid.php')
-rw-r--r--lib/openid.php40
1 files changed, 32 insertions, 8 deletions
diff --git a/lib/openid.php b/lib/openid.php
index 1e7f318fb..860573702 100644
--- a/lib/openid.php
+++ b/lib/openid.php
@@ -184,15 +184,13 @@ function oid_authenticate($openid_url, $returnto, $immediate=false)
// Display an error if the form markup couldn't be generated;
// otherwise, render the HTML.
if (Auth_OpenID::isFailure($form_html)) {
- $this->show_form(sprintf(_('Could not create OpenID form: %s'), $form_html->message));
+ common_server_error(sprintf(_('Could not create OpenID form: %s'), $form_html->message));
} else {
- common_show_header(_('OpenID Auto-Submit'), null, null, '_oid_print_instructions');
- common_raw($form_html);
- common_element('script', null,
- '$(document).ready(function() { ' .
- ' $("#'. $form_id .'").submit(); '.
- '});');
- common_show_footer();
+ $action = new AutosubmitAction(); // see below
+ $action->form_html = $form_html;
+ $action->form_id = $form_id;
+ $action->prepare(array('action' => 'autosubmit'));
+ $action->handle(array('action' => 'autosubmit'));
}
}
}
@@ -251,3 +249,29 @@ function oid_update_user(&$user, &$sreg)
return true;
}
+
+class AutosubmitAction extends Action
+{
+ var $form_html = null;
+ var $form_id = null;
+
+ function handle($args)
+ {
+ parent::handle($args);
+ $this->showPage();
+ }
+
+ function title()
+ {
+ return _('OpenID Auto-Submit');
+ }
+
+ function showContent()
+ {
+ $this->raw($this->form_html);
+ $this->element('script', null,
+ '$(document).ready(function() { ' .
+ ' $(\'#'. $this->form_id .'\').submit(); '.
+ '});');
+ }
+}