We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17340
    • 70 Posts
    we have a page giving multiple choices with links
    (in the document content section <a..>-type) among them to pages that this or that individual user is not authorised to.

    naturally he/she ends up on the standard site-wide Tools/Configuration-indicated unauthorised-page.

    we would like him to stay in such case on the link-page itself or go to an unauthorised pages written for that situation.

    is there a way to change the standard unauthorised-page, is there a tag we overlook?
    can we determine which individual -depending on the situation- unauthorised pages users should be directed to?

    in other words is there a possibility of having alternative unauthorised pages?

    thanks for pointing in the right direction
    lmv

      • 25663 MODX Staff
      • 12,272 Posts
      Sorta... create a series of user groups for your different users. On the unauthorized page create a snippet that then forwards to the "real" unauthorized page for that group. We did something similar recently for another use, but this would work. It showed either a client or a staff dashboard in the menu, one page that redirected to the real location based on the user group, effectively a conditional weblink but using a document instead.

      <?php
      // redirect to doc ID 100 (staff dashboard) if a member of staff, otherwise redirect to 101 (user dashboard)
      
      $docId= $modx->isMemberOfWebGroup(array('Staff')) ? $modx->makeUrl('100') : $modx->makeUrl('101');
      
      if ($docId) $modx->sendRedirect($docId);
      ?>
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 17340
        • 70 Posts
        Great Ryan, thanks !

        That is a good direction to go to

        thanks again, lmv
          • 17340
          • 70 Posts
          and for the record: it works like a charm !!

          boy do I love MODx & its creators
          lmv