We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23491 ☆ A M B ☆
    • 1,056 Posts
    Quote from: Bruno17 at Feb 14, 2008, 10:13 AM


    in webloginpe.class.php change
    function ViewUserProfile($username)

    to
    function ViewUserProfile($username,$inputHandler)

    and it works for me.


    I implemented this suggestion and received an error upon sending a user message from their profile page. Modifying to the following code prevented the error:

    function ViewUserProfile($username,$inputHandler=array())
      Mike Reid - www.pixelchutes.com
      MODx Ambassador / Contributor
      [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
      ________________________________
      Where every pixel matters.
      • 23491 ☆ A M B ☆
      • 1,056 Posts
      Quote from: nos at Apr 14, 2008, 10:55 AM

      for utf-8 needers:
      add this to SendMessageToUser

      $EmailMessage->CharSet = $modx->config[’modx_charset’];


      @nos,

      Thank you for posting! After much testing, I will definitely recommend this option to solve any UTF-8 or other encoding issues in regards to WLPE Emails. The utf8_decode() usage suggestion did work, however it was only partially working. By properly declaring the CharSet for PHPMailer (as you suggested) it was the only solution to get all encodings to come through as expected. Well done!

      Here is a quote regarding utf8_decode/email:

      Quote from: "TextPattern

      TXP uses UTF8 everywhere, so unless you’re sending email and need latin1, never use utf8_decode, because that converts it to latin1, which is wrong for 2 reasons:

      * not all utf8 characters can be translated to latin1, resulting in question marks.

      * you should not use latin1 on a page that has a utf8 charset. While utf8 is always valid latin1 (even if not readable), latin1 is not always valid utf8, especially if you characters with the high-bit set. Only the lower 7-bits of latin1 and utf8 are equal.


      Before I tried your suggestion, I was running into the same problem described in the first bullet point above where MOST of my characters where converted into correct UTF-8, but a select few were becoming question marks...but not anymore! cool

      To implement your suggestion across the entire class, simply look for all five instances of:

      new PHPMailer();

      and map the CharSets:

              $varName->CharSet = $modx->config['modx_charset'];
      


      NOTE: Change $varName to match the corresponding variable for each instance of new PHPMailer();
      (e.g. $Register, $Notify, $Pruned, $EmailMessage and $Reset)
        Mike Reid - www.pixelchutes.com
        MODx Ambassador / Contributor
        [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
        ________________________________
        Where every pixel matters.
        • 23491 ☆ A M B ☆
        • 1,056 Posts
        Quote from: MadeMyDay at Nov 27, 2007, 12:39 AM

        I have a problem, after which more than 60 users is register on the site appears the following error:

        Check your database, table web_users. Perhaps someone registered with an illegal character in his username like blank,ß,ä,ö,ü or something similar. I think I read something about a missing validation of usernames.


        This is definitely an open issue. For example, I can register using UTF-8 character encodings (e.g. Ä, §, etc) but then I cannot login and it also breaks the system.

        Another example, if I register a username of Ä20:

        Quote from: "PHP

        Array
        (
        [admin] => Array
        (
        [id] => 1
        [username] => admin
        [password] => xxxxxxx
        [cachepwd] =>
        [internalKey] => 1
        [fullname] => admin
        [role] => 0
        [email_] => [email protected]
        [phone] =>
        [mobilephone] =>
        [blocked] => 0
        [blockeduntil] => 0
        [blockedafter] => 0
        [logincount] => 0
        [lastlogin] => 1187902578
        [thislogin] => 0
        [failedlogincount] => 0
        [sessionid] =>
        [dob] => 0
        [gender] => 0
        [country] =>
        [state] =>
        [zip] =>
        [fax] =>
        [photo] =>
        [comment] =>
        )

        [Ä20] =>

        [username2] => Array
        (
        [id] => 3

        ...

        Notice the [Ä20] => does not have anything associated with the key!
          Mike Reid - www.pixelchutes.com
          MODx Ambassador / Contributor
          [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
          ________________________________
          Where every pixel matters.
          • 28033
          • 925 Posts
          Hmm...I wonder if the fixes pixelchutes posted would fix my issues...

          *goes to try*
            My Snippets
            -> PopUpChunk v1.0
            • 23491 ☆ A M B ☆
            • 1,056 Posts
            Quote from: Soshite at Mar 16, 2008, 09:33 AM

            I noticed a pretty bad bug today. It seems that the sorting options doesn’t respect a user’s wishes to "hide" a part of their profile, like their phone number. It outputs the number, instead of saying private.

            Any idea how to fix this?

            EDIT: Just to check, is it expected that in the sorting options, when you view a user’s profile, it shows up correctly, even if the customFields line isn’t in the snippet call? I was under the impression that you needed them for the fields to appear correctly.

            @Soshite,

            I haven’t had the opportunity to look into the sorting options yet, though I will make a point to do so. Is this the specific problem you are referring to? I’m not certain the above bug fixes will help unless you were experiencing the specific issues addressed.
              Mike Reid - www.pixelchutes.com
              MODx Ambassador / Contributor
              [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
              ________________________________
              Where every pixel matters.
              • 28033
              • 925 Posts
              Quote from: pixelchutes at Apr 19, 2008, 10:52 AM

              Quote from: Soshite at Mar 16, 2008, 09:33 AM

              I noticed a pretty bad bug today. It seems that the sorting options doesn’t respect a user’s wishes to "hide" a part of their profile, like their phone number. It outputs the number, instead of saying private.

              Any idea how to fix this?

              EDIT: Just to check, is it expected that in the sorting options, when you view a user’s profile, it shows up correctly, even if the customFields line isn’t in the snippet call? I was under the impression that you needed them for the fields to appear correctly.

              @Soshite,

              I haven’t had the opportunity to look into the sorting options yet, though I will make a point to do so. Is this the specific problem you are referring to? I’m not certain the above bug fixes will help unless you were experiencing the specific issues addressed.

              Nah, that issue you quoted was something different. I was having issues where I was getting that "username already exists" when it didn’t, but it would create the user (even when the e-mail was bad / etc.)

              That issue you quoted made it so, let’s say, the user had hid their phone number. In their profile, it worked as expected. But when you used a sorting option to view that field, it didn’t hide it.
                My Snippets
                -> PopUpChunk v1.0
                • 23491 ☆ A M B ☆
                • 1,056 Posts
                Quote from: Soshite at Apr 19, 2008, 01:55 PM

                Nah, that issue you quoted was something different. I was having issues where I was getting that "username already exists" when it didn’t, but it would create the user (even when the e-mail was bad / etc.)

                That issue you quoted made it so, let’s say, the user had hid their phone number. In their profile, it worked as expected. But when you used a sorting option to view that field, it didn’t hide it.

                OK thanks, now I understand. I’m interested to know if the improved handling in Register() helps you out. NOTE: I also had to update the RegExp in ValidateEmail() as it was not validating email addresses with plus "+" signs in them:
                //<?php - Used for highlighting only - do not copy
                
                        // Original: ^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$
                        if (!eregi("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,7}$", $Email)) // pixelchutes
                
                
                  Mike Reid - www.pixelchutes.com
                  MODx Ambassador / Contributor
                  [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                  ________________________________
                  Where every pixel matters.
                  • 7455
                  • 2,204 Posts
                  Mike,

                  really great that you are fixing those bugs, I think that this such a great tool that could easily be placed in the maxigallery ditto and wayfinder groep.

                  But it needs to be more stable, I really like to use this snippet more.

                  Could you maybe post a working 1.3.pixelversion or maybe there can be some response from our Pirate Programmer on this case.
                  Does Scotty continue with this or can someone take it over to bring this app to his potential

                  when there is a version that has all fixes until now that I can go and test is, (I really want to test it and report back to someone that follows up).

                  Dimmy
                    follow me on twitter: @dimmy01
                    • 28033
                    • 925 Posts
                    Quote from: Dimmy at Apr 20, 2008, 06:06 AM

                    Could you maybe post a working 1.3.pixelversion or maybe there can be some response from our Pirate Programmer on this case.
                    Does Scotty continue with this or can someone take it over to bring this app to his potential

                    when there is a version that has all fixes until now that I can go and test is, (I really want to test it and report back to someone that follows up).

                    Dimmy

                    I am trying to head up work on getting a v1.3.1 release done. I have Spring final exams in two weeks, so it’ll have to wait till then (unless someone else can pick it up before I can).
                      My Snippets
                      -> PopUpChunk v1.0
                      • 23491 ☆ A M B ☆
                      • 1,056 Posts
                      Quote from: pixelchutes at Apr 18, 2008, 06:02 PM

                      Quote from: MadeMyDay at Nov 27, 2007, 12:39 AM

                      Check your database, table web_users. Perhaps someone registered with an illegal character in his username like blank,ß,ä,ö,ü or something similar. I think I read something about a missing validation of usernames.
                      This is definitely an open issue. For example, I can register using UTF-8 character encodings (e.g. Ä, §, etc) but then I cannot login and it also breaks the system! (E.g. ÄPPLE§)

                      In order to prevent someone from registering a username with an invalid character, I needed to update Scotty’s default error handling for invalid characters in the username.

                      Find the following code in the Register() function:

                      //<?php // Used for highlighting only - Do Not Copy
                      
                      // Check username for bullshit.
                      $illegals = array('.' , ',' , '/' , '\\' , '`' , ';' , '[' ,  ']' , '-', "'", '*', '&', '^', '%', '$', '#', '@', '!', '~', '+', '(', ')', '|', '{', '}', '<', '>', '?', ':', '"', '='); 
                      $badUsername = str_replace($illegals, '', $username);
                      if (strlen($badUsername) !== strlen($username))
                      

                      and replace it with this:
                      //<?php // Used for highlighting only - Do Not Copy
                      
                      // Check username for bullshit.
                      if( strspn($_POST['username'],'"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_') != strlen($_POST['username']) ) // pixelchutes
                      


                      This will ensure that only Alpha-numeric values (as well as underscore) can be used during username registration. NOTE: Reference to $wlpe_lang[32] in the language file does not mention the option for the above symbol(s) by default.

                      I consider this bug highly vulnerable as it can lead to failure of a functional site by merely registering with special characters in the username. This patch will help solve that, however it does limit the scope of Username possibilities. Ideally, the entire class would be updated to properly handle usernames with special characters.
                        Mike Reid - www.pixelchutes.com
                        MODx Ambassador / Contributor
                        [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                        ________________________________
                        Where every pixel matters.