1

Topic: PunBB Incapsula Extension

Author: k0nsl (i.am@k0nsl.org)
Description: This PunBB extension automatically detects correct originating IP when using Incapsula service.

More info & download:
http://k0nsl.org/blog/punbb-incapsula-extension/

Regards,
-k0nsl

Re: PunBB Incapsula Extension

Thanks,
but you need to use an existing hook...  line 50 of your manifest.xml below, or ask for addition of a hook where you need it in source code....

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE extension SYSTEM "ext-1.0.dtd">

<!--
/**
 * Automatically detect correct originating IP when using Incapsula
 * 
 *
 * @copyright (C) 2012 incapsula_k0nsl for PunBB (C)
 * @copyright Copyright (C) 2012 k0nsl ([url]http://k0nsl.org/blog[/url])
 * @license [url]http://www.gnu.org/licenses/gpl.html[/url] GPL version 2 or higher
 * @package incapsula_k0nsl
 */
-->

<extension engine="1.0">
    <id>incapsula_k0nsl</id>
    <title>Incapsula IP Correction Plugin</title>
    <version>1.0</version>
    <description>Automatically detect correct originating IP when using Incapsula</description>
    <author>i.am@k0nsl.org</author>

    <!-- -->
    <minversion>1.4.2</minversion>
    <maxtestedon>1.4.3</maxtestedon>


    <install><![CDATA[

        // Add extension options to the config table
        forum_config_add('incapsula_k0nsl_index', '1');
        forum_config_add('incapsula_k0nsl_enable', '1');
        
    ]]></install>


    <uninstall><![CDATA[
    
       // Remove extension options
        forum_config_remove(array(
            'incapsula_k0nsl_index',
            'incapsula_k0nsl_enable',
        ));
    ]]></uninstall>


    <hooks>

      <!-- that's my one and only hook, so simple. -->
        <hook id="k0nsl_main_hook"><![CDATA[

            if ($form['incapsula_k0nsl_enable'] == '0') {
                require_once $ext_info['path'].'/incapsula_k0nsl.php';
            }
        ]]></hook>
        
    </hooks>

</extension>

3

Re: PunBB Incapsula Extension

Extension updated and I can confirm it works. Anybody else using Incapsula who could try it too?

http://k0nsl.org/blog/punbb-incapsula-e … nsl-tar-2/

Thanks.

-k0nsl