summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-03-19 21:12:18 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-03-19 21:12:18 -0400
commit9f3788e2a2126083ca3f91aa0fe8c35c9db1b81e (patch)
tree41d331b7e5f838feb7ba77e24cb4d3468252e7e3
parentd85c9660c5ce6f9749f3afc5c51342caf7713263 (diff)
optimisation, only load openid module when signing in
This makes the CGI about .2 seconds faster when editing pages etc.
-rw-r--r--IkiWiki/Plugin/openid.pm16
1 files changed, 8 insertions, 8 deletions
diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm
index de31f38ee..10a8fa22f 100644
--- a/IkiWiki/Plugin/openid.pm
+++ b/IkiWiki/Plugin/openid.pm
@@ -27,15 +27,15 @@ sub formbuilder_setup (@) { #{{{
my $session=$params{session};
my $cgi=$params{cgi};
- # Give up if module is unavailable to avoid needing to depend on
- # it.
- eval q{use Net::OpenID::Consumer};
- if ($@) {
- debug("unable to load Net::OpenID::Consumer, not enabling OpenID login");
- return;
- }
-
if ($form->title eq "signin") {
+ # Give up if module is unavailable to avoid
+ # needing to depend on it.
+ eval q{use Net::OpenID::Consumer};
+ if ($@) {
+ debug("unable to load Net::OpenID::Consumer, not enabling OpenID login");
+ return;
+ }
+
# This avoids it displaying a redundant label for the
# OpenID fieldset.
$form->fieldsets("OpenID");