Hi...
I'm using Coppermine 1.4.19 (set to Danish language), and everything has been working fine, but the last couple of days i have been bugged with over 200 spam registrations.
I then downloaded Captcha v. 3.0 and installed it in my Coppermine system. I've activated the plug-in, however i still have some problems.
I want Captcha to display when a new user wants to register. I've looked through the codebase.php file, but i cant seem to figure it out.
When i try to register no Captcha ecurity displays. However when i login in the Captcha displays.
Here is some code from my codebase.php file :
* captcha_page_start()
* check/validate captcha confirmation code [user input] for each page
*
* @return
*/
function captcha_page_start()
{
global $lang_continue, $lang_error, $lang_plugin_captcha_conf, $CONFIG, $CAPTCHA_DISABLE, $CAPTCHA_TIMEOUT;
/* Setting Options */
/**
* Enable/Disable array
*
* Set which group should NOT see Captcha on each page
* ''=> Captcha Enable for all users
* COppermine Standard Group Name:
* Administrators,Registered,Guests,Banned
* You can add your custome group name too
* Seprated by ','
*/
$CAPTCHA_DISABLE = array('login' => 'Administrators,Registered',
'register' => 'Administrators,Registered',
'comment' => 'Administrators,Registered',
'report' => 'Administrators',
'ecard' => 'Administrators',
);
$CAPTCHA_TIMEOUT = 300; // How many sec should passed before we remove the code from database
require ('plugins/captcha/include/init.inc.php');
require('plugins/captcha/include/captcha.class.php');
switch ($_SERVER['PHP_SELF']) {
case 'login.php':
$valid_groups = explode(',', $CAPTCHA_DISABLE['login']);
if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['login'] == '') {
if (isset($_POST['submitted']) AND !Validate($_POST['confirmCode'])) {
load_template();
pageheader($lang_error, "<META http-equiv=\"refresh\" content=\"3;url=login.php\">");
msg_box($lang_error, "$lang_plugin_captcha_error", $lang_continue, 'login.php');
pagefooter();
exit;
}
}
break;
case 'register.php':
$valid_groups = explode(',', $CAPTCHA_DISABLE['register']);
if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['register'] == '') {
if (isset($_POST['submit']) AND !Validate($_POST['confirmCode'])) {
load_template();
pageheader($lang_error, "<META http-equiv=\"refresh\" content=\"3;url=register.php\">");
msg_box($lang_error, "$lang_plugin_captcha_error", $lang_continue, 'register.php');
pagefooter();
exit;
}
}
break;
case 'db_input.php':
$valid_groups = explode(',', $CAPTCHA_DISABLE['comment']);
if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['comment'] == '') {
if (isset($_POST['msg_body']) AND !Validate($_POST['confirmCode'])) {
load_template();
pageheader($lang_error, "<META http-equiv=\"refresh\" content=\"3;url=displayimage.php?pos=" . (- $_POST['pid']) . "\">");
msg_box($lang_error, "$lang_plugin_captcha_error", $lang_continue, "displayimage.php?pos=" . (- $_POST['pid']));
pagefooter();
exit;
}
}
break;
case 'report_file.php':
$valid_groups = explode(',', $CAPTCHA_DISABLE['report']);
if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['report'] == '') {
if (count($_POST) > 0 AND !Validate($_POST['confirmCode'])) {
load_template();
pageheader($lang_error, "<META http-equiv=\"refresh\" content=\"3;url=report_file.php?album={$_GET['album']}&pid={$_GET['pid']}&pos={$_GET['pos']}\">");
msg_box($lang_error, "$lang_plugin_captcha_error", $lang_continue, "report_file.php?album={$_GET['album']}&pid={$_GET['pid']}&pos={$_GET['pos']}");
pagefooter();
exit;
}
}
break;
case 'ecard.php':
$valid_groups = explode(',', $CAPTCHA_DISABLE['ecard']);
if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['ecard'] == '') {
if (count($_POST) > 0 AND !Validate($_POST['confirmCode'])) {
load_template();
pageheader($lang_error, "<META http-equiv=\"refresh\" content=\"3;url=ecard.php?album={$_GET['album']}&pid={$_GET['pid']}&pos={$_GET['pos']}\">");
msg_box($lang_error, "$lang_plugin_captcha_error", $lang_continue, "ecard.php?album={$_GET['album']}&pid={$_GET['pid']}&pos={$_GET['pos']}");
pagefooter();
exit;
}
}
break;
default: ;
} // switch
}
/**
This is what i want: Captcha must show security display when a new user wants to register.