Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: quartzster on March 31, 2020, 04:22:29 PM

Title: policy agreement error
Post by: quartzster on March 31, 2020, 04:22:29 PM
using smf 2.0.1.7

have no idea how to fix this
would appreciate any help

8: Undefined index: require_policy_agreementApply Filter: Only show the errors from this fileFile: /home/*******/public_html/Themes/default/GenericControls.template.php (registration_agreement sub template - eval?)
Line: 53
Title: Re: policy agreement error
Post by: quartzster on April 02, 2020, 09:21:28 AM
This is the code

sCode: ', JavaScriptEscape($smiley['code']), ',
Title: Re: policy agreement error
Post by: quartzster on April 03, 2020, 08:44:02 AM
Am I doing something wrong here, that there are no responses?
Would appreciate any help
Title: Re: policy agreement error
Post by: Kindred on April 03, 2020, 11:30:16 AM
turn off eval, in the server settings screen of the admin.
Title: Re: policy agreement error
Post by: quartzster on April 03, 2020, 08:47:17 PM
Thank you so much for replying, I really appreciate it

I did what you said, and thought I had it beat, but later on

Apply Filter: Only show the error messages of this URLhttp://www.***.com/smf/index.php?action=registerApply Filter: Only show the errors with the same message8: Undefined index: require_policy_agreementApply Filter: Only show the errors from this fileFile: /home/******/public_html/Themes/default/Register.template.php
Line: 53   
Title: Re: policy agreement error
Post by: shawnb61 on April 03, 2020, 09:37:32 PM
Thanks for doing that.  It gave us more info!

Can you reproduce it?  Do you know what action triggers the error?  Are they frequent? 



Title: Re: policy agreement error
Post by: quartzster on April 04, 2020, 11:17:38 AM
There were several every day until I did what Kindred said

Now there were only two yesterday, and seems to me the error
is triggered by an IP addresses that I am pretty sure have nothing
to do with my forum. The majority of my members are in
Canada,

I have attached a screen shot...thank you so much for your help.
Title: Re: policy agreement error
Post by: quartzster on April 04, 2020, 01:53:27 PM
Just got another one, same IP as yesterday http://www.com/smf/index.php?action=trackip;searchip=185.232.21.27
Title: Re: policy agreement error
Post by: shawnb61 on April 04, 2020, 02:11:23 PM
How do you have guests configured?  Is everything default?  Or did you remove guest access for certain functions?
Title: Re: policy agreement error
Post by: shawnb61 on April 04, 2020, 06:54:04 PM
Another question: Have you enabled GDPR?

One more:  Is this a new install, or did you upgrade an existing forum?
Title: Re: policy agreement error
Post by: quartzster on April 04, 2020, 07:35:10 PM
GDPR....I would say no, because I don't know how to do that.

This is not a new install, has been running for years, and
I have only kept up with the suggested upgrades.

Everything is basically default for guests, except someone
who is not a registered member, cannot see contact info
for members, they cannot see the entries on simple portal,
or the forum Boards and sub Boards.

I am willing to provide the url to someone with knowledge
and experience to have a look, if they wish.

thanks again for the reply
Title: Re: policy agreement error
Post by: quartzster on April 09, 2020, 08:02:54 AM
I hope I didn't give the wrong impression that this issue is solved.
I am still getting several errors of this type per day.

If there is any other info I can provide, please let me know.
Title: Re: policy agreement error
Post by: Sir Osis of Liver on April 09, 2020, 05:25:57 PM
Does registration work?
Title: Re: policy agreement error
Post by: quartzster on April 12, 2020, 03:28:26 PM
Yes, the registration process seems to work well.

The error seems to be always caused by a "guest" which
makes sense if they are trying to register I guess.

But mostly caused by Ip's with spam complaints.

I have blocked those in Cpanel, but that doesn't seem
to always work that well.

I do get the odd legitimate member causing it as well.

Title: Re: policy agreement error
Post by: Sir Osis of Liver on April 12, 2020, 04:26:55 PM
Do you have coppa enabled?
Title: Re: policy agreement error
Post by: quartzster on April 13, 2020, 07:21:57 PM
yes I do as well as an additional question to be answered.
Title: Re: policy agreement error
Post by: Sir Osis of Liver on April 13, 2020, 10:39:29 PM
Sounds like the error is being caused by a mod.  If everything is working and you just want to stop the errors, you can make some fudge -

Register.template.php



// Age restriction in effect?

        if (!isset($context['require_policy_agreement']))
       $context['require_policy_agreement'] = null;

if ($context['show_coppa'])
echo '
<input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button_submit" /><br /><br />
<input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button_submit" />';
else
echo '
<input type="submit" name="accept_agreement" value="', $txt['agreement' . ($context['require_policy_agreement'] ? '_policy' : '') . '_agree'], '" class="button_submit" />';

Title: Re: policy agreement error
Post by: quartzster on April 14, 2020, 10:21:02 AM
Thank you very much, I will try that.

There are two...change them both?

Name
/public_html/smf/Themes/default/Register.template.php
/public_html/Themes/default/Register.template.php
Title: Re: policy agreement error
Post by: Doug Heffernan on April 14, 2020, 11:13:29 AM
Quote from: quartzster on April 14, 2020, 10:21:02 AM
Thank you very much, I will try that.

There are two...change them both?

Name
/public_html/smf/Themes/default/Register.template.php
/public_html/Themes/default/Register.template.php

You should change the one that is inside the forum folder that you are using, which by looking at your previous posts appears to be the one inside the smf folder.
Title: Re: policy agreement error
Post by: quartzster on April 14, 2020, 11:28:07 AM
thanks for your help
Title: Re: policy agreement error
Post by: Doug Heffernan on April 14, 2020, 11:40:51 AM
No problem
Title: Re: policy agreement error
Post by: quartzster on April 16, 2020, 10:57:01 AM
Quote from: doug_ips on April 14, 2020, 11:13:29 AM
Quote from: quartzster on April 14, 2020, 10:21:02 AM
Thank you very much, I will try that.

There are two...change them both?

unfortunately this did not work.

Name
/public_html/smf/Themes/default/Register.template.php
/public_html/Themes/default/Register.template.php

You should change the one that is inside the forum folder that you are using, which by looking at your previous posts appears to be the one inside the smf folder.
Title: Re: policy agreement error
Post by: quartzster on April 17, 2020, 08:51:09 AM
Changed both files, but still same problem.
Title: Re: policy agreement error
Post by: Sir Osis of Liver on April 17, 2020, 12:19:47 PM
Attach the edited file from the production install.
Title: Re: policy agreement error
Post by: quartzster on April 18, 2020, 05:59:46 PM
Hope this is right
Title: Re: policy agreement error
Post by: Sir Osis of Liver on April 18, 2020, 06:31:03 PM
Edit is correct.  Go into Admin -> Server Settings and check 'Disable evaluation of templates'.  Post the error.
Title: Re: policy agreement error
Post by: quartzster on April 18, 2020, 06:35:11 PM
Thank you....Disable evaluation of templates, is already checked...
Title: Re: policy agreement error
Post by: Sir Osis of Liver on April 18, 2020, 06:43:08 PM
What happens if you disable coppa?
Title: Re: policy agreement error
Post by: quartzster on April 18, 2020, 06:46:47 PM
ok, I have done that, now will have to wait and see.
Title: Re: policy agreement error
Post by: Sir Osis of Liver on April 18, 2020, 07:02:07 PM
Are you still getting this error?

Quote from: quartzster on April 03, 2020, 08:47:17 PM
Apply Filter: Only show the error messages of this URLhttp://www.***.com/smf/index.php?action=registerApply Filter: Only show the errors with the same message8: Undefined index: require_policy_agreementApply Filter: Only show the errors from this fileFile: /home/******/public_html/Themes/default/Register.template.php
Line: 53   

What triggers it?
Title: Re: policy agreement error
Post by: Sir Osis of Liver on April 18, 2020, 07:09:24 PM
Maybe it's coming from the source code.  If error persists, try this -

/Sources/Register.php



loadLanguage('Login');
loadTemplate('Register');

if (!isset($context['require_policy_agreement']))
$context['require_policy_agreement'] = null;

// Do we need them to agree to the registration agreement, first?
$context['require_agreement'] = !empty($modSettings['requireAgreement']);
$context['registration_passed_agreement'] = !empty($_SESSION['registration_agreed']);
$context['show_coppa'] = !empty($modSettings['coppaAge']);
$context['require_policy_agreement'] = !empty($modSettings['requirePolicyAgreement']);

// Under age restrictions?
if ($context['show_coppa'])
{
$context['skip_coppa'] = false;
$context['coppa_agree_above'] = sprintf($txt['agreement' . ($context['require_policy_agreement'] ? '_policy' : '') . '_agree_coppa_above'], $modSettings['coppaAge']);
$context['coppa_agree_below'] = sprintf($txt['agreement' . ($context['require_policy_agreement'] ? '_policy' : '') . '_agree_coppa_below'], $modSettings['coppaAge']);
}


Title: Re: policy agreement error
Post by: quartzster on April 18, 2020, 07:17:43 PM
yes I still get the error, it seems to appear when a spam ID appears as a guest.
If it persists, I will definitely try what you are suggesting.

thank you very much
Title: Re: policy agreement error
Post by: quartzster on April 20, 2020, 09:41:49 AM
I tried turning off the captcha that was a mistake, had six new spam members waiting
for admin approval.

made the change you suggested, we'll see what happens

thanks again

Title: Re: policy agreement error
Post by: quartzster on April 21, 2020, 10:50:45 AM
tried the code change suggested by Sir Osis of Liver, but it had no effect.

I get two or three spam IP's per day, I have them banned and also blocked
on the server in cPanel, but that just doesn't work. It is these spam IP's
that appear to cause the errors, i.e line 53 and today also line 1264, 1262
and 627...all caused by a guest.

This is not doing any harm to my forum, just annoying and I have to
clean out the log everyday.

I contacted the host and he says

Adding 185.232.21.28 to csf.deny and iptables DROP... DROP all opt -- in !lo out * 185.232.21.28 -> 0.0.0.0/0 LOGDROPOUT all opt -- in * out !lo 0.0.0.0/0 -> 185.232.21.28

I asked him if this was something he did or I would have to do, he responded

We can both do. However like I one can only place 1IP at a time. No xx.xxx.x/xx

still shaking my head.
Title: Re: policy agreement error
Post by: Kindred on April 21, 2020, 12:11:10 PM
1- banning IPs for perma ban in SMF is a bad process
2- If setting the IPs to DENY in your htaccess does not prevent them from accessing your site, then there is a MAJOR issue with your hosting configuration

3- preventing SPAM registrations -- the *BEST* way is to use good questions. Not Captcha.  Captcha is basically useless.
Title: Re: policy agreement error
Post by: quartzster on April 21, 2020, 12:18:10 PM
Kindred,

Thank you. I use Captcha plus one question, so
I can certainly change that.

I can remove the perma bans, and will check
my htaccess.

It always seems to be the same IP's, if I can
stop them from getting to the site I won't
have to worry about the errors.

thanks again
Title: Re: policy agreement error
Post by: Kindred on April 21, 2020, 12:19:21 PM
BTW: one question is not enough.
you need to have 20-30 questions and ask 2...
Title: Re: policy agreement error
Post by: quartzster on April 21, 2020, 12:23:31 PM
thank you, appreciate the info  :)
Title: Re: policy agreement error
Post by: quartzster on April 25, 2020, 01:13:41 PM
Hi folks,
So far I have tried everything suggested, but this morning  get these errors

   Apply Filter: Only show the error messages of this member Guest
Apply Filter: Only show the error messages of this IP address 62.210.79.40 
   Reverse chronological order of list Today at 05:58:37 AM
Apply Filter: Only show the error messages of this session 04b8de95f51eecbc2c67395025863365
Apply Filter: Only show the errors of this type Type of error: Undefined
Apply Filter: Only show the error messages of this URLhttp://xxx.com/smf/index.php?action=registerApply Filter: Only show the errors with the same message8: Undefined index: require_policy_agreementApply Filter: Only show the errors from this fileFile: /home/sc/public_html/Themes/default/Register.template.php
Line: 53
   Apply Filter: Only show the error messages of this member Guest
Apply Filter: Only show the error messages of this IP address 196.52.84.45 
   Reverse chronological order of list Today at 05:13:55 AM
Apply Filter: Only show the error messages of this session ee2d987efd5e7a3f8d9edd54b542de0c
Apply Filter: Only show the errors of this type Type of error: Undefined
Apply Filter: Only show the error messages of this URLhttp://www.xxx.com/smf/index.php?action=registerApply Filter: Only show the errors with the same message8: Undefined index: require_policy_agreementApply Filter: Only show the errors from this fileFile: /home/sc/public_html/Themes/default/Register.template.php
Line: 53
   Apply Filter: Only show the error messages of this member Guest
Apply Filter: Only show the error messages of this IP address 77.243.191.23 
   Reverse chronological order of list Today at 04:09:50 AM
Apply Filter: Only show the error messages of this session 5be0b3e54be6449d87f752488d227984
Apply Filter: Only show the errors of this type Type of error: Undefined
Apply Filter: Only show the error messages of this URLhttp://www.xxx.com/smf/index.php?action=registerApply Filter: Only show the errors with the same message8: Undefined index: require_policy_agreementApply Filter: Only show the errors from this fileFile: /home/sc/public_html/Themes/default/Register.template.php
Line: 53
   Apply Filter: Only show the error messages of this member Guest
Apply Filter: Only show the error messages of this IP address 196.52.84.45 
   Reverse chronological order of list Yesterday at 09:22:32 PM
Apply Filter: Only show the error messages of this session 3b2d9f5437a4ed4acdc9f40f045d5058
Apply Filter: Only show the errors of this type Type of error: Undefined
Apply Filter: Only show the error messages of this URLhttp://www.xxx.com/smf/index.php?action=registerApply Filter: Only show the errors with the same message8: Undefined index: require_policy_agreementApply Filter: Only show the errors from this fileFile: /home/sc/public_html/Themes/default/Register.template.php
Line: 53
   Apply Filter: Only show the error messages of this member Guest
Apply Filter: Only show the error messages of this IP address   
   Reverse chronological order of list Yesterday at 06:01:48 PM
Apply Filter: Only show the errors of this type Type of error: Undefined
Apply Filter: Only show the error messages of this URLhttp://www.xxx.com/smf/index.php?scheduled=task;ts=1587769200Apply Filter: Only show the errors with the same message8: Undefined index: character_setApply Filter: Only show the errors from this fileFile: /home/sc/public_html/smf/Sources/Subs-Post.php
Line: 1219
   Apply Filter: Only show the error messages of this member Guest
Apply Filter: Only show the error messages of this IP address   
   Reverse chronological order of list Yesterday at 06:01:48 PM
Apply Filter: Only show the errors of this type Type of error: Undefined
Apply Filter: Only show the error messages of this URLhttp://www.xxx.com/smf/index.php?scheduled=task;ts=1587769200Apply Filter: Only show the errors with the same message8: Undefined index: utf8Apply Filter: Only show the errors from this fileFile: /home/sc/public_html/smf/Sources/Subs-Post.php
Line: 1264
   Apply Filter: Only show the error messages of this member Guest
Apply Filter: Only show the error messages of this IP address   
   Reverse chronological order of list Yesterday at 06:01:48 PM
Apply Filter: Only show the errors of this type Type of error: Undefined
Apply Filter: Only show the error messages of this URLhttp://www.xxx.com/smf/index.php?scheduled=task;ts=1587769200Apply Filter: Only show the errors with the same message8: Undefined index: utf8Apply Filter: Only show the errors from this fileFile: /home/sc/public_html/smf/Sources/Subs-Post.php
Line: 1262
   Apply Filter: Only show the error messages of this member Guest
Apply Filter: Only show the error messages of this IP address   
   Reverse chronological order of list Yesterday at 06:01:48 PM
Apply Filter: Only show the errors of this type Type of error: Undefined
Apply Filter: Only show the error messages of this URLhttp://www.xxx.com/smf/index.php?scheduled=task;ts=1587769200Apply Filter: Only show the errors with the same message8: Undefined index: character_setApply Filter: Only show the errors from this fileFile: /home/sc/public_html/smf/Sources/Subs-Post.php
Line: 1219
   Apply Filter: Only show the error messages of this member Guest
Apply Filter: Only show the error messages of this IP address   
   Reverse chronological order of list Yesterday at 06:01:48 PM
Apply Filter: Only show the errors of this type Type of error: Undefined
Apply Filter: Only show the error messages of this URLhttp://www.xxx.com/smf/index.php?scheduled=task;ts=1587769200Apply Filter: Only show the errors with the same message8: Undefined index: serverApply Filter: Only show the errors from this fileFile: /home/sc/public_html/smf/Sources/Subs-Post.php
Line: 627
   Apply Filter: Only show the error messages of this member Guest
Apply Filter: Only show the error messages of this IP address 196.52.84.33 
   Reverse chronological order of list Yesterday at 02:03:38 PM
Apply Filter: Only show the error messages of this session a0f96cc6b78db0394b19a1393ed9045c
Apply Filter: Only show the errors of this type Type of error: Undefined
Apply Filter: Only show the error messages of this URLhttp://www.xxx.com/smf/index.php?action=registerApply Filter: Only show the errors with the same message8: Undefined index: require_policy_agreementApply Filter: Only show the errors from this fileFile: /home/sc/public_html/Themes/default/Register.template.php
Line: 53

this is the content of my .htaccess file

order allow,deny
deny from 77.243.255.255
deny from 37.113.184.0/21
deny from 185.232.21.0/28
deny from 178.216.48.130
deny from 196.52.84.0/24
deny from 178.216.48.130
deny from 196.52.84.0/24
deny from 185.0.0.0 - 185.255.255.255
deny from 196.0.0.0 - 196.255.255.255
allow from all

As you can see, I get many of the same I.P addresses
every day, despite the fact I have tried to block them
and somehow they are causing these errors.

any help appreciated
Title: Re: policy agreement error
Post by: Deaks on May 24, 2020, 03:47:15 PM
quartzster, did you get this fixed? If not please let us know I am going to mark as solved as its been a month.
Title: Re: policy agreement error
Post by: quartzster on May 24, 2020, 07:07:03 PM
no I did not...it is not solved as there are no more replies, but you
can lock it if you wish, no new ideas or methods I guess.