We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37514
    • 178 Posts
    I have a MODx install with four or five domains and subdomains. Users log in from the main domain ( www.domain.com/manager ) Currently, when they try to preview documents outside of the domain they used to log in ( www.domain.com ) they cannot preview them (for example, subdomain.domain.com/document.html )

    I guess this is probably a permissions issue? What do I need to change?
      • 33968
      • 863 Posts
      Are your multiple domains in different contexts? If so, you need to give your manager users access to those contexts with View permissions.

      Security > Access Controls > User Groups tab

      Right-click on the usergroup containing your users, and select Update.

      Now go to the Context Access tab and add a new entry for each of your contexts, with Load, List & View permissions and minimum role of Member.

      Hope that works for you Jim!
        • 37514
        • 178 Posts
        Thanks Lucas, you're right that I have separate contexts.

        I tried as you suggested but that doesn't seem to help. Thinking about it, I am logged in as a super user and still don't get a preview of unpublished documents. As super user I shouldn't need additional permissions?

        I can of course view the documents once they are published … and I can preview documents in the web context … just not the others!

        Perhaps MODx doesn't recognise the preview request as coming from a logged in user in the subdomains?
          • 33968
          • 863 Posts
          When setting up new contexts you need to assign at least basic view permissions to yourself otherwise you will not be able to view pages in that context.

          Right-click on your Administrator usergroup, go to the Context Access tab and add all contexts with the Administrator policy. Do the same for your other user groups but you'll need to give them a more limited access policy. I'm pretty sure that's the issue you're having here...

          Permissions can become fiddly and at times very frustrating, but once you fully understand how they work you'll realise it's a very logical and well thought out system.
          • Jim,

            By default, your session cookie is set to your domain. If you want to be "logged in" as well for your subdomains you'll need to go to the modx system settings and set session_cookie_domain to ".yourdomain.com" (see the dot at the beginning). That way, your ACLs will work for your entire domain & sub domains managed by modx.

            Hope that will help.
            Cheers
              • 37514
              • 178 Posts
              Hi Romain, thanks for that. That sounds like the problem. How do I modify session_cookie_domain for multiple domains? .yourdomain.com plus .myotherdomain.com for instance?
                • 37514
                • 178 Posts
                Let me rephrase that … clearly I can't set a cookie ID across multiple domains. So is there any way to preview multiple domains in MODx Revo currently?
                  • 9536
                  • 0 Posts
                  I have exactly the same problem sad Any solutions?
                  • No, there's no way to establish a SESSION across multiple domains that are not subdomains. You would need to implement some kind of single-sign-on across all of your domains. Something that would set a secure indication that yes, this user is logged in here so go ahead and give him a logged-in session there. There are various protocols and server apps for doing this, like LDAP , OpenID and OAuth

                    http://www.php.net/manual/en/intro.ldap.php
                    http://openid.net/
                    http://www.php.net/manual/en/intro.oauth.php

                    These look interesting...

                    http://www.slideshare.net/ijansch/building-an-sso-platform-in-php-zend-webinar-edition
                    http://devzone.zend.com/1254/getting-started-with-openid-and-php/
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org