optimisation, only load openid module when signing in

This makes the CGI about .2 seconds faster when editing pages etc.
master
Joey Hess 2008-03-19 21:12:18 -04:00
parent d85c9660c5
commit 9f3788e2a2
1 changed files with 8 additions and 8 deletions

View File

@ -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");