coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 plugins => Topic started by: Laicodc on March 30, 2009, 10:10:45 PM

Title: [Solved]: captcha under optional in the registration
Post by: Laicodc on March 30, 2009, 10:10:45 PM
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?
Title: Re: captcha under optional in the registration
Post by: Fabricio Ferrero on March 30, 2009, 11:00:58 PM
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.
Title: Re: captcha under optional in the registration
Post by: Laicodc on March 31, 2009, 12:02:17 AM
my gallery is http://laicodc.com/gallery

I just installed the v3.0 plug in: http://forum.coppermine-gallery.net/index.php?action=dlattach;topic=36319.0;attach=8465

Title: Re: captcha under optional in the registration
Post by: Timos-Welt on March 31, 2009, 08:14:42 PM
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;
Title: Re: captcha under optional in the registration
Post by: Laicodc on April 03, 2009, 02:22:02 AM
Thanks!  that worked great!!!  I really appreciate your help
Title: Re: captcha under optional in the registration
Post by: Fabricio Ferrero on April 03, 2009, 04:11:56 AM
Thanks for coming back and give the topic as solved.