[Solved]: captcha under optional in the registration [Solved]: captcha under optional in the registration
 

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]

Main Menu

[Solved]: captcha under optional in the registration

Started by Laicodc, March 30, 2009, 10:10:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Laicodc

I just installed the captcha plugin and noticed that the captcha is under "OPTIONAL" section in the registration page.  Is there a way to put the captcha in the required section instead of the optional section?

Fabricio Ferrero

Please, post a link to your gallery as requested by board rules. And give a link to the Captcha mod you have installed, there are already a couple of them.
Read Docs and Search the Forum before posting. - Soporte en español
--*--
Fabricio Ferrero's Website

Catching up! :)


Timos-Welt

Open codebase.php of the plugin with a text editor.

Find this:

        case 'register.php':
            $valid_groups = explode(',', $CAPTCHA_DISABLE['register']);
            if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['register'] == '') {
                $exper = '(<td colspan="2" align="center" class="tablef">.*
                 .*<input type="submit" name="submit" value="' . $lang_register_php['submit'] . '" class="button" />.*
             .*</td>)';
                if (preg_match($exper, $html)) {
                    $newcpch = '<!-- CAPTCH PLUGIN 3 --><tr><td class="tableb" height="25" width="40%">' . $lang_plugin_captcha_conf . '</td><td class="tableb_compact" colspan="2"><input type="text" name="confirmCode" id="confirmCode" size="5" class="textinput"><img src="captcha.php" align="middle"></tr><tr><td colspan="2" align="center" class="tablef">
                    <input type="submit" name="submit" value="' . $lang_register_php['submit'] . '" class="button" />
            </td></tr>';
                    $html = preg_replace($exper, $newcpch, $html);
                }
            }
            break;



and replace with

        case 'register.php':
            $valid_groups = explode(',', $CAPTCHA_DISABLE['register']);
            if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['register'] == '') {
                $exper = '(<input type="text" style="width: 100%" name="email" maxlength="255" value="" class="textinput" />)';
                if (preg_match($exper, $html)) {
                    $newcpch = '<input type="text" style="width: 100%" name="email" maxlength="255" value="" class="textinput" /></td></tr><!-- CAPTCH PLUGIN 3 --><tr><td class="tableb" height="25" width="40%">' . $lang_plugin_captcha_conf . '</td><td class="tableb_compact" colspan="2"><input type="text" name="confirmCode" id="confirmCode" size="5" class="textinput"><img src="captcha.php" align="middle">';
                    $html = preg_replace($exper, $newcpch, $html);
                }
            }
            break;

Laicodc

Thanks!  that worked great!!!  I really appreciate your help

Fabricio Ferrero

Thanks for coming back and give the topic as solved.
Read Docs and Search the Forum before posting. - Soporte en español
--*--
Fabricio Ferrero's Website

Catching up! :)