[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm

raeburn raeburn at source.lon-capa.org
Thu Sep 5 20:34:57 EDT 2013


raeburn		Fri Sep  6 00:34:57 2013 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  - Detect if page is being served with https, and if so, third arg to
    Captcha::reCAPTCHA->get_html() needs to be true.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1152 loncom/interface/loncommon.pm:1.1153
--- loncom/interface/loncommon.pm:1.1152	Thu Sep  5 12:07:25 2013
+++ loncom/interface/loncommon.pm	Fri Sep  6 00:34:57 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1152 2013/09/05 12:07:25 goltermann Exp $
+# $Id: loncommon.pm,v 1.1153 2013/09/06 00:34:57 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -14869,9 +14869,13 @@
 
 sub create_recaptcha {
     my ($pubkey) = @_;
+    my $use_ssl;
+    if ($ENV{'SERVER_PORT'} == 443) {
+        $use_ssl = 1;
+    }
     my $captcha = Captcha::reCAPTCHA->new;
     return $captcha->get_options_setter({theme => 'white'})."\n".
-           $captcha->get_html($pubkey).
+           $captcha->get_html($pubkey,undef,$use_ssl).
            &mt('If either word is hard to read, [_1] will replace them.',
                '<img src="/res/adm/pages/refresh.gif" alt="reCAPTCHA refresh" />').
            '<br /><br />';




More information about the LON-CAPA-cvs mailing list