X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/3e593eb9c0edd3f5cce7381ca145c0889441d719..4c0ffd59fd8c193c6b207d902750de4a63ded897:/IkiWiki/Plugin/openid.pm diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm index 7ea67c5ca..65b884814 100644 --- a/IkiWiki/Plugin/openid.pm +++ b/IkiWiki/Plugin/openid.pm @@ -33,8 +33,8 @@ sub formbuilder_setup (@) { #{{{ label => "OpenID", size => 30, comment => '('. - htmllink("", "", "OpenID", 1, 0, "What's this?") - .($config{openidsignup} ? " | Get an OpenID" : "") + htmllink("", "", "OpenID", noimageinline => 1, linktext => gettext("What's this?")) + .($config{openidsignup} ? " | ".gettext("Get an OpenID")."" : "") .')' ); @@ -56,6 +56,12 @@ sub formbuilder_setup (@) { #{{{ } } } + elsif ($form->title eq "preferences") { + if (! defined $form->field(name => "name")) { + $form->field(name => "OpenID", disabled => 1, value => + $session->param("name"), size => 50, force => 1); + } + } } sub validate ($$$;$) { #{{{ @@ -134,13 +140,14 @@ sub getobj ($$) { #{{{ # Store the secret in the session. my $secret=$session->param("openid_secret"); if (! defined $secret) { - $secret=$session->param(openid_secret => time); + $secret=rand; + $session->param(openid_secret => $secret); } return Net::OpenID::Consumer->new( ua => $ua, args => $q, - consumer_secret => $secret, + consumer_secret => sub { return shift()+$secret }, required_root => $config{cgiurl}, ); } #}}}