We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26435
    • 1,193 Posts
    Quote from: astrolabe at Oct 06, 2007, 11:48 AM

    sorry, I’have find this post to solve this bug. Thank’s.

    http://modxcms.com/forums/index.php/topic,18271.15.html

    Cool!
    I will assume all is working well for you now.

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


      I send pointless little messages
      • 2327
      • 214 Posts
      Thank you very much Scotty, but I still have difficulties putting on WebloginPe. I do not have to take myself there correctly. Here is the problem:

      1) I have a login page (id 4) with his own template. In the content of this page, i have placed the snippet :

      [tt]
      [!WebLoginPE?
      &type=`simple`
      &lang=`fr`
      &loginFormTpl=`assets/snippets/webloginpe/myLoginTpl.html` &resetTpl=`assets/snippets/webloginpe/myResetTpl.html`
      &activateTpl=`assets/snippets/webloginpe/myActivateTpl.html`
      &liHomeId=`74`
      &loHomeId=`4` !]

      [/tt]

      It’work well.

      2) My liHomeId page (74), the Home page for logged User, has a own template too. Somewhere in the menu bar of this page, I wish to show the name of the logged user and a disconnect button. So, I put the following code In the place where I want that it appears (in a chunk like {{loguser}} ), but I am not sure that it is very correct. The chunk contain :

      [tt]
      [!WebLoginPE?
      &type=`simple`
      &lang=`fr`
      &loHomeId=`4`
      &successTpl=`assets/snippets/webloginpe/myLoginSuccessTpl.html`
      &disableServices=`login`
      &profileHomeId=`95`!]
      [/tt]


      And the Tpl myLoginSuccessTpl.html contain :


      <div id="utilisateur">
      <form id="wlpeUserForm" action="[~[*id*]~]" method="POST">
      <fieldset id="wlpeUserButtons">
      <button type="submit" id="wlpeProfileButton" name="service" value="profile" title="Consulter votre compte">[+user.fullname+] </button>
      <button type="submit" class="deconnect" name="service" value="logout">Deconnection</button>
      </fieldset>
      </form>
      </div>


      As you can see it, the first button where appears the name of the user has to allow her to reach its profile (in page 95). Apparently, it works, but several times, the Deconnection button does not return to the page of logout.
      I do not know why. Is this way to proceed correct ? I think that not >:(


      3) Finally I wish to show the profile of the user connected on page 95. When the user clicks its name, it arrives well on the good page, but which contents I have to include there so that its profile appears on page 95 ?

      In the content of this page, i put this code :

      [tt][!WebLoginPE?
      &type=`simple`
      &lang=`fr`
      &successTpl=`assets/snippets/webloginpe/myProfileTpl.html`
      &loHomeId=`4` !][/tt]


      And the Tpl myProfileTpl.html contain :

      [tt]<h3 id="wlpeProfileWelcome">[+user.fullname+] ([+user.username+])</h3>
      <div id="wlpeUser">
      [+wlpe.message+]
      <form action="[~[*id*]~]" enctype="multipart/form-data" id="wlpeUserProfileForm" method="post">
      <fieldset id="wlpeUserProfileInput">
      <div id="wlpeUserInfo">
      <p class="info" id="wlpeProfileInfo">
      Merci d’utiliser ce formulaire pour mettre &agrave; jour vos informations
      </p>
      </div>
      <legend>Votre profil</legend>

      <label for="wlpeUserProfileEmail">Votre Email
      <input id="wlpeUserProfileEmail" name="email" type="text" value="[+user.email+]" />
      </label>

      <label for="wlpeUserProfilePhone">N&deg; de T&eacute;l&eacute;phone fixe
      <input id="wlpeUserProfilePhone" name="phone" type="text" value="[+user.phone+]" />
      </label>
      <label for="wlpeUserProfileMobile">N&deg; de Tel mobile
      <input id="wlpeUserProfileMobile" name="mobilephone" type="text" value="[+user.mobilephone+]" />
      </label>

      [+form.gender+]
      <label for="wlpeUserProfileComment">Remarques
      <textarea id="wlpeUserProfileComment" name="comment">[+user.comment+]</textarea>
      </label>
      <fieldset id="wlpeNewPasswordArea">
      <legend id="wlpeNewPasswordAreaLegend">Changer de mot de passe</legend>
      <p id="wlpeNewPasswordInfo">
      Indiquez un nouveau mot de passe

      <span class="info">(laissez vide pour conserver le pr&eacute;c&eacute;dent).</span>
      </p>
      <label for="wlpeUserProfilePassword">Nouveau mot de passe
      <input id="wlpeUserProfilePassword" name="password" type="password" />
      </label>
      <label for="wlpeUserProfilePasswordConfirm">Nouveau mot de passe (confirmez)
      <input id="wlpeUserProfilePasswordConfirm" name="password.confirm" type="password" />
      </label>
      </fieldset>
      </fieldset>
      <fieldset id="wlpeUserProfileButtons">
      <button id="wlpeSaveProfileButton" name="service" type="submit" value="saveprofile">Sauvegarder</button>
      <button id="wlpeProfileDoneButton" name="service" type="submit" value="cancel">Annuler</button>
      <button id="wlpeProfileLogoutButton" name="service" type="submit" value="logout">Se d&eacute;connecter</button>
      <button id="wlpeProfileDeleteButton" name="service" type="submit" value="deleteprofile">Supprimer mon profil</button>
      </fieldset>
      </form>
      </div>
      [/tt]


      The data of the user display correctly, but no button (saveprofil, cancel, logout, deleteprofil) works.

      My way of proceeding is manifestly incorrect.
      Sorry for this post length, but I hope to be clear.

      I imagine that the solution is not far..... Thank you for your help if you have the time of it.

        • 23491 ☆ A M B ☆
        • 1,056 Posts
        Using WLPE for a quick ’change e-mail/password form’ is a breeze! Via System Events, you can synchronize the update to an extended table (e.g. forum, affiliate software, etc)

        To effectively achieve a simple form, I first need to &disableServices=`1,2,3,..N` where 1toN represents every service you’d want disabled, except for saveprofile. Over time, as/if new services are added, the list of services becomes incomplete, and your form possibly susceptible. (especially if you don’t want to offer account deletion, member profile viewing, registration, etc)

        Enter &enableServices parameter...

        If I could pass:
        &disableServices=`all` &enableServices=`saveprofile`
        


        ...I could easily create the simple password change form and not have to worry about the form being used for anything else! Protected. Ugrade-friendly coding smiley
          Mike Reid - www.pixelchutes.com
          MODx Ambassador / Contributor
          [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
          ________________________________
          Where every pixel matters.
          • 26435
          • 1,193 Posts
          Quote from: pixelchutes at Oct 09, 2007, 09:16 PM

          Using WLPE for a quick ’change e-mail/password form’ is a breeze! Via System Events, you can synchronize the update to an extended table (e.g. forum, affiliate software, etc)

          To effectively achieve a simple form, I first need to &disableServices=`1,2,3,..N` where 1toN represents every service you’d want disabled, except for saveprofile. Over time, as/if new services are added, the list of services becomes incomplete, and your form possibly susceptible. (especially if you don’t want to offer account deletion, member profile viewing, registration, etc)

          Enter &enableServices parameter...

          If I could pass:
          &disableServices=`all` &enableServices=`saveprofile`
          


          ...I could easily create the simple password change form and not have to worry about the form being used for anything else! Protected. Ugrade-friendly coding smiley

          Hell yes!
          I like this a lot. This will be an added feature.

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


            I send pointless little messages
            • 28033
            • 925 Posts
            Scotty, while trying to figure out what the filter value(s) get set for in WLPE, I came across some questions.

            If so, I wanted to do something like this to give WLPE the ability to "create" a filtered userlist on the fly, instead of needing to create a page for it each and every time. By adding these two parts in the snippet code...

                // $urlParam [string]
                // By default, the plugin uses "data" for it's the URL parameter, but you can change it here.
                $urlParam = isset($urlParam) ? $urlParam : 'filter';


            $filters = $_GET[$urlParam]; // Grab the url parameter


            But that leads to two issues. One, how would I edit the code in webloginpe.class.php to accept this new value that’s inputted? And secondly, can WLPE accept a $filters value in place of a normal text filter (or is it like HTML in checkboxes/etc, where it messes up).

            Basically, I want to have a URL like /mysymphonic/users/filterlist.php. Now, to create custom userlists, you would make a URL like /mysymphonic/users/filterlist.php?filter=INSERTVALUEHERE.

            INSERTVALUEHERE would get passed to WLPE, which would insert it into the snippet call (with a value like $filters in lieu of a real text filter), and output the userlist.

            I just need to know how I can "intercept" the filter WLPE normally uses, and place the $filters placeholder in it’s place. I did it with my PopUpChunk snippet easily enough, so this shouldn’t be that hard once I know that part.
              My Snippets
              -> PopUpChunk v1.0
              • 26435
              • 1,193 Posts
              Yeah, I think I could work something like that into the class to accept a $_GET value as a filter parameter.
                Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                All of the above... in no specific order.


                I send pointless little messages
                • 28033
                • 925 Posts
                Quote from: Dr. at Oct 11, 2007, 06:22 PM

                Yeah, I think I could work something like that into the class to accept a $_GET value as a filter parameter.

                Nice. That would greatly help out the script for people who want to have a bunch of different pages.

                It does make it so you can’t do filtering of specific values (like finding gmail addresses in the email field), but since this "hack" would just be inputting it if the GET value was there, it wouldn’t be that big of a deal. smiley
                  My Snippets
                  -> PopUpChunk v1.0
                  • 26435
                  • 1,193 Posts
                  What makes this a "hack"?

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


                    I send pointless little messages
                    • 28033
                    • 925 Posts
                    Quote from: Dr. at Oct 11, 2007, 07:13 PM

                    What makes this a "hack"?

                    -sD-
                    Dr. Scotty Delicious, DFPA.

                    I was just using that term, since once GET is enabled in that part of the script, I could "hack" the code to enable this funtionality (unless you’re going to implement it yourself in 1.4.0).
                      My Snippets
                      -> PopUpChunk v1.0
                      • 23491 ☆ A M B ☆
                      • 1,056 Posts
                      NOTE: I had to correct issues in the SessionHandler function as well as the WebLoginPE Snippet itself to get AutoLogin to work correctly...

                      Regardless, now we have AutoLogin working which is nice...

                      I created a custom "Change Email/Password" form leveraging MODx System Events for the data validation...however, if a user changes their password, this "breaks" the AutoLogin requiring the user to Login manually the next time they access the site...

                      The Request:

                      It makes sense the user has to re-login since the Cookie that was initially created has the original password intact. So, one solution might be to tie an event to OnWebChangePassword and have that event reset the WebLoginPE cookie...Unfortunately, I see no interface via the API to "redeclare" the WLPE cookies.

                      It would be nice if the cookie creation/destroy logic was moved into methods of the API, so that they can be invoked during onWebChangePassword to keep AutoLogin seamless--even after a password change smiley

                      The function could be set up to accept the following parameters:
                      cookieName, cookieValue, cookieExpires
                      


                      However, it might make more sense to allow it to accept username and password so that the MD5 can take place within the function, rather than before:
                      $cookieValue = md5($this->User['username']).'|'.$this->User['password'];


                      Then, it could also be used the way it is today, or also during with password changes.
                        Mike Reid - www.pixelchutes.com
                        MODx Ambassador / Contributor
                        [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                        ________________________________
                        Where every pixel matters.