Examples of Akismet


Examples of net.sf.akismet.Akismet

        {
            if( m_akismet == null )
            {
                log.info("Initializing Akismet spam protection.");

                m_akismet = new Akismet( m_akismetAPIKey, context.getEngine().getBaseURL() );

                if( !m_akismet.verifyAPIKey() )
                {
                    log.error("Akismet API key cannot be verified.  Please check your config.");
                    m_akismetAPIKey = null;
View Full Code Here

Examples of net.sf.akismet.Akismet

     */
    private void checkAkismet( WikiContext context, Change change ) throws RedirectException {
        if( m_akismetAPIKey != null ) {
            if( m_akismet == null ) {
                log.info( "Initializing Akismet spam protection." );
                m_akismet = new Akismet( m_akismetAPIKey, context.getEngine().getBaseURL() );

                if( !m_akismet.verifyAPIKey() ) {
                    log.error( "Akismet API key cannot be verified.  Please check your config." );
                    m_akismetAPIKey = null;
                    m_akismet = null;
View Full Code Here

Examples of net.sf.akismet.Akismet

        {
            if( m_akismet == null )
            {
                log.info("Initializing Akismet spam protection.");

                m_akismet = new Akismet( m_akismetAPIKey, context.getEngine().getBaseURL() );

                if( !m_akismet.verifyAPIKey() )
                {
                    log.error("Akismet API key cannot be verified.  Please check your config.");
                    m_akismetAPIKey = null;
View Full Code Here

Examples of net.sf.akismet.Akismet

        {
            if( m_akismet == null )
            {
                log.info("Initializing Akismet spam protection.");

                m_akismet = new Akismet( m_akismetAPIKey, context.getEngine().getBaseURL() );

                if( !m_akismet.verifyAPIKey() )
                {
                    log.error("Akismet API key cannot be verified.  Please check your config.");
                    m_akismetAPIKey = null;
View Full Code Here

Examples of net.sf.akismet.Akismet

    if (context.wasFormSubmitted()) {
      super.takeValuesFromRequest(request, context);

      String apiKey = ERXProperties.stringForKey("er.captcha.akismet.apiKey");
      String url = ERXProperties.stringForKeyWithDefault("er.captcha.akismet.url", "http://" + request._serverName());
      Akismet api = new Akismet(apiKey, url);
      if (ERXApplication.isDevelopmentModeSafe()) {
        if (!api.verifyAPIKey()) {
          throw new RuntimeException("The API key you provided is invalid. Please set a valid api key in the property 'er.captcha.akismet.apiKey'.");
        }
      }

      String ipAddress = stringValueForBinding("remoteAddress", request._remoteAddress());
      String userAgent = stringValueForBinding("userAgent", request.headerForKey("user-agent"));
      String referrer = stringValueForBinding("referrer", request.headerForKey("referer"));
      String permalink = stringValueForBinding("permalink");
      String commentType = stringValueForBinding("commentType");
      String author = stringValueForBinding("author");
      String authorEmail = stringValueForBinding("authorEmail");
      String authorURL = stringValueForBinding("authorURL");
      String content = stringValueForBinding("content");
      Map other = null;

      boolean isSpam = api.commentCheck(ipAddress, userAgent, referrer, permalink, commentType, author, authorEmail, authorURL, content, other);
      if (isSpam) {
        validationFailedWithException(new NSValidation.ValidationException("Spam check failed."), this, ERXSimpleSpamCheck.SPAM_CHECK_KEY);
        setValueForBinding(Boolean.FALSE, "valid");
      }
      else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.