Changeset 25264


Ignore:
Timestamp:
03/23/12 14:27:19 (9 years ago)
Author:
sjm84
Message:

Added the ability to output a captcha image (need to put the private key into siteconfig.xml)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java

    r25107 r25264  
    2727import java.text.SimpleDateFormat;
    2828
     29import net.tanesha.recaptcha.ReCaptcha;
     30import net.tanesha.recaptcha.ReCaptchaFactory;
     31
    2932import org.apache.log4j.*;
    3033import org.w3c.dom.Node;
     
    105108    public static byte[] toUTF8(String orig)
    106109    {
    107 
    108110        try
    109111        {
     
    116118            return orig.getBytes();
    117119        }
     120    }
     121   
     122    public static String replace(String orig, String match, String replacement)
     123    {
     124        return orig.replace(match, replacement);
    118125    }
    119126
     
    472479        return true;
    473480    }
     481   
     482    public static String reCAPTCHAimage()
     483    {
     484        ReCaptcha c = ReCaptchaFactory.newReCaptcha("6LckI88SAAAAACUYjj97WMcnz5HPjVp3lI-x-ue8", "6LckI88SAAAAAGnGy1PwuXYZzIMXZYoPxN51bWWG", false);
     485        return c.createRecaptchaHtml(null, null);
     486    }
    474487}
Note: See TracChangeset for help on using the changeset viewer.