]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/openid.pm
* Fix openid signin secret generation code. This fixes the bug that made
[ikiwiki.git] / IkiWiki / Plugin / openid.pm
index 75f13f878626e5b86cf632e13053170aa03facdb..4a7255069928c7d2b3bafb23730f7ef4783462c1 100644 (file)
@@ -33,8 +33,8 @@ sub formbuilder_setup (@) { #{{{
                        label => "OpenID",
                        size => 30,
                        comment => '('.
                        label => "OpenID",
                        size => 30,
                        comment => '('.
-                               htmllink("", "", "OpenID", 1, 0, "What's this?")
-                               .($config{openidsignup} ? " | <a href=\"$config{openidsignup}\">Get an OpenID</a>" : "")
+                               htmllink("", "", "OpenID", 1, 0, gettext("What's this?"))
+                               .($config{openidsignup} ? " | <a href=\"$config{openidsignup}\">".gettext("Get an OpenID")."</a>" : "")
                                .')'
                );
 
                                .')'
                );
 
@@ -140,13 +140,14 @@ sub getobj ($$) { #{{{
        # Store the secret in the session.
        my $secret=$session->param("openid_secret");
        if (! defined $secret) {
        # 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,
        }
 
        return Net::OpenID::Consumer->new(
                ua => $ua,
                args => $q,
-               consumer_secret => $secret,
+               consumer_secret => sub { return shift()+$secret },
                required_root => $config{cgiurl},
        );
 } #}}}
                required_root => $config{cgiurl},
        );
 } #}}}