We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16858
    • 58 Posts
    OK, I give up! I have looked through all the field in the ModX tables and cannot find where a users login home page is stored. Can anyone enlighten me?

    Thanks
      • 26435
      • 1,193 Posts
      Quote from: lee at Aug 31, 2007, 05:46 PM

      OK, I give up! I have looked through all the field in the ModX tables and cannot find where a users login home page is stored. Can anyone enlighten me?

      Thanks
      It is a parameter passed to the weblogin snippet. [!weblogin? &liHomeId=`xx`!] where `xx` is the document id of the page you want your users redirected to on login.

      -sD-
      Dr. Scotty Delicious, Scientist.DFPA.
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages
        • 16858
        • 58 Posts
        but where is it actually stored in the database?
          • 26435
          • 1,193 Posts
          Quote from: lee at Aug 31, 2007, 06:01 PM

          but where is it actually stored in the database?
          It is not stored in the database. It is a parameter passed to the weblogin snippet.
          Perhaps I should define what a ’Parameter’ is...
          A snippet parameter is a way to pass a variable to php code through the snippet call.
          the login home page is a variable in the weblogin snippet. You can set a value for that php variable by putting &liHomeId in your snippet call. It is not stored anywhere in the DB.

          -sD-
          Dr. Scotty Delicious, Scientist.DFPA.
            Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
            All of the above... in no specific order.


            I send pointless little messages
            • 16858
            • 58 Posts
            I want to run a query through all records in the modx_web_user_attributes table and if a certain phrase is in the comment field, I want to grab the login home page of those records. How would I do that?
              • 26435
              • 1,193 Posts
              Quote from: lee at Aug 31, 2007, 06:39 PM

              I want to run a query through all records in the modx_web_user_attributes table and if a certain phrase is in the comment field, I want to grab the login home page of those records. How would I do that?
              First of all, the login home page is not in the database!!!
              I will say it one more time... The login home page is not in the database. you can not retrieve it, you cannot query for it. At least not with the weblogin snippet.

              Take a look at the WebLoginPE snippet. It allows for an extended user attributes table where you can store unlimited numbers of custom columns. You could, for instance, make a customField for ’myLoginPage’ and set that in the database, then pass the parameter to [!WebLoginPE? &liHomeId=`[+user.myLoginPage+]`!]

              -sD-
              Dr. Scotty Delicious, Scientist.DFPA.
                Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                All of the above... in no specific order.


                I send pointless little messages
                • 16858
                • 58 Posts
                Quote from: Dr. at Aug 31, 2007, 07:03 PM

                Quote from: lee at Aug 31, 2007, 06:39 PM

                I want to run a query through all records in the modx_web_user_attributes table and if a certain phrase is in the comment field, I want to grab the login home page of those records. How would I do that?
                First of all, the login home page is not in the database!!!
                I will say it one more time... The login home page is not in the database. you can not retrieve it, you cannot query for it. At least not with the weblogin snippet.

                You hide your frustration at me so well smiley

                Never did I say I wanted to use the weblogin snippet to retrieve the login home page. I will say it one more time ... Never did I say I wanted to use the weblogin snippet to acccess the login home page. I’m merely asking ... if ModX stores that value and retrieves it at a later time, that value is indeed stored somewhere. I just want to know where.
                  • 26435
                  • 1,193 Posts
                  Quote from: lee at Aug 31, 2007, 08:24 PM

                  You hide your frustration at me so well smiley

                  Never did I say I wanted to use the weblogin snippet to retrieve the login home page. I will say it one more time ... Never did I say I wanted to use the weblogin snippet to acccess the login home page. I’m merely asking ... if ModX stores that value and retrieves it at a later time, that value is indeed stored somewhere. I just want to know where.
                  Ok, gotcha.
                  Unfortunately, no. It is not stored anywhere. the &liHomeId parameter accepts as its value a document id (int) or a comma separated list of ids to loop through. It will redirect the user to the first page that they have permission to view. It is a variable that is checked when the snippet is parsed and then lost. There is no persistent data associated with the login home page.

                  I should clarify that I am not frustrated with you, It just was not 100% clear to me that there was an understanding about the nature of the liHomeId parameter and its functionality.

                  -sD-
                  Dr. Scotty Delicious, Scientist.DFPA.
                    Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                    All of the above... in no specific order.


                    I send pointless little messages
                    • 16858
                    • 58 Posts
                    FOUND IT!!

                    For anyone else looking, it is stored in the table modx_web_user_settings, in the field setting_value with the setting_name set to "login_home".
                      • 26435
                      • 1,193 Posts
                      Well holy crap! laugh
                      I don’t know why I wasn’t even thinking about the ’user’ tab in the managaer’s manage web users frame!
                      I appologize Lee. I feel like I gave you the run around for no reason. I wish you would have mentioned that form field in the manager.

                      My bad, and again... sorry about the misunderstanding.

                      You could use:

                      $webuser = $modx->getLoginUserID();
                      $findLoginHome = $modx->db->query("SELECT `setting_value` FROM ".$modx->getFullTableName(’web_user_settings’)." WHERE `setting_name` = ’login_home’ AND `webuser` = ’".$webuser."’");
                      $loginHome = $modx->db->getRow($findLoginHome);
                      $url = $modx->makeURL($loginHome);
                      $modx->sendRedirect($url,0,’REDIRECT_REFRESH’);

                      -sD-
                      Dr. Scotty Delicious, Scientist.DFPA.
                        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                        All of the above... in no specific order.


                        I send pointless little messages