×
Kunena 5.1.7 Released - Security Release (20 Nov 2018)

The Kunena team has announce the arrival of Kunena 5.1.7 [K 5.1.7] which is now available for download as a native Joomla extension for J! 3.9.x. This version addresses most of the issues that were discovered in K 5.1 and issues discovered during the development stages of K 5.1. This is a Security release.

Question Stop Forumspam not validate api key

More
4 months 2 days ago - 4 months 2 days ago #1 by templatesROYAL
I noticed today that after moving to Kunena 5.1 (currently 5.1.2) the API key is no longer recognized or can not be validated.

Message (when creating a USER BAN):

Error while reporting the user to stopforumspam.com. Reason given: could not validate api key



I use the key for years in Kunena and the code will show in the Stop Forum Spam User Panel displayed under API Keys. I suspect the error is in Kunena.

In the older versions of Kunena the key works fine!

This message contains confidential information

Database collation check: The collation of your table fields are correct

Joomla! SEF: Enabled | Joomla! SEF rewrite: Enabled | FTP layer: Disabled |

This message contains confidential information
htaccess: Exists | PHP environment: Max execution time: 300 seconds | Max execution memory: 100M | Max file upload: 8M

Kunena menu details:

Warning: Spoiler! [ Click to expand ]

Joomla default template details : ja_playstore | author: JoomlArt.com | version: 1.0.8 | creationdate: June 8, 2018

Kunena default template details : Crypsisb3 | author: Kunena Team | version: 5.1.2 | creationdate: 2018-07-15

Kunena template params:

Warning: Spoiler! [ Click to expand ]

Kunena version detailed: Kunena 5.1.2 | 2018-07-15 [ Charon ]
| Kunena detailed configuration:

Warning: Spoiler! [ Click to expand ]
| Kunena integration settings:
Warning: Spoiler! [ Click to expand ]
| Joomla! detailed language files installed:
Warning: Spoiler! [ Click to expand ]

Third-party components: None

Third-party SEF components: None

Plugins: Search - Kunena Search 5.1.1

Modules: Kunena Latest 5.1.1 | Kunena Stats 5.1.1 | Kunena Login 5.1.1

Last edit: 4 months 2 days ago by templatesROYAL.
The following user(s) said Thank You: ssnobben

Please Log in or Create an account to join the conversation.

More
4 months 2 days ago #2 by xillibit
Hello,

Can-you check please if in Kunena configuration settings the api key for stop forum spam is still here ?

I don't provide support by PM, because this can be useful for someone else.

Please Log in or Create an account to join the conversation.

More
4 months 2 days ago - 4 months 2 days ago #3 by templatesROYAL
That was my first way :-)



There is also an error in the german translation. But this is not the problem :-)

I create a new key at Stop Forum Spam. Same error!
Last edit: 4 months 2 days ago by templatesROYAL.

Please Log in or Create an account to join the conversation.

More
4 months 2 days ago #4 by xillibit
It could be an issue when Kunena isn't able to contact stopforumspamservice, in your php.ini do-you have fopen or curl enabled ? Or both ?

I don't provide support by PM, because this can be useful for someone else.

Please Log in or Create an account to join the conversation.

More
3 months 4 weeks ago - 3 months 3 weeks ago #5 by templatesROYAL
I change nothing in my settings. In Kunena 4.x this works great. In Kunena 5.x donĀ“t!

When i disable allow_url_fopen i get: Cannot use a stream transport when "allow_url_fopen" is disabled.

Last edit: 3 months 3 weeks ago by templatesROYAL.

Please Log in or Create an account to join the conversation.

More
3 months 3 weeks ago #6 by purezen
I experienced the exact same problem last week, with Kunena 5.1.2.
Stop Forum Spam has worked perfectly for many years in Kunena.
I assumed that the Stop Forum Spam website had stopped working properly, because I hadn't changed any settings in Kunena and my API key was still there and valid.

Please Log in or Create an account to join the conversation.

More
3 months 3 weeks ago - 3 months 3 weeks ago #7 by templatesROYAL
I check with my hosting the server settings. All server settings OK. We think the problem is in the Kunena file!

But i do not find any wrong code line here:
/**
	 * Reports a user to stopforumspam.com
	 *
	 * @param $userid
	 *
	 * @return boolean
	 * @since Kunena
	 */
	protected function report($userid)
	{
		if (!$this->config->stopforumspam_key || !$userid)
		{
			return false;
		}
 
		$spammer = Factory::getUser($userid);
 
		$db = Factory::getDBO();
		$db->setQuery("SELECT ip FROM #__kunena_messages WHERE userid=" . $userid . " GROUP BY ip ORDER BY `time` DESC", 0, 1);
		$ip = $db->loadResult();
 
		// Check if mail adress is valid before to send the report
 
		$options = new \Joomla\Registry\Registry;
 
		$transport = new \Joomla\CMS\Http\Transport\StreamTransport($options);
 
		// Create a 'stream' transport.
		$http = new \Joomla\CMS\Http\Http($options, $transport);
 
		$data = "username[]=" . $spammer->username . "&ip_addr[]=" . $ip . "&email[]=" . $spammer->email . "&api_key[]=" . $this->config->stopforumspam_key;
 
		$response = $http->post('https://api.stopforumspam.com/add', $data);
 
		if ($response->code == '200')
		{
			// Report accepted. There is no need to display the reason
			$this->app->enqueueMessage(JText::_('COM_KUNENA_STOPFORUMSPAM_REPORT_SUCCESS'));
 
			return true;
		}
		else
		{
			// Report failed or refused
			$reasons = array();
			preg_match('/<p>.*<\/p>/', $response->body, $reasons);
 
			// Stopforumspam returns only one reason, which is reasons[0], but we need to strip out the html tags before using it
			$this->app->enqueueMessage(JText::sprintf('COM_KUNENA_STOPFORUMSPAM_REPORT_FAILED', strip_tags($reasons[0])), 'error');
 
			return false;
		}
	}
Last edit: 3 months 3 weeks ago by templatesROYAL.

Please Log in or Create an account to join the conversation.

More
3 months 2 weeks ago - 3 months 2 weeks ago #8 by purezen
Every spam post I have reported for last couple of weeks has failed.
It definitely appears that something has become broken in latest Kunena build.

Does this function interact with custom Kunena Templates ?
I am using an up-to-date 9themestore template.
OR
Is does this function have nothing to do with the template design you use ?

Attachments:
Last edit: 3 months 2 weeks ago by purezen.

Please Log in or Create an account to join the conversation.

More
3 months 2 weeks ago - 3 months 2 weeks ago #9 by templatesROYAL

purezen wrote: Does this function interact with custom Kunena Templates ?
I am using an up-to-date 9themestore template.
OR
Is does this function have nothing to do with the template design you use ?


I use for testing Crypsis 3 (Kunena Template) original. Same problem! The TEMPLATE is not the problem (custom or not)!

The only thing you can do is: fopen and/or curl enabled in your php.ini (i have both enabled)
Last edit: 3 months 2 weeks ago by templatesROYAL.
The following user(s) said Thank You: purezen

Please Log in or Create an account to join the conversation.

More
3 months 2 weeks ago #10 by purezen

templatesROYAL wrote:

purezen wrote: The only thing you can do is: fopen and/or curl enabled in your php.ini (i have both enabled)


I already have both of these enabled on the server.

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to add attachements.
  • Not Allowed: to edit your message.
Time to create page: 0.197 seconds