We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37099
    • 338 Posts
    Suppose I’m writing a module for the manager, ie you have to log in to use it.

    In the module I include a file /modules/mymodule/myincludefile.php

    It would be possible for someone not logged in to access this file if they guessed the name.

    Is there some code I can include in this file that will only let it be used if called from the manager

    Cheers
    Mike
      • 37099
      • 338 Posts
      Put

      if(!isset($modx)){
      exit();
      }


      at the top of each included file.