We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6118
    • 13 Posts
    I would like to add a button to the default login success page that returns a user to their proper login home page.

    I added the following,
    "<button type="submit" id="wlpeLoginButton" name="service" value="login">Return to Member Only Content</button>"

    But I get the login success page with an extra line saying, "You have left some required form fields blank." That makes sense, I suppose.

    I’m trying to have the button return them to the page that they would typically go to when they initially log in. Basically, the page is used by two user groups that have access to different content, and I’d like them to have the ability to go back to the content they’re authorized to see from that page.

    I also tried adding to the service case statement a new value that simply calls LoginHomePage(), and that produced no results.

    I’m officially in over my head.

    Any suggestions? Thanks in advance!!!!
      • 3749
      • 24,544 Posts
      I’m not sure what WLPE is capable of, but would it work to have just two login home pages that each just contained a snippet that forwarded the user to the appropriate content area using $modx->sendRedirect(’url_of_appropriate_content_area’)?
        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
        • 6118
        • 13 Posts
        I’d thought of a similar approach, but I was trying to avoid hard coding a specific page id into that.

        That said, sometimes a simple solution is the most appropriate. Thanks for giving it some thought, though.
          • 20413
          • 2,877 Posts
          This works with regular WebLogin

          [[MyPage]]
          <?php
          if(isset($_SESSION['webValidated'])
          && isset($_SESSION['webShortname'])
          && isset($_SESSION['webUsrConfigSet']['login_home'])){
          
          $loginpageid = $_SESSION['webUsrConfigSet']['login_home'];
          $output ="";
          $output .="<a href='[~".$loginpageid."~]'>My Homepage</a>";
          
          return $output;
          }
          ?>


            @hawproductions | http://mrhaw.com/

            Infograph: MODX Advanced Install in 7 steps:
            http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

            Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
            http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower