Topic: [extension release] Session For All Visitors (bug workaround)
Fix for always wrong captcha if missing cookie bug
Important: Installation of this extension makes sense only if you have pun_antispam installed
see also:
http://punbb.informer.com/forums/topic/ … -disabled/
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE extension SYSTEM "ext-1.0.dtd">
<!--
/**
* Session For All Visitors (always set PHP session cookie and check on post))
*
* @package session_for_all_visitors
*/
-->
<extension engine="1.0">
<id>session_for_all_visitors</id>
<title>Session For All Visitors (fix for always wrong captcha if missing cookie)</title>
<version>1.0</version>
<description>
1. Tries to set a session cookie for all forum visitors (even guests).
2. Checks for cookie if visitor is about to post and warns/aborts if cookie is missing.
</description>
<author>NettiCat</author>
<minversion>1.3</minversion>
<maxtestedon>1.3.4</maxtestedon>
<dependencies>
<dependency>pun_antispam</dependency>
</dependencies>
<install>
<![CDATA[
]]>
</install>
<uninstall>
<![CDATA[
]]>
</uninstall>
<hooks>
<hook id="in_start, vf_start, vt_start"><![CDATA[
session_start(); //try to set cookie for all visitors, even for guests
]]>
</hook>
<hook id="rg_start, aop_start, li_start, po_start" priority="10"><![CDATA[
if (!isset($_COOKIE["PHPSESSID"])) //warn when user is about to post
message($lang_pun_antispam['Missing Cookie'] ? $lang_pun_antispam['Missing Cookie'] : 'Missing cookie. Please enable cookies and reload the page twice.');
]]>
</hook>
</hooks>
</extension>