We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6726
    • 7,075 Posts
    I am currently in need of giving access to authenticated web users to MCPUK to update an image TV in the context of an FDM form.

    Jeff hinted here that it would be possible to replace the manager check with a webuser check.

    Now if I am not wrong, the code which limits the access to manager users is in [tt]manager/media/browser/mcpuk/connectors/php/config.php[/tt]

    /** 
    * Security check user MUST be logged into manager
    * before being able to run this script
    */
    startCMSSession();
    if(!isset($_SESSION[’mgrValidated’])) {
    die("<b>INCLUDE_ORDERING_ERROR</b>

    Please use the MODx Content Manager instead of accessing this file directly.");
    }

    (...)

    // Override system settings with user settings
    define(’IN_MANAGER_MODE’, ’true’); // set this so that user_settings will trust us.
    include("../../../../../includes/settings.inc.php");
    include("../../../../../includes/user_settings.inc.php");


    How could I check that the user is logged in as a webuser ?
    Maybe even slightly better, add check that he belongs to a given web user group ?

    How about

    if($modx->getLoginUserName() !=’’) {  

    ?

    Thanks for any pointer !

      .: COO - Commerce Guys - Community Driven Innovation :.


      MODx est l&#39;outil id
      • 6726
      • 7,075 Posts
      It would seem there is also

      $_SESSION[’webInternalKey’]

      Hmmm, might be worth looking into !

      Something like

      if(!isset($_SESSION[’webInternalKey’])) {
        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l&#39;outil id