×
Kunena 5.2 Beta 1 Released (24 Sep 2020)

The Kunena team is thrilled to announce the first public beta release of Kunena 5.2, a native Joomla extension for Joomla 3.9. This is a development release and should be only be used for testing; this version is not recommended for live websites at this stage.

The purpose of this release is to encourage testing by downloading, installing and identifying any problems or shortcomings that people may discover. K 5.2.0 B1 is stable and we are aware that people will discover defects. We encourage you to use the forum to report defects, as soon as they are discovered, so that the development team can work through the problems before the release of K 5.1 as a stable product. Reporting defects does not mean that the problems can or will be fixed. The Kunena team is looking forward to hearing your feedback on how well we have achieved our design goals.

Question Stop Forumspam not validate api key

More
2 years 1 month ago - 2 years 1 month ago #1 by Gamer Templates
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!

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!

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

Warning: Spoiler!
| Kunena integration settings:
Warning: Spoiler!
| Joomla! detailed language files installed:
Warning: Spoiler!

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: 2 years 1 month ago by Gamer Templates.
The following user(s) said Thank You: ssnobben

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

More
2 years 1 month 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
2 years 1 month ago - 2 years 1 month ago #3 by Gamer Templates
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: 2 years 1 month ago by Gamer Templates.

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

More
2 years 1 month 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
2 years 1 month ago - 2 years 1 month ago #5 by Gamer Templates
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: 2 years 1 month ago by Gamer Templates.

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

More
2 years 1 month 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
2 years 1 month ago - 2 years 1 month ago #7 by Gamer Templates
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: 2 years 1 month ago by Gamer Templates.

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

More
2 years 1 month ago - 2 years 1 month 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: 2 years 1 month ago by purezen.

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

More
2 years 1 month ago - 2 years 1 month ago #9 by Gamer Templates

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: 2 years 1 month ago by Gamer Templates.
The following user(s) said Thank You: purezen

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

More
2 years 1 month 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 edit your message.
Time to create page: 0.383 seconds