webwow2.webp
WebWoW CMS

Overview

WebWoW CMS has just released a v2 beta which seems great so far. Of course there are a few small bugs, but nothing that breaks functionality… Mostly undefined indexes and the like. I will probably make a few mods and hacks for the CMS as it’s a great project with a nice style and ethos.

This simple modification will place a captcha on the registration page to help prevent spam, bots, and fake registrations.

After about 10 minutes of setting up WebWoW CMS I started to get bot registrations, indicated by the spammy usernames and lack of activity. I decided to create a small WebWoW CMS Mod to help prevent the influx of spam. Hopefully this will be of use to someone.

Only two files edits are required so it shouldn’t take more than 5 minutes to implement.

Backup These Files Before Editing: engine/func/session.php
engine/modules/register.php

Registration Captcha Mod

Open: engine/func/session.php

1a] Find (about line 324):

PHP session.php
function register($subuser, $subpass, $subemail){

Change to:

PHP session.php
function register($subuser, $subpass, $subemail, $subcaptcha){

1b] Find (about line 397):

PHP session.php
$subemail = stripslashes($subemail);
      }

Add below:

PHP session.php
      /* captcha error checking - nowares */
      $field = "captcha";  //Use field name for the generated captcha image
      if(!$subcaptcha || $subcaptcha != $_SESSION['captcha']){
         $form->setError($field, "* captcha incorrect");
      }
      else{
         $subcaptcha = mysql_real_escape_string($subcaptcha);
      }

Open: engine/modules/register.php

2a] Find (about line 26):

PHP register.php
      $retval = $user->register($_POST['user_name'], $_POST['pass_word'], $_POST['email']);

Replace with:

PHP register.php
      $retval = $user->register($_POST['user_name'], $_POST['pass_word'], $_POST['email'], $_POST['captcha']);

2b] Find (about line 109):

HTML register.php
<td><?php echo $form->error("email"); ?></td></tr>

Add below:

HTML register.php
<tr>
    <td>Captcha:</td>
    <td><img src="captcha/php_captcha.php"> &nbsp;<input name="captcha" type="text" style="width:65px;position:relative;bottom:5px;" value="<?php echo $form->value("captcha"); ?>" /></td>
    <td><?php echo $form->error("captcha"); ?></td>
</tr>

Upload the captcha/ folder to your site root and you're done — the generated image is served from captcha/php_captcha.php.

nwow-captcha-mod.png
WebWOW CMS Captcha Mod
Archive Note WebWoW CMS itself was discontinued, but the original mod files have survived and are available to download below.
download.sh
$ ./download.sh --file webwow-captcha.rar [ DOWNLOAD ]