Welcome, Guest
Username Password: Remember me

Redirects not working correctly - another user!
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Redirects not working correctly - another user!

Redirects not working correctly - another user! 9 years, 6 months ago #1540

  • jkinane
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Karma: 0
Hi, I'm just trying out your Registration Validator (v 1.3.3) on my Joomla site (1.5.20). It works well, logging is good.
One problem noted, though. The redirect URL for Contact Form spam seems to be defaulting to the redirect used for Registration spam.
My Registration redirect URL is:
www.xxxxxxxxx.org/index.php?option=com_c...w=article&id=149
and the Contact Form redirect URL is:
www.xxxxxxxxx.org/index.php?option=com_c...w=article&id=150
The php code seems to default to the first URL in both cases. I've reversed the redirects (putting article 150 in the first box) and I get the Contact Form spam URL in both cases.
Here's a log extract:

09/11/2010 15:12:59 Registration Validator Start
09/11/2010 15:12:59 Email = ***********, IP = nnn.nn.nnn.171, username =
09/11/2010 15:12:59 Checking local IP blocklist
09/11/2010 15:12:59 Finished checking local IP blocklist
09/11/2010 15:12:59 Checking Spamhaus blocklist
09/11/2010 15:12:59 Finished checking Spamhaus blocklist
09/11/2010 15:12:59 Checking local email blocklist
09/11/2010 15:12:59 Registration blocked by local email blocklist
09/11/2010 15:12:59 Finished checking local email and Undisposable blocklist
09/11/2010 15:12:59 Contact form blocked - redirecting to www.***************.org/index.php?option...w=article&id=150
09/11/2010 15:12:59 ------------------------
09/11/2010 15:14:07 Registration Validator Start
09/11/2010 15:14:07 Email = ********, IP = nnn.nn.nnn.171, username = mmmmmmm
09/11/2010 15:14:07 Checking local IP blocklist
09/11/2010 15:14:07 Finished checking local IP blocklist
09/11/2010 15:14:07 Checking Spamhaus blocklist
09/11/2010 15:14:07 Finished checking Spamhaus blocklist
09/11/2010 15:14:07 Checking local username blocklist
09/11/2010 15:14:07 Finished checking local username blocklist
09/11/2010 15:14:07 Checking local email blocklist
09/11/2010 15:14:07 Registration blocked by local email blocklist
09/11/2010 15:14:07 Finished checking local email and Undisposable blocklist
09/11/2010 15:14:07 REGISTRATION BLOCKED: Email address or domain is on internal block list
09/11/2010 15:14:07 Redirecting to www.***************.org/index.php?option...w=article&id=150

Re:Redirects not working correctly - another user! 9 years, 6 months ago #1542

  • jkinane
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Karma: 0
Having looked at the code in cedit_blockdisposable.php I can't see any reference to the database field which contains the URL relating to the Contact Form. See this entry in the xml data which sets up the Contact URL:

<param name="redirectaddresscontact" type="textarea" cols="30" rows="2" default="" label="Contact Redirect URL" description="This is the URL to which the user will be redirected their details fail the contact form validation check."/>

I'm not a php programmer, but what I did was to create a second variable which sets the Contact redirect URL and use that variable in the code which handles a positive hit on the Contact form.

line 99 to set a new variable:
$redirectcontact = $this->_params->get('redirectaddresscontact','');

line 281 - 288 now reference the new variable:

// Contact form submission blocked
JRequest::setVar( 'task', '' );
if ( $redirectcontact == '' ) {
$redirectcontact = "index.php?option=com_contact&view=contact&id=" . JRequest::getVar('id' ) . "&Itemid=" . JRequest::getVar('Itemid' );
}
plgSystemCedit_BlockDisposable::Log( 'Contact form blocked - redirecting to ' . $redirectcontact);
plgSystemCedit_BlockDisposable::CloseLogFile();
$mainframe->redirect( $redirectcontact, $blockReason );


As I say, I'm no php programmer, but this works ok, despite its ugliness!

Re:Redirects not working correctly - another user! 9 years, 6 months ago #1543

  • jkinane
  • OFFLINE
  • Fresh Boarder
  • Posts: 8
  • Karma: 0
Ok - here's a much simpler fix. Instead of the several changes in previous post, just insert the following after line 282 in the original 1.3.3 version:

$redirect = $this->_params->get('redirectaddresscontact','');
Last Edit: 9 years, 6 months ago by jkinane.
  • Page:
  • 1
Time to create page: 0.19 seconds
Copyright © 2009 www.cedit.biz. All rights reserved.