Anti Spam ACP

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Re: Anti Spam ACP

Post by EXreaction »

If one file is not updated to 3.0.6 it is likely that others are not as well, this problem is affected by posting.php, but I would recommend you check others out too

craiga
Registered User
Posts: 191
Joined: Fri Apr 10, 2009 8:14 am
Contact:

Re: Anti Spam ACP

Post by craiga »

I altered a users roles so that any post is put in the moderation queue and when i post i get the following message
This message has been submitted successfully, but it will need to be approved by a moderator before it is publicly viewable. You will be notified when your post has been approved.
does this suggest the core phpbb files are up to date?

i still dont get the message when the antispam acp catches the post and puts it in a moderation queue

User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Re: Anti Spam ACP

Post by EXreaction »

No, 3.0.6 added a little code to the line that is checked where that message is displayed that is used by this mod. If the code wasn't updated to 3.0.6 it wouldn't check for the option that is specified by the mod at that point (just after the call to submit_post)

craiga
Registered User
Posts: 191
Joined: Fri Apr 10, 2009 8:14 am
Contact:

Re: Anti Spam ACP

Post by craiga »

EXreaction wrote:No, 3.0.6 added a little code to the line that is checked where that message is displayed that is used by this mod. If the code wasn't updated to 3.0.6 it wouldn't check for the option that is specified by the mod at that point (just after the call to submit_post)
From what i can see, the code looks like it is present (if i am looking at the right bit)

code lines 1127-1159 of posting.php

Code: Select all

			// START Anti-Spam ACP
			if ($asacp_is_spam)
			{
				$data['force_approved_state'] = false;
			}
			// END Anti-Spam ACP
			
			// The last parameter tells submit_post if search indexer has to be run
			$redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message, ($update_message || $update_subject) ? true : false);

						// START Anti-Spam ACP
			antispam::submit_post($mode, $data['post_id']);
			// END Anti-Spam ACP
			
			if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === true) && ($mode == 'post' || $mode == 'reply' || $mode == 'quote'))
			{
				$captcha->reset();
			}

			// Check the permissions for post approval. Moderators are not affected.
			if ((!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) || !empty($post_data['force_approved_state']))
			{
				meta_refresh(10, $redirect_url);
				$message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD'];
				$message .= (($user->data['user_id'] == ANONYMOUS) ? '' : ' '. $user->lang['POST_APPROVAL_NOTIFY']);
			}
			else
			{
				meta_refresh(3, $redirect_url);

				$message = ($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED';
				$message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $redirect_url . '">', '</a>');
			}
I compared my file with a fresh 3.0.6 version and they match, apart from the mod of course :D

User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Re: Anti Spam ACP

Post by EXreaction »

Oh, I see what the problem is. It's because it is checking of force_approved_state is empty in that place instead of if isset like it does in submit post. I've reported the bug and in it contains what you'd need to change to fix it:
http://www.phpbb.com/bugs/phpbb3/57715

craiga
Registered User
Posts: 191
Joined: Fri Apr 10, 2009 8:14 am
Contact:

Re: Anti Spam ACP

Post by craiga »

EXreaction wrote:Oh, I see what the problem is. It's because it is checking of force_approved_state is empty in that place instead of if isset like it does in submit post. I've reported the bug and in it contains what you'd need to change to fix it:
http://www.phpbb.com/bugs/phpbb3/57715

I changed the line and it still doesnt seem to be working. any idea? I cleared the cache and retried 3 times to make sure its not cache issue

posting.php

Code: Select all

// Check the permissions for post approval. Moderators are not affected.
			if ((!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ||     (isset($post_data['force_approved_state']) && !$post_data['force_approved_state']))
			{
				meta_refresh(10, $redirect_url);
				$message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD'];
				$message .= (($user->data['user_id'] == ANONYMOUS) ? '' : ' '. $user->lang['POST_APPROVAL_NOTIFY']);
			}
			else
			{
				meta_refresh(3, $redirect_url);

				$message = ($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED';
				$message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $redirect_url . '">', '</a>');
			}

craiga
Registered User
Posts: 191
Joined: Fri Apr 10, 2009 8:14 am
Contact:

Re: Anti Spam ACP

Post by craiga »

I guess the line that marks the post as spam is

Code: Select all

// START Anti-Spam ACP
			if ($asacp_is_spam)
			{
				$data['force_approved_state'] = false;
			}
			// END Anti-Spam ACP
i noticed that this sets $data and not $post_data which is checked in the following if statement

Code: Select all

if ((!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ||     (isset($post_data['force_approved_state']) && !$post_data['force_approved_state']))
			{
So i changed the top code to

Code: Select all

// START Anti-Spam ACP
			if ($asacp_is_spam)
			{
				$post_data['force_approved_state'] = false;
			}
			// END Anti-Spam ACP
this successfully displayed the moderation message :D , however it did not place the message into the moderation queue :( .

to do both should it be

Code: Select all

// START Anti-Spam ACP
			if ($asacp_is_spam)
			{
				$data['force_approved_state'] = false;
$post_data['force_approved_state'] = false;
			}
			// END Anti-Spam ACP
btw I have no clue what the difference is between $post_data and $data, so if i am suggesting something silly please say so

User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Re: Anti Spam ACP

Post by EXreaction »

Another bug it appears, someone used the wrong variable when they created that line.

I've updated the bug report:
http://www.phpbb.com/bugs/phpbb3/ticket ... t_id=57715

craiga
Registered User
Posts: 191
Joined: Fri Apr 10, 2009 8:14 am
Contact:

Re: Anti Spam ACP

Post by craiga »

thanks

User avatar
Ephemeraboy
Registered User
Posts: 331
Joined: Tue Dec 29, 2009 4:25 pm
Location: Bandung Kota Hujan
Name: Bernando Bona Tius Sianipar
Contact:

Re: Anti Spam ACP

Post by Ephemeraboy »

i dunno..
but when i have installed this MOD..(the latest)
when a new member registered..
and fill the loctaion field..
it says..
The field “Location” is too long, a maximum of 0 characters is allowed.
My diary, my notepad, and my life on
http://www.bonatius.com
My online shop at
http://www.nefara.com

potiron
Registered User
Posts: 61
Joined: Wed Dec 01, 2004 9:55 am

Re: Anti Spam ACP

Post by potiron »

I had a conflict with the Profile Fields Control MOD

I explained my problem here: as I display the field location as optional in the registration screen I have the error message if the user tries to fill it:
The field “Location” is too long, a maximum of 0 characters
After a few investigation, I found the conflict:

This mode is conflicting with the MOD Anti-Spam ACP, in the file:
ucp_register.php

The problem is when you check the validation here:

Code: Select all

			// validate custom profile fields
			$cp->submit_cp_field('register', $user->get_iso_lang_id(), $cp_data, $error);
			
			if (!sizeof($error))
			{
				if ($data['new_password'] != $data['password_confirm'])
				{
					$error[] = $user->lang['NEW_PASSWORD_ERROR'];
				}

				if ($data['email'] != $data['email_confirm'])
				{
					$error[] = $user->lang['NEW_EMAIL_ERROR'];
				}
			}
			
			// START Anti-Spam ACP
			antispam::ucp_register($data, $error);
			// END Anti-Spam ACP

			if (!sizeof($error))
			{
				$server_url = generate_board_url();
Therefore I did apply all the changes for the Anti-Spam ACP on that file only, BUT I COMMENTED this call such as:

Code: Select all

			// validate custom profile fields
			$cp->submit_cp_field('register', $user->get_iso_lang_id(), $cp_data, $error);
			
			if (!sizeof($error))
			{
				if ($data['new_password'] != $data['password_confirm'])
				{
					$error[] = $user->lang['NEW_PASSWORD_ERROR'];
				}

				if ($data['email'] != $data['email_confirm'])
				{
					$error[] = $user->lang['NEW_EMAIL_ERROR'];
				}
			}
			
			// START Anti-Spam ACP
			//Comment the line below as it conflicts with MOD 
			//antispam::ucp_register($data, $error);
			// END Anti-Spam ACP

			if (!sizeof($error))
			{
				$server_url = generate_board_url();
And it works fine for me, a user can now register and type a Location value without the message:
The field “Location” is too long, a maximum of 0 characters

2nd METHOD:

Otherwise, need to be allowed in ACP:
Display allowed profile fields during registration:
If set to yes, any fields marked as allowed in the Profile Fields settings will be displayed during registration (except the Signature field).

But all the fields are displayed and you loose control.

craiga
Registered User
Posts: 191
Joined: Fri Apr 10, 2009 8:14 am
Contact:

Re: Anti Spam ACP

Post by craiga »

I had a spammer visit today and this mod caught his/her posts and put them in a moderation queue :D

my users had no idea i was spammed :D

mutank
Registered User
Posts: 158
Joined: Mon Jan 05, 2009 4:47 pm
Location: Toronto, ON
Name: Dominic Struczynski
Contact:

Re: Anti Spam ACP

Post by mutank »

I installed this MOD, and it does not stop posts from going through when spam words are in the post.

I tried configuring it and trying to fix it, but it still goes through.

I don't hit any error messages or anything.

potiron
Registered User
Posts: 61
Joined: Wed Dec 01, 2004 9:55 am

Re: Anti Spam ACP

Post by potiron »

Strange. It works very well for me... and stop posts with spam words. Probelem is: I never see any spam log.

JBVanHorn
Registered User
Posts: 1
Joined: Fri Mar 19, 2010 8:31 pm
Name: Joe V

Re: Anti Spam ACP

Post by JBVanHorn »

I tried to use the .xml file to see how to install this mod but it will not open. Is there any other form of instructions?

Locked

Return to “[3.0.x] MOD Database Releases”