Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: [Mod] Captcha (Visual Confirmation) for new users registration  (Read 15679 times)

0 Members and 1 Guest are viewing this topic.

Ludo

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle

For those, like me, who can't get Captcha Plugin working, I've "extended" Abbas Ali Captcha Mod for comments to registration page, in order to prevent automatic registrations by spambots and alike.
This mod will present new users trying to register an additional required field to enter the confirmation code shown aside in the captcha image: no matching confirmation code = registration not allowed, quite simple :-)

DEMO: http://vanrokken.altervista.org/register.php

NEW FILES: 4 (only if Captcha Mod for comments is not installed)
  • captcha.php
  • include/captcha.class.php
  • fonts/acidic.ttf
  • fonts/hurryup.ttf

FILES TO EDIT: 2
  • register.php
  • lang/english.php

EXTRACT (only if Captcha Mod for comments is not installed)
attached zip file to your gallery root directory, as follows:
  • captcha.php => / (root directory)
  • captcha.class.php => /include
  • acidic.ttf => /fonts
  • hurryup.ttf => /fonts

OPEN
register.php

FIND
Code: [Select]
require('include/init.inc.php');
AFTER, ADD
Code: [Select]
require('include/captcha.class.php');
FIND
Code: [Select]
        array('input', 'email', $lang_register_php['email'], 255),
AFTER, ADD
Code: [Select]
        array('input', 'confirm', $lang_register_php['confirm'], 5),
FIND
Code: [Select]
            if ($element[2]) echo <<<EOT
        <tr>
            <td width="40%" class="tableb"  height="25">
                        {$element[2]}
        </td>
        <td width="60%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="{$element[1]}" maxlength="{$element[3]}" value="$value" class="textinput" />
                </td>
        </tr>

EOT;

REPLACE WITH
Code: [Select]
            if ($element[2]) {
               echo <<<EOT
        <tr>
            <td width="40%" class="tableb"  height="25">
                        {$element[2]}
        </td>
        <td width="60%" class="tableb" valign="top">
EOT;
               if ($element[1] == "confirm") {
                   echo '<input type="text" style="width: 40%" name="'.$element[1].'" maxlength="'.$element[3].'" value="'.$value.'" class="textinput" />&nbsp;<img src="captcha.php" align="middle">';
               } else {       
                   echo '<input type="text" style="width: 100%" name="'.$element[1].'" maxlength="'.$element[3].'" value="'.$value.'" class="textinput" />';
               }
               echo <<<EOT
        </td>
        </tr>
EOT;
            }

FIND
Code: [Select]
    $email = trim(get_post_var('email'));
AFTER, ADD
Code: [Select]
    $confirm = trim(get_post_var('confirm'));
FIND
Code: [Select]
    if ($error != '') return false;
BEFORE, ADD
Code: [Select]
    if (!PhpCaptcha::Validate($confirm)) $error .= '<li>' . $lang_register_php['captcha_error'];

OPEN
lang/english.php

FIND
Code: [Select]
);

$lang_register_confirm_email = <<<EOT

BEFORE, ADD
Code: [Select]
  'confirm' => 'Enter confirmation code', 
  'captcha_error' => 'Confirmation code not matching',


SAVE AND CLOSE ALL FILES
« Last Edit: July 15, 2008, 09:11:21 am by Ludo »
Logged

goku

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 32
Re: [Mod] Captcha (Visual Confirmation) for new users registration
« Reply #1 on: September 28, 2008, 01:44:07 pm »

hey im sorry but i didnt find  any fonts folder in my cpg folder
what shud i do
Logged

Ludo

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: [Mod] Captcha (Visual Confirmation) for new users registration
« Reply #2 on: September 28, 2008, 06:06:53 pm »

It should be created extracting the attached zip file, if not create it manually...
Logged

goku

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 32
Re: [Mod] Captcha (Visual Confirmation) for new users registration
« Reply #3 on: September 30, 2008, 12:48:14 pm »

hey z i have installed the mod like u said but my captcha image dont show up and im really depressed man i can't get ppl to join my gallery :( please help.
Logged

Ludo

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: [Mod] Captcha (Visual Confirmation) for new users registration
« Reply #4 on: September 30, 2008, 03:42:20 pm »

For any issue not related to registration page in particular, refer to "main" Captcha Mod thread
Logged

VaporDesigns

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
    • Vapor Designs
Re: [Mod] Captcha (Visual Confirmation) for new users registration
« Reply #5 on: January 07, 2009, 06:20:35 pm »

Is this captcha or re-captcha?  ???
Logged

Heroe

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 124
    • abroadbg.com
Re: [Mod] Captcha (Visual Confirmation) for new users registration
« Reply #6 on: January 16, 2009, 11:58:19 pm »

i having problems with this mod
captcha don't appear ???
i double check the files and the edits all is fine

my gallery link

http://abroadbg.com

 
Logged

Nibbler

  • Guest
Re: [Mod] Captcha (Visual Confirmation) for new users registration
« Reply #7 on: January 17, 2009, 02:46:30 am »

Works fine in other languages. Looks like you broke your Bulgarian language file by editing it. Restore a clean copy.
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.