We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12958
    • 9 Posts
    Quote from: BobRay at May 04, 2011, 03:10 AM

    Sorry, I misunderstood you.
    How are the users accessing the unpublished pages (e.g., Menu, direct entry of the URL in the browser, MODX link tag on the page, raw link code on a page)?

    They access the unpublished pages by all the ways you mentioned (Menu, direct entry of the URL and MODX link tags)

    Quote from: BobRay at May 04, 2011, 03:10 AM

    If I’m getting you,

    Quote from: BobRay at May 04, 2011, 03:10 AM

    1. The unpublished resources are in a context other than ’web’ or ’mgr’ and there is no Context Access ACL entry at all for that other context.
    These pages are in the subfolder of "web" in the resource-tree on the left part of the Backend as all our documents.

    Quote from: BobRay at May 04, 2011, 03:10 AM

    2. When you look at those resources in the Create/Edit Resource panel in the Manager, the published checkbox is unchecked.
    Yes

    Quote from: BobRay at May 04, 2011, 03:10 AM

    3. (anonymous) users, not logged in in either the front end or back end, can see the content of those resources in a separate browser and no one is logged in to the Manager in that browser at the time.
    Yes

    First, try deleting all the files in the core/cache directory. Then clear the browser cache and cookies in the other browser (the one you’ll be accessing the pages in). If you still see the resource content of those unpublished resources, it really sounds like a bug and should be reported here: http://bugs.modx.com/.
    OK. I will try it and post the results later.
      • 12958
      • 9 Posts
      I now deleted all the files and folders in the core/cache-folder. But the problem still exists. Do you have any idea why nobody else has this problem? Maybe this is a result of the configuration in our system settings?

      Thanks a lot again,
      Inka
        • 3749
        • 24,544 Posts
        How are the users accessing the unpublished pages (e.g., Menu, direct entry of the URL in the browser, MODX link tag on the page, raw link code on a page)?
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 12958
          • 9 Posts
          I can reproduce this problem by direct entry of the URL.

          Btw: We recently implemented a login-area by using this tutorial: http://rtfm.modx.com/display/revolution20/Making+Member-Only+Pages

          Maybe we did a mistake when implementing the login-area? Is there any step of the tutorial which could be responsible for our problems regarding the open access to everybody to the unpublished pages?
            • 3749
            • 24,544 Posts
            Ah . . . There are some serious problems with that tutorial.

            What are the policies assigned to the Members user group in your ACL entries?
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 18463
              • 121 Posts
              Martijn van Turnhout Reply #26, 13 years ago
              Are you using the latest version of Wayfinder?

              The &cacheResults parameter is automatically set to true, but that thingie doesn’t work properly. Set it to false and you’re good to go.
                • 12958
                • 9 Posts
                Quote from: BobRay at May 05, 2011, 11:40 AM

                Ah . . . There are some serious problems with that tutorial.

                What are the policies assigned to the Members user group in your ACLf entries?

                Clicking on "Access Controls" -> "update user group" -> "Context Access" shows for web: Member - 9999 and "Load only" -> "Resource Group Access" shows for "member": Member - 9999; Access Policy: "Resource" and Context: web
                  • 3749
                  • 24,544 Posts
                  Nothing obviously wrong there. I’m running low on ideas.

                  Look at the Load Only policy and make sure the view_unpublished permission is unchecked.

                  Look at the Administrator user group and make sure that (anonymous) is not a member.

                  See if (anonymous) is a member of any other user groups -- the (anonymous) user group should have no members.

                  BTW, I just checked and can confirm that unpublished resources are not viewable in the front end for not-logged-in users in my install of Revo.
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 12958
                    • 9 Posts
                    Hi Bob, we found the mistake smiley The problem is a plugin which enables single ssl-pages. Do you know what we have to correct in this plugin to hide unpublished resources for users not logged in?

                    <?php
                    if ($modx->event->name == 'OnWebPageInit') { 
                      //CONFIGURATION
                      // server paths - no trailing slash!
                      $secureserver = "https://www.ourdomainname.com";
                      $insecureserver = "http://www.ourdomainname.com";
                      $resourceId = $modx->resourceIdentifier;
                      
                      if ( intval($resourceId) ){ //exclude if not an id
                      
                        
                        $encryption = FALSE;
                        $urlType = 'http';
                        $doc = $modx->getObject('modResource', $resourceId);
                        $secure = $doc->getTVValue('encryption'); 
                        if($secure=='1') {
                          $encryption = TRUE;
                          $urlType = 'https'; 
                          } 
                        $modx->setPlaceholder('urlType',$urlType);
                        $url = $_SERVER['REQUEST_URI'];
                        $ssl = FALSE;
                        if($_SERVER['HTTPS'] == 1)  {
                              $ssl =  TRUE;
                        } elseif ($_SERVER['HTTPS'] == 'on'){
                              $ssl =  TRUE;
                        } elseif ($_SERVER['SERVER_PORT'] == 443) {
                          $ssl = TRUE;
                        }
                         
                        // switch between http / https if necessary
                        // if $secureserver === $insecureserver (eg you are testing locally)
                        // then comment out this code block to avoid infinite recursion
                        if($encryption && !$ssl) {
                           // if SSL off and we are about to access a secure page then redirect
                          $modx->sendRedirect($secureserver.$url);
                        } else if ($ssl && !$encryption) {
                          // if SSL is on and we are about to acccess an unsecure page then redirect
                          $modx->sendRedirect($insecureserver.$url);
                        }
                        
                      }//exclude if not an id
                    }


                    Beside this problem the plugin which was published somewhere here in the modx-forum works very well...

                    Inka
                      • 3749
                      • 24,544 Posts
                      I don’t see how that explains the problem, since the user should still be rejected from unpublished pages after the redirect to them.

                      That said, try this. Just above the following line:

                      // switch between http / https if necessary


                      Add this:

                      if ($resource->get('published') == false || $resource->get('deleted')) {
                      
                          $modx->sendErrorPage();
                      }


                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting