Jump to content

[BUG] Apps that adds new longin methods


Go to solution Solved by Marc,

Recommended Posts

Posted

If you have a 3rd-party resource that adds a new login method and disables the app, the new login method keeps showing up in Login & Registration -> Methods tab and in Account Settings:

- Apps disabled:

Could contain: Page, Text

 

- Login methods:

Could contain: Page, Text

 

- Account Settings:

Could contain: File, Webpage, Page, Text

 

Thank you.

Posted

Thank you for bringing this issue to our attention! I can confirm this should be further reviewed and I have logged an internal bug report for our development team to investigate and address as necessary, in a future maintenance release.

 

Posted

I can't reproduce this. How have you implemented the handler?

Your code should update the login_enabled column in the core_login_methods table when the application gets disabled.

 

Posted

There was actually bug that resulted in disabled login handlers being still accessible, which I have fixed now.

You'll still have to disable it when the application is disabled.

Posted
32 minutes ago, Daniel F said:

We have literally a method for this. Just implement it in your application class.

	/**
	 * Toggle Enabled/Disable
	 *
	 * @return	void
	 */
	protected function enableToggle()

 

That works for node controllers (disable and app, plugin, etc.). Application class isn’t a controller. 

Posted

For Application.php you can use:

	/**
	 * Cleanup after saving
	 *
	 * @param	bool	$skipMember		Skip clearing member cache clearing
	 * @return	void
	 * @note	This is abstracted so it can be called externally, i.e. by the support tool
	 */
	public static function postToggleEnable( $skipMember=FALSE )
	{
		# Parent call
		parent:postToggleEnable( $skipMember );

		# Your code here
		# [...]
	}

 

Or you can also extend set_enabled():

	/**
	 * [Node] Set whether or not this node is enabled
	 *
	 * @param	bool|int	$enabled	Whether to set it enabled or disabled
	 * @return	void
	 */
	protected function set__enabled( $enabled )
	{
		# Parent call
		parent:set__enabled( $enabled );

		# Your code here
		# [...]
	}

They actually use set_enabled() to switch the application's tasks (which is what you want to do with the login handler):

		/* Update other app specific task statuses */
		\IPS\Db::i()->update( 'core_tasks', array( 'enabled' => (int) $this->enabled ), array( 'app=?', $this->directory ) );

 

  • 2 months later...
  • Solution
Posted

This issue has been resolved in the recently released 4.7.15 version. Please update your site if you are still experiencing the issue, and let us know if you see any reoccurrence.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...