Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted November 18, 20231 yr 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: - Login methods: - Account Settings: Thank you.
November 20, 20231 yr 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.
November 20, 20231 yr 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.
November 20, 20231 yr Author Is this information available here somewhere ? Is there any method to add in my Application() to toggle the app state or do I need a hook? In case it is a hook, will it be available on IPS5?
November 20, 20231 yr 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.
November 20, 20231 yr Author 7 minutes ago, Daniel F said: You'll still have to disable it when the application is disabled. Via a hook?
November 20, 20231 yr We have literally a method for this. Just implement it in your application class. /** * Toggle Enabled/Disable * * @return void */ protected function enableToggle()
November 20, 20231 yr Author 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.
November 20, 20231 yr 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 ) );
November 20, 20231 yr Author 50 minutes ago, teraßyte said: Or you can also extend Not sure this will be available somehow in V5 so I’ll go with the postToggleEnable. 👍 Edited November 20, 20231 yr by Adriano Faria
January 24, 20241 yr Solution 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.