We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32963
    • 1,732 Posts
    You can try the manager/include/settings.inc.php file

    Note: When you do this you will break the core and will have to always manually apply the updates.

    Using plugins...
    What I would however suggest is that you create plugin that listens to the OnManagerLogin to execute your code. This will however only work once after login

    TP3 will feature the OnManagerInit event that will allow you to insert pieces of code like this so you don’t have to break the core. Sounds ok?

      xWisdom
      www.xwisdomhtml.com
      The fear of the Lord is the beginning of wisdom:
      MODx Co-Founder - Create and do more with less.
      • 8287
      • 12 Posts
      Thanks for the input. OK ... I have been doing some testing to see how this would work in my situation.


      Why not install modx 4 times? Each modx on its own url using the same database?
      Then use 4 diff templates each containing the menu routine with the proper page_id ?

      First of all, I need to use the same database with the same prefix ( xxx_ ) so I can have all the webusers access any of the sites. This is also important in making the business directory and images available to all sites.


      What I would however suggest is that you create plugin that listens to the OnManagerLogin to execute your code. This will however only work once after login

      I also needed to have the correct site called up by URL when visitors went to the site ... not just when someone logged in.

      The resolution I finally got to work was so simple ... it helps to get some sleep (and have help from above). As I had mentioned before, I have multiple sites created in the same prefixed-database. The documents for the home pages are IDs 10, 15, & 20. The main site_start document ID is 1.

      All I had to do was modify the above code to:

      <?php
      $MYURL = $_SERVER[’SERVER_NAME’];

      if (ereg(’myfirsturl’,$MYURL))
      ? {
      ? ?// this watches for www.myfirsturl.com or myfirsturl.com
      ? ?header(’Location: index.php?id=10’);
      ? }
      elseif (ereg(’mysecondurl’,$MYURL))
      ? {
      ? ?// this watches for www.mysecondurl.com or mysecondurl.com
      ? ?header(’Location: index.php?id=15’);
      ? }
      elseif (ereg(’mythirdurl’,$MYURL))
      ? {
      ? ?// this watches for www.mythirdurl.com or mythirdurl.com
      ? ?header(’Location: index.php?id=20’);
      ? }
      ?>
      put it in a snippet and call the snippet in the site_start page (id=1).

      This appears to be working ok. One concern I have (and I’m not sure if it should be a big concern) is how do I keep a visitor from calling up a published document under one of the other URLs by just manually typing in id=xx at the end of the line?

      For instance:
      id=10 is the home page for www.myfirsturl.com. IDs 11, 12, 13, 14 are other published documents under ID 10. What is to prevent someone from visiting through URL www.mythirdurl.com (id=20) and then just changing the id=20 to id=12 which would take them to different content.

      I assume this would be a problem on any Etomite or Modx site. If anyone has ideas on how to avoid this, please share them.

      Thanks again for all who helped.
      Dennis
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        If you are dealing with pages linked to specific document groups, only logged-in web users with access to that document group can access the page. If it’s a publicly viewable page, what does it matter?
          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
          • 30730
          • 3 Posts
          I was trying to solve this same problem, but in our case, we’ll be having multiple (say 20-30+) self contained sites for different groups, each with a different group of editors. All of the sites would follow the same template, and we’d want any changes to propagate down through without manual intervention.

          I’d like to run my "solution" (and I use that in the loosest sense of the word!) past some folks who know more than I do.

          What I did was to create a brand new site (new prefix of "new"). Then, I took these tables:

          new_categories
          new_site_htmlsnippets
          new_site_plugins
          new_site_snippets
          new_site_templates
          new_site_tmplvar_access
          new_site_tmplvar_templates
          new_site_tmplvars

          and dropped them, and then created a view in place of each table back to the real "modx_" table. I still need to do lots of testing, but my initial pass at it seemed to work.

          This leaves the users and groups to be managed on a per-site basis, but keeps the templates and site design in one place.

          Apart from the obvious (messing with an application’s database) can anyone tell me if this is a horrendously bad idea?


          Thanks!

          --Tim