• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

OverlayTrigger requires login

MtoR

Well-known member
#1
Hello,

I have an OverlayTrigger link that make a call to an action of the Account ControllerPublic class (new action in extending class of my add-on).

If I am logged-in, the overlay popup opens with the content I expect.
However when I am not logged-in, the overlay popup opens with a "You must be logged-in etc..." with the logging fields.

Is there any checks in XenForo initialization that blocks some actions when not logged-in ?

I thought Overlay content loading was working for non logged-in as it works for the member card overlays.

Clément
 

Chris D

XenForo developer
Staff member
#2
The account controller has a _preDispatch action:
PHP:
/**
 * Enforce registered-users only for all actions in this controller
 *
 * @see library/XenForo/XenForo_Controller#_preDispatch($action)
 */
protected function _preDispatch($action)
{
    $this->_assertRegistrationRequired();
}
 

Jake B.

Well-known member
#3
What Chris Said ^

May be best not to use the account controller, but if you really want to use it for some reason you can add this to your controller that extends it:

PHP:
protected function _preDispatch($action)
{
    if ($action != 'yourAction')
    {
        parent::_preDispatch($action);
    }
}
 

MtoR

Well-known member
#4
Thanks for your answers, wasn't aware of that _preDispatch thing.

No I don't really want to use it, guess I will change of controller to perform what I want.