We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15114
    • 102 Posts
    Hi,

    I try to develop an extra following this tutorial : http://rtfm.modx.com/display/revolution20/Developing+an+Extra+in+MODX+Revolution,+Part+II

    Almost everything seems to work, except one thing : I get a "Access denied" message when I try to list my items.

    I checked my ManagerController, the checkPermissions method return true, I have my getListProcessor, etc.

    I tried to debug and I found that in the class 'modConnectorResponse', in the function 'outputContent', the variable $siteId is not defined. But I don't know why.


    My system :
    - Windows 7 Pro
    - server Apache, PHP 5.2.17, MySQL 5.1.50 (Zend Server Community Edition)
    - MODX 2.2.0

      • 15114
      • 102 Posts
      Hi

      I opened this topic more than one year ago. Meanwhile I probably solved this issue but I don't remember how.

      Now I'm developing an other extra and I have the same problem again. I there a typical case where this can happens. The documentation ( http://rtfm.modx.com/display/revolution20/Developing+an+Extra+in+MODX+Revolution,+Part+II ) says :


      This file will do nothing on its own when access. Loading it directly will give you this:

      {"success":false,"message":"Access denied.","total":0,"data":[],"object":[]}

      There's a few reasons for this. One is that the connectors are locked down and don't allow anyone without a MODX manager session to access them. Secondly, all requests to connectors must pass a unique-to-your-site authorization key that prevents CRSF attacks. It can either be passed in the HTTP headers as 'modAuth', or in a REQUEST var as HTTP_MODAUTH. The value will be $modx->siteId, which is set on a new install, and loaded when MODX is loaded.

      The great thing, though, is you won't have to worry about this. MODX already handles this in MODExt - all HTTP requests made by ExtJS in MODX pass this variable in via their HTTP headers.

      Seems that in my case MODX doesn't handle that

      Julien