join form not submiting, only works when removing email block

Help!! Help!!

hello everyone, im also sick of these spammers, i tried to block emails by doing the following (see below). it did not work so I removed the code..Now when new members fill out the join form and click join at the bottom button the page does not go anywhere... nothing happens... I tried to trouble shoot and removed the e-mail block from admin profile fields and it works fine, members are able to join but without the e-mail field... can someone tell me what the hell happen?

what is the original code that goes in in the admin>profile fields>emai> advance>check ?

Thanks

running 7.0.8

 

Time ago, prolaznik has published another way for restrict some of email providers of spammer on registration, I've added the email to ban, and this works very well for me..

 

Step1.

/inc/ design.inc.php

at the end of the file find
bx_import('BxDolAlerts');

and add this ABOVE it.

function ForbidenEmailProvider($Email)

     {
     
       $ForbidenEmailProvider[] = "@163.com";

       $ForbidenEmailProvider[] = "@sohu.com";

       $ForbidenEmailProvider[] = "@21cn.com";

       $ForbidenEmailProvider[] = "@gmx.com";

       $ForbidenEmailProvider[] = "@126.com";

       $ForbidenEmailProvider[] = "@qq.com";

       $ForbidenEmailProvider[] = "@yahoo.cn";

       $ForbidenEmailProvider[] = "@mx8168.net";

       $ForbidenEmailProvider[] = "@110mail.net";

       $ForbidenEmailProvider[] = "@buybrandshop.info";

       $ForbidenEmailProvider[] = "@lenfos.com";

       $ForbidenEmailProvider[] = "@mailinator.com";

       $ForbidenEmailProvider[] = "@tom.com";

       $ForbidenEmailProvider[] = "@hotmilitararygirls.com";

       $ForbidenEmailProvider[] = "@speaktolearn.net";

       $ForbidenEmailProvider[] = "@qtyhosting.com";

       $ForbidenEmailProvider[] = "@12gohere.net";

       $ForbidenEmailProvider[] = "@boxedchristmascards.ne";

       $ForbidenEmailProvider[] = "@yeah.net";

       $ForbidenEmailProvider[] = "@free-medicine.net";

       $ForbidenEmailProvider[] = "@satiny.co.uk";

       $ForbidenEmailProvider[] = "@energyforthehome.com";

       $ForbidenEmailProvider[] = "@dunkssb.net";

       $ForbidenEmailProvider[] = "@pumpkincarving.org";

       $ForbidenEmailProvider[] = "@theory-test-practice.co.uk";

       $ForbidenEmailProvider[] = "@cooljordanshoestore.com";

       $ForbidenEmailProvider[] = "@betfairmethods.com";
    
       foreach($ForbidenEmailProvider as $key => $value)
          {
          if ( strpos("zyx".$Email,$value) > 0 )
             return false;
          }  

       return true;

     }



Step2.

in administration / builders / profile fields (join form)
edit the email field click on advanced and replace 

return (bool) preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0);

WITH THIS

return ( ForbidenEmailProvider($arg0) and preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0) );

Step3.

in administration / settings / languages settings look for 

_FieldError_Email_Check 

and edit the error msg. that's displayed, the default one is (please enter correct email) change to something like this

Invalid email address / or the email provider you are using is blacklisted.

or whatever you like.

That's it  you can add more email providers or remove some

$ForbidenEmailProvider[] = "@someprovider.";

 

Quote · 29 Nov 2011

original code is marked in red

return (bool) preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0);

i dont think anything changed in 7.08 but im not sure i didnt look.

Quote · 29 Nov 2011

Quote · 29 Nov 2011

This is the one from 7.0.8.

return (bool) preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0);



Looks the same to me.

https://www.deanbassett.com
Quote · 29 Nov 2011

 

 Did you try and upload a fresh copy of design.inc.php 

Extract  the 7.0.8 zip file to a folder on your PC, then upload it to your site.

Manually clear your /cache /public_cache, leaving the .htaccess files in both folders.

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 29 Nov 2011

If you removed the added coding and changed back the advance-->check field; did you clear your cache and cache_public manually via ftp (leaving .htaccess files in them)?

Quote · 29 Nov 2011

i tried to install a fresh copy of design.inc.php then cleared

cache and public cache via ftp but still no luck :(

 

Quote · 29 Nov 2011

What's your site url? Check your error log to see if any errors are there.

Quote · 29 Nov 2011

hello rhimpr,

errors on cpanel?

the site is [REDACTED]

 

[Redacted on request.]

Quote · 29 Nov 2011

i went to my cpanel error log and found this:

[Tue Nov 29 17:43:38 2011] [error] PHP Fatal error:  Function name must be a string in /home/xxxxx/public_html/LesFinder.com/inc/classes/BxDolProfileFields.php on line 378
[Tue Nov 29 17:43:38 2011] [error] PHP Parse error:  syntax error, unexpected '^' in /home/xxxxx/public_html/LesFinder.com/inc/classes/BxDolProfileFields.php(376) : runtime-created function on line 1

 

could this be the problem?

by the way thanks for the help so far.

Quote · 29 Nov 2011

 

i went to my cpanel error log and found this:

[Tue Nov 29 17:43:38 2011] [error] PHP Fatal error:  Function name must be a string in /home/xxxxx/public_html/LesFinder.com/inc/classes/BxDolProfileFields.php on line 378
[Tue Nov 29 17:43:38 2011] [error] PHP Parse error:  syntax error, unexpected '^' in /home/xxxxx/public_html/LesFinder.com/inc/classes/BxDolProfileFields.php(376) : runtime-created function on line 1

 

could this be the problem?

by the way thanks for the help so far.

Everything worked okay for me, are you sure you added the code on the right place inside the file inc/design.inc.php

 

$oForm = new BxTemplFormView($aForm);

    bx_import('BxDolAlerts');
    $sCustomHtmlBefore = '';
    $sCustomHtmlAfter = '';
    $oAlert = new BxDolAlerts('profile', 'show_login_form', 0, 0, array('oForm' => $oForm, 'sParams' => &$sParams, 'sCustomHtmlBefore' => &$sCustomHtmlBefore, 'sCustomHtmlAfter' => &$sCustomHtmlAfter, 'aAuthTypes' => &$aAuthTypes));
    $oAlert->alert();

    $sFormCode = $oForm->getCode();
   
    $sJoinText = (strpos($sParams, 'no_join_text') === false) ?
        '<div class="login_box_text">' . _t('_login_form_description2join', BX_DOL_URL_ROOT) . '</div>' :
        '';
   
    return $sCustomHtmlBefore . $sFormCode . $sCustomHtmlAfter . $sJoinText;
}

Add new code here

bx_import('BxDolAlerts');
$oZ = new BxDolAlerts('system', 'design_included', 0);
$oZ->alert();

Quote · 30 Nov 2011

hey okweb,

my concern is getting it back to working mode that allows member to submit the join form. it worked fine prior to attempting this mod. what ever I try does not seem to work. the send button on the join form does not do anything.

the only way i could get it to work is by going to admin>profile field and removing the email block.

 

I just don't get it...

Quote · 30 Nov 2011

i too tried this email block list on 7.0.8, unmodified version, and it would not work. had other things to do, so removed it, and moved on. 

When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support
Quote · 30 Nov 2011

hello

I have removed it and still can not get the join form to send.

I even uploaded a fresh copy of design.inc.php

Quote · 30 Nov 2011

Your sure your Advanced-->Check field is correct;

return (bool) preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0);

then you cleared cache's via admin and ftp

Quote · 30 Nov 2011

 yeah done all of that, will revisit it at a later date. and i clear the cache from SSH, so i know its cleared, quite tired of clearing the cache every time you click a button on this damned thing matter of fact. 

Your sure your Advanced-->Check field is correct;

return (bool) preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0);

then you cleared cache's via admin and ftp

 

When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support
Quote · 30 Nov 2011

 Was directed @Tony7,   but yes, same here; tired of clearing cache's...

 yeah done all of that, will revisit it at a later date. and i clear the cache from SSH, so i know its cleared, quite tired of clearing the cache every time you click a button on this damned thing matter of fact. 

Your sure your Advanced-->Check field is correct;

return (bool) preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0);

then you cleared cache's via admin and ftp

 

 

Quote · 30 Nov 2011

 yes I made sure that the check field is correct and cleared cache via ftp and in admin...

still not sending..

cpanel error log shows "[error] PHP Fatal error:  Function name must be a string in /home/xxxxx/public_html/LesFinder.com/inc/classes/BxDolProfileFields.php on line 378"

i think every time i try to submit a join form.

 

 

 Was directed @Tony7,   but yes, same here; tired of clearing cache's...

 yeah done all of that, will revisit it at a later date. and i clear the cache from SSH, so i know its cleared, quite tired of clearing the cache every time you click a button on this damned thing matter of fact. 

Your sure your Advanced-->Check field is correct;

return (bool) preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0);

then you cleared cache's via admin and ftp

 

 

 

untitled22.JPG · 30.9K · 159 views
Quote · 30 Nov 2011

 kewl beans, no inference. 

 

 

 Was directed @Tony7,   but yes, same here; tired of clearing cache's...

 yeah done all of that, will revisit it at a later date. and i clear the cache from SSH, so i know its cleared, quite tired of clearing the cache every time you click a button on this damned thing matter of fact. 

Your sure your Advanced-->Check field is correct;

return (bool) preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0);

then you cleared cache's via admin and ftp

 

 

 

When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support
Quote · 30 Nov 2011

still no luck guys, Im getting this error on cpanel

do you guys know what it means?

[Wed Nov 30 09:20:23 2011] [error] PHP Fatal error:  Function name must be a string in /home/xxxx/public_html/inc/classes/BxDolProfileFields.php on line 378
[Wed Nov 30 09:20:23 2011] [error] PHP Parse error:  syntax error, unexpected '^' in /home/xxxx/public_html/inc/classes/BxDolProfileFields.php(376) : runtime-created function on line 1

Quote · 30 Nov 2011

That error tells me that this line is not in there correctly.

return (bool) preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0);

It's crapping out at the ^

Complaining that it's not a string might indicate the ' at the beginning or end of the string is missing.

How are you entering this? Are you copying and pasting or are you manually typing it in?

https://www.deanbassett.com
Quote · 30 Nov 2011

 hello Deano,

I have been doing it by copy and paste over and over again

 

That error tells me that this line is not in there correctly.

return (bool) preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0);

It's crapping out at the ^

Complaining that it's not a string might indicate the ' at the beginning or end of the string.

How are you entering this. Are you copying and pasting or are you manually typing it in.

 

Quote · 30 Nov 2011

I even tried injecting the code straight on the database under sys_profile_fields >email

still get the same error...

Quote · 30 Nov 2011

I think im going to have to do a fresh install OMG going crazy here SMH

cant get this @#$% to work!!!

Quote · 30 Nov 2011

update: I was told to remove the code from admin>profile fields>advance>check box and leave it blank

and it worked, the join form does work when submited.

I went back and re-entered the code (copy and paste)

return (bool) preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0);

 

and again it did not allow new join forms to be sent.. wtf?? clueless

Quote · 30 Nov 2011

Not sure what else the issue could be besides not inputing check field correctly, a conflict with a mod you added or a file you change for the join form.  This only happened after you tried the restricted email providers?

You can try this in the check field and see if join form works with email validation. It does not solve your issues with the error using;   return (bool) preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0);  but it should get your site working again with join form and email address validating field for new members while you look for issue.

return (bool) filter_var($argo0, FILTER_VALIDATE_EMAIL);

Quote · 30 Nov 2011

I tried: 

return (bool) filter_var($argo0, FILTER_VALIDATE_EMAIL);

but now it keeps saying 'Please enter correct email" regardless of the email..

if I enter an e-mail already in use it does say that its already in use.

 

Not sure what else the issue could be besides a conflict with a mod you added or a file you change for the join form.  This only happened after you tried the restricted email providers?

You can try this in the check field and see if join form works with email validation. It does not solve your issues with the error using;   return (bool) preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0);  but it should get your site working again with join form and email validating for new members while you look for issue.

return (bool) filter_var($argo0, FILTER_VALIDATE_EMAIL);

 

Quote · 30 Nov 2011

 Sorry mis-typed.. try this;

return (bool) filter_var($arg0, FILTER_VALIDATE_EMAIL);

 

I tried: 

return (bool) filter_var($argo0, FILTER_VALIDATE_EMAIL);

but now it keeps saying 'Please enter correct email" regardless of the email..

if I enter an e-mail already in use it does say that its already in use.

 

Not sure what else the issue could be besides a conflict with a mod you added or a file you change for the join form.  This only happened after you tried the restricted email providers?

You can try this in the check field and see if join form works with email validation. It does not solve your issues with the error using;   return (bool) preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0);  but it should get your site working again with join form and email validating for new members while you look for issue.

return (bool) filter_var($argo0, FILTER_VALIDATE_EMAIL);

 

 

Quote · 30 Nov 2011

 yeah now it worked i was able to join and this message came up "Mail has been successfully sent.
You will receive it within a minute."

so this means what? does the member now have limited access until validating email?

 Sorry mis-type.. try this;

return (bool) filter_var($arg0, FILTER_VALIDATE_EMAIL);

I tried: 

return (bool) filter_var($argo0, FILTER_VALIDATE_EMAIL);

but now it keeps saying 'Please enter correct email" regardless of the email..

if I enter an e-mail already in use it does say that its already in use.

 

Not sure what else the issue could be besides a conflict with a mod you added or a file you change for the join form.  This only happened after you tried the restricted email providers?

You can try this in the check field and see if join form works with email validation. It does not solve your issues with the error using;   return (bool) preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0);  but it should get your site working again with join form and email validating for new members while you look for issue.

return (bool) filter_var($argo0, FILTER_VALIDATE_EMAIL);

 

 

 

Quote · 30 Nov 2011

It could be. It's all according to how you have it setup in;

admin-->settings-->moderation settings

Quote · 1 Dec 2011

I've figured out why the join button was ceasing to function for some on Prolaznik's fix...

In design.inc.php, the code in my file was different to others (unsure whether due to previous modifications or discrepancies between version 7.0.3 and other versions...

At the bottom of your design.inc.php, you should see the following two lines:-

$oZ = new BxDolAlerts('system', 'design_included', 0);
$oZ->alert();

What is directly above these two lines? If you don't see the following line, then this will likely fix the issue:-

bx_import('BxDolAlerts');

Copy and paste the following into your design.inc.php file above:-

$oZ = new BxDolAlerts('system', 'design_included', 0);
$oZ->alert();

===

//block registrations using specific email providers
function ForbidenEmailProvider($Email)

     {  
       $ForbidenEmailProvider[] = "@163.com";
       $ForbidenEmailProvider[] = "@sohu.com";
       $ForbidenEmailProvider[] = "@21cn.com";
       $ForbidenEmailProvider[] = "@gmx.com";
       $ForbidenEmailProvider[] = "@126.com";
       $ForbidenEmailProvider[] = "@qq.com";
       $ForbidenEmailProvider[] = "@yahoo.cn";
       $ForbidenEmailProvider[] = "@mx8168.net";
       $ForbidenEmailProvider[] = "@110mail.net";
       $ForbidenEmailProvider[] = "@buybrandshop.info";
       $ForbidenEmailProvider[] = "@lenfos.com";
       $ForbidenEmailProvider[] = "@mailinator.com";
       $ForbidenEmailProvider[] = "@tom.com";
       $ForbidenEmailProvider[] = "@hotmilitararygirls.com";
       $ForbidenEmailProvider[] = "@speaktolearn.net";
       $ForbidenEmailProvider[] = "@qtyhosting.com";
       $ForbidenEmailProvider[] = "@12gohere.net";
       $ForbidenEmailProvider[] = "@boxedchristmascards.ne";
       $ForbidenEmailProvider[] = "@yeah.net";
       $ForbidenEmailProvider[] = "@free-medicine.net";
       $ForbidenEmailProvider[] = "@satiny.co.uk";
       $ForbidenEmailProvider[] = "@energyforthehome.com";
       $ForbidenEmailProvider[] = "@dunkssb.net";
       $ForbidenEmailProvider[] = "@pumpkincarving.org";
       $ForbidenEmailProvider[] = "@theory-test-practice.co.uk";
       $ForbidenEmailProvider[] = "@cooljordanshoestore.com";
       $ForbidenEmailProvider[] = "@betfairmethods.com";
   
       foreach($ForbidenEmailProvider as $key => $value)
          {
          if ( strpos("zyx".$Email,$value) > 0 )
             return false;
          } 

       return true;

     }

bx_import('BxDolAlerts');

===

The entire bottom of your design,inc.php page should read:-

    $oForm = new BxTemplFormView($aForm);

    bx_import('BxDolAlerts');
    $sCustomHtmlBefore = '';
    $sCustomHtmlAfter = '';
    $oAlert = new BxDolAlerts('profile', 'show_login_form', 0, 0, array('oForm' => $oForm, 'sParams' => &$sParams, 'sCustomHtmlBefore' => &$sCustomHtmlBefore, 'sCustomHtmlAfter' => &$sCustomHtmlAfter, 'aAuthTypes' => &$aAuthTypes));
    $oAlert->alert();

    $sFormCode = '<div style="text-align: center; margin-top: 8px;"><a href="modules/?r=deanos_facebook_connect/login_form"><img border="0" src="' . BX_DOL_URL_ROOT . 'modules/deano/deanos_facebook_connect/templates/base/images/fbconnectbut.png"></a></div>' . $oForm->getCode();
   
    $sJoinText = (strpos($sParams, 'no_join_text') === false) ?
        '<div class="login_box_text">' . _t('_login_form_description2join', BX_DOL_URL_ROOT) . '</div>' :
        '';
   
    return $sCustomHtmlBefore . $sFormCode . $sCustomHtmlAfter . $sJoinText;
}

//block registrations using specific email providers
function ForbidenEmailProvider($Email)

     {  
       $ForbidenEmailProvider[] = "@163.com";
       $ForbidenEmailProvider[] = "@sohu.com";
       $ForbidenEmailProvider[] = "@21cn.com";
       $ForbidenEmailProvider[] = "@gmx.com";
       $ForbidenEmailProvider[] = "@126.com";
       $ForbidenEmailProvider[] = "@qq.com";
       $ForbidenEmailProvider[] = "@yahoo.cn";
       $ForbidenEmailProvider[] = "@mx8168.net";
       $ForbidenEmailProvider[] = "@110mail.net";
       $ForbidenEmailProvider[] = "@buybrandshop.info";
       $ForbidenEmailProvider[] = "@lenfos.com";
       $ForbidenEmailProvider[] = "@mailinator.com";
       $ForbidenEmailProvider[] = "@tom.com";
       $ForbidenEmailProvider[] = "@hotmilitararygirls.com";
       $ForbidenEmailProvider[] = "@speaktolearn.net";
       $ForbidenEmailProvider[] = "@qtyhosting.com";
       $ForbidenEmailProvider[] = "@12gohere.net";
       $ForbidenEmailProvider[] = "@boxedchristmascards.ne";
       $ForbidenEmailProvider[] = "@yeah.net";
       $ForbidenEmailProvider[] = "@free-medicine.net";
       $ForbidenEmailProvider[] = "@satiny.co.uk";
       $ForbidenEmailProvider[] = "@energyforthehome.com";
       $ForbidenEmailProvider[] = "@dunkssb.net";
       $ForbidenEmailProvider[] = "@pumpkincarving.org";
       $ForbidenEmailProvider[] = "@theory-test-practice.co.uk";
       $ForbidenEmailProvider[] = "@cooljordanshoestore.com";
       $ForbidenEmailProvider[] = "@betfairmethods.com";
   
       foreach($ForbidenEmailProvider as $key => $value)
          {
          if ( strpos("zyx".$Email,$value) > 0 )
             return false;
          } 

       return true;

     }

bx_import('BxDolAlerts');     
$oZ = new BxDolAlerts('system', 'design_included', 0);
$oZ->alert();

if ((int)$_GET['idAff'])
    BxDolService::call('inviter', 'accept_affiliate', array());

?>

 

Then also follow the other steps from Prolaznik:-

Step2.

in administration / builders / profile fields (join form)
edit the email field click on advanced and replace 

return (bool) preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0);

WITH THIS

return ( ForbidenEmailProvider($arg0) and preg_match('/^([a-z0-9\+\_\-\.]+)@([a-z0-9\+\_\-\.]+)$/i', $arg0) );

Step3.

in administration / settings / languages settings look for 

_FieldError_Email_Check 

and edit the error msg. that's displayed, the default one is (please enter correct email) change to something like this

Invalid email address / or the email provider you are using is blacklisted.

or whatever you like.

That's it  you can add more email providers or remove some

$ForbidenEmailProvider[] = "@someprovider.";

Quote · 3 Jan 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.