Controller extension fails after update to XF1.5

rhodes

Active member
Within my XF1.3 installation I’ve extended my login controller like this
PHP:
class My_Login_Listener
{
  public static function listenController($class, array &$extend)
  {
  if ($class == 'XenForo_ControllerPublic_Login')
  {
  $extend[] = 'My_Login_Connector';
  }
  }
}

class My_Login_Connector extends XFCP_My_Login_Connector
{
  public function actionLogin()
  {
       ..do sth after XF login
This worked perfect in XF1.3, but unfortunately fails after update to XF1.5

It seems as if class XenForo_ControllerPublic_Login is not called any more. When I „echo“ the class names in the example above only XenForo_ControllerPublic_Index and XenForo_ControllerPublic_Forum are listed.

Of course I could replace XenForo_ControllerPublic_Login with XenForo_ControllerPublic_Index, but in this case my function would be executed every time the forum home page is viewed, not only after login.

Any idea what I can do to execute my function only after login in XF 1.5?
 
There is no error in the code you posted. The problem is likely rather in the body of your Login action. Btw, extending the completeLogin() method is probably more suitable for your case..
 
  • Like
Reactions: Xon
Top Bottom