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

OverlayTrigger requires login

Discussion in 'XenForo Development Discussions' started by MtoR, May 24, 2015.

  1. MtoR

    MtoR Well-Known Member


    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.

  2. Chris D

    Chris D XenForo Developer Staff Member

    The account controller has a _preDispatch action:
     * Enforce registered-users only for all actions in this controller
     * @see library/XenForo/XenForo_Controller#_preDispatch($action)
    protected function _preDispatch($action)
  3. Jake B.

    Jake B. Well-Known Member

    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:

    protected function _preDispatch($action)
        if (
    $action != 'yourAction')
  4. MtoR

    MtoR Well-Known Member

    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.

Share This Page