Cloudflare unmasked IP

After upgrade to phpbb 3.3.0 works fine - Cloudflare unmasked IP

After upgrade to phpbb 3.3.0 works fine

by wonder_wonder » Thu Jan 09, 2020 11:54 pm

This extension, after ugrade to 3.3.0 of my phpbb, works fine.

Regards.
wonder_wonder
Registered User
Posts: 125
Joined: Thu Feb 16, 2017 2:52 pm

Re: After upgrade to phpbb 3.3.0 works fine

by 3Di » Fri Jan 10, 2020 12:47 am

Thanks for feedback. ;)
๐Ÿ†“ Free support for our extensions also provided here: phpBB Studio
๐Ÿš€ Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity ยบ PhpStorm's proud user ยบ Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco

Re: After upgrade to phpbb 3.3.0 works fine

by EFiNSTORM » Sun Jan 12, 2020 1:09 am

If you disabled the extension and try to re-able it after it will not work. Cause of this

Code: Select all

public function is_enableable()
	{
		$config = $this->container->get('config');
		return phpbb_version_compare($config['version'], '3.1.10', '>=') && phpbb_version_compare($config['version'], '3.3.0dev', '<');
	}
User avatar
EFiNSTORM
Registered User
Posts: 164
Joined: Fri Dec 26, 2008 4:09 am
Location: localhost

Re: After upgrade to phpbb 3.3.0 works fine

by 3Di » Sun Jan 12, 2020 1:30 am

True, change it to

Code: Select all

public function is_enableable()
	{
		$config = $this->container->get('config');
		return phpbb_version_compare($config['version'], '3.1.10', '>=') && phpbb_version_compare($config['version'], '4.0.0@dev', '<');
	}
or

Code: Select all

public function is_enableable()
	{
		return true;
	}
๐Ÿ†“ Free support for our extensions also provided here: phpBB Studio
๐Ÿš€ Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity ยบ PhpStorm's proud user ยบ Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco

Re: After upgrade to phpbb 3.3.0 works fine

by wonder_wonder » Sun Jan 12, 2020 11:48 pm

I don't have this problem, I can disabled and re enable the extension with not errors and works fine for me, I don't made any change.
This is the content of my ext.php

Code: Select all

<?php
/**
 *
 * Cloudflare unmasked IP. An extension for the phpBB Forum Software package.
 *
 * @copyright (c) 2017, 3Di, http://3di.space/32/
 * @license GNU General Public License, version 2 (GPL-2.0)
 *
 */

namespace threedi\cloudflareunmaskedip;

/**
 * Cloudflare unmasked IP Extension base
 */
class ext extends \phpbb\extension\base
{
	/**
	 * Check whether or not the extension can be enabled.
	 *
	 * @return bool
	 */
	public function is_enableable()
	{
		/* @return bool */
		$bb3110 = ( phpbb_version_compare(PHPBB_VERSION, '3.1.10', '>=') && phpbb_version_compare(PHPBB_VERSION, '3.2.0@dev', '<') );

		/* @return bool */
		$bb320 = ( phpbb_version_compare(PHPBB_VERSION, '3.2.0', '>=') );

		/**
		 * We rely on constants.php because this extension uses
		 * just one PHP event not present in lesser versions/releases.
		 */
		if ( ($bb320) || ($bb3110) )
		{
			return true;
		}
		else
		{
			SELF::verbose_it();
		}
	}

	/**
	 * Let's tell the user what exactly is going on and provide a back-link.
	 * Using the User Object for BC.
	 */
	function verbose_it()
	{
		$this->container->get('user')->add_lang_ext('threedi/cloudflareunmaskedip', 'common');

		trigger_error($this->container->get('user')->lang['EXTENSION_REQUIREMENTS_NOTICE'] . adm_back_link(append_sid('index.' . $this->container->getParameter('core.php_ext'), 'i=acp_extensions&amp;mode=main')), E_USER_WARNING);
	}
}
Regards
wonder_wonder
Registered User
Posts: 125
Joined: Thu Feb 16, 2017 2:52 pm

Re: After upgrade to phpbb 3.3.0 works fine

by 3Di » Mon Jan 13, 2020 12:35 am

I think EFiNSTORM use another extension, I gave him the fix anyway.
๐Ÿ†“ Free support for our extensions also provided here: phpBB Studio
๐Ÿš€ Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity ยบ PhpStorm's proud user ยบ Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco

Re: After upgrade to phpbb 3.3.0 works fine

by wonder_wonder » Mon Jan 13, 2020 1:19 am

Its possible, I think the same.
Regards.
wonder_wonder
Registered User
Posts: 125
Joined: Thu Feb 16, 2017 2:52 pm