We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15005
    • 18 Posts
    This query hopefully has a simple answer

    I use the following to send users to page ID=254 on login.

    [!WebLoginPE? &type=`simple`&disableServices=`register`&loginFormTpl=`wlpe-login-amended`&successTpl=`wlpe-loggedin-amended`&liHomeId=`254`!]

    In each Web-User’s profile, there is a setting to assign an individual login home page, which I had hoped would over-ride the HomeID in the WebloginPE call above.

    So I am writing here because this hoped-for result didn’t work.

    Can anyone tell me how I can achieve a different HomeID page for selected webusers?

    Thanks for any help
      • 12684
      • 118 Posts
      I am not 100% on this. I am learning myself. But perhaps what you need to do is assign separate groups that would need to go to separate pages. Then they would be put in the groups depending on what they choose during registration.

      I hope this is some help, but then you did not really specify how you want these members to be identified.
        • 15005
        • 18 Posts
        Thanks IG88. I ended up doing something just like this.

        What I did was insert 2 home ID pages `&liHomeId=`468,254`
        Page 254 is the landing page for the majority of members. I put page 468 in a group of its own so & made it the landing page of the single member I wanted to read it. Only this member was assigned permission to read it. Because the others do not have permission to view page 468, MODx sends them to page 254, ie their normal landing page.

        It seemed a complicated way to achieve a simple result, given that each web user (in principle) can be assigned their own home page from within their profiles. The page wasn’t in any way confidential & I didn’t specially want to exclude others from reading it but it was the only way I could think of achieving the result I wanted.
          • 4041
          • 788 Posts
          I believe this will fix the Home Page login issue, so far with my testing it has worked fine but only heavy duty testing will tell smiley

          This requires modifying the assets/snippets/webloginpe/webloginpe.class.php so make a backup copy of your working file before modification.

          Open webloginpe.class.php in a text editor and scroll down to line 2102 ( if you don’t have line numbers find this section: function LoginHomePage() )

                  function LoginHomePage()
                  {
                          global $modx;
          
                          if (!empty($this->Report))
                          {
                                  return; //There was an error in the last step
                          }
                          
                          if ($this->Type == 'taconite')
                          {
                                  return;
                          }
                          
            /*--- Web User Login Home page fix  --->
                  # check to see if the web user has a home page ID set and redirects if so
            */
                          $web_user_settings = $modx->getFullTableName('web_user_settings');
                          $web_UserSettings = $modx->db->query("SELECT setting_value FROM ".$web_user_settings." WHERE `webuser`='".$this->User['internalKey']."' AND `setting_name`='login_home'");
                          $limit = count($web_UserSettings);
                          if ($limit > 0){
                               $row = $modx->fetchRow($web_UserSettings);
                               $web_UserLoginHomeID = $row['setting_value'];
          
                                 if($web_UserLoginHomeID !=""){
                                    $url = $modx->makeURL($web_UserLoginHomeID);
                                    $modx->sendRedirect($url,0,'REDIRECT_REFRESH');
                                    return;
                                 }
                           }
          
            /*--- end modification ---*/
            
                                   if (!empty($this->liHomeId))
                                   {
                                     if (is_array($this->liHomeId))
                                     {
                                          foreach($this->liHomeId as $id)
                                          {
                                           $id = trim($id);
                                            if ($modx->getPageInfo($id))
                                            {
                                               $url = $modx->makeURL($id);
                                               $modx->sendRedirect($url,0,'REDIRECT_REFRESH');
                                               return;
                                            }
                                          }
                                     }
                                     else
                                     {
                                          $url = $modx->makeURL($this->loHomeId);
                                          $modx->sendRedirect($url,0,'REDIRECT_REFRESH');
                                          return;
                                     }
                                   }
                                   else
                                   {
                                     $url = $modx->makeURL($modx->documentIdentifier);
                                     $modx->sendRedirect($url,0,'REDIRECT_REFRESH');
                                   }
                                  return;
                        }
          


          Make your function look like the code above.

          With this modification, if you add a Login Home Page ID to a webusers settings in the manager, thats where they will be redirected regardless of the ID’s set in the snippet call.
            xforum
            http://frsbuilders.net (under construction) forum for evolution
            • 12684
            • 118 Posts
            Julesem,

            Wow, I am just happy I was actually able to help.

            What you did was exactly what I was thinking too. However I think this would be the easiest way, because otherwise you would have to go in and constantly assign each individual member a page every time some one new signed up. I think that is too much. At least with assigning the &liHomeId you will not have to do extra work.
              • 15005
              • 18 Posts
              IG88; Fortunately, a separate landing page for one member was only a temporary requirement that I won’t have to repeat too often.

              Breezer; I ’m glad there is a ’fix’ for this because I get a bit paranoid when core functions of MODx don’t work. I’ll try it out in the next few days.

              One problem I still have with MODx is that the forgotten password function doesn’t work correctly. Whether I set it up in Weblogin or WebloginPE. It sends a notification email with a link and new password but MODx doesn’t recognise the new password.
                • 25803 ☆ A M B ☆
                • 721 Posts
                Quote from: Breezer at Jun 11, 2008, 06:46 PM

                I believe this will fix the Home Page login issue, so far with my testing it has worked fine but only heavy duty testing will tell smiley

                This requires modifying the assets/snippets/webloginpe/webloginpe.class.php so make a backup copy of your working file before modification.

                With this modification, if you add a Login Home Page ID to a webusers settings in the manager, thats where they will be redirected regardless of the ID’s set in the snippet call.

                This is great. In the middle of my first use of WebloginPE. Will this be making it’s way into the 1.3.1 update?
                  • 28033
                  • 925 Posts
                  Quote from: rx2 at Jun 18, 2008, 08:37 PM

                  Quote from: Breezer at Jun 11, 2008, 06:46 PM

                  I believe this will fix the Home Page login issue, so far with my testing it has worked fine but only heavy duty testing will tell smiley

                  This requires modifying the assets/snippets/webloginpe/webloginpe.class.php so make a backup copy of your working file before modification.

                  With this modification, if you add a Login Home Page ID to a webusers settings in the manager, thats where they will be redirected regardless of the ID’s set in the snippet call.

                  This is great. In the middle of my first use of WebloginPE. Will this be making it’s way into the 1.3.1 update?

                  I should be able to add it. wink
                    My Snippets
                    -> PopUpChunk v1.0
                    • 25803 ☆ A M B ☆
                    • 721 Posts
                    Quote from: Soshite at Jun 19, 2008, 07:23 AM

                    I should be able to add it. wink

                    That would be great. I can’t thank everyone enough. When I started reading the bug thread I thought it best to stay away from this snippet but with these fixes it’s working wonderfully.

                    Open webloginpe.class.php in a text editor and scroll down to line 2102 ( if you don’t have line numbers find this section: function LoginHomePage() )

                    If you’re using 1.3.1 this is on line 2125.
                      • 25803 ☆ A M B ☆
                      • 721 Posts
                      I’m curious if there is a way to have the Login Home Page id of a web user set upon registration (so that it shows up in the manager)? I know that &liHomeId redirects users to the appropriate page upon registration (or login) and with this modification, redirects them to the page set in the Login Home Page field within the Manager, but liHomeID doesn’t set it initially in the Manager, and for good reason, since you don’t want it to be reset. But it would be useful to have it initially set upon registration.