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
    ScottyDelicious Reply #201, 19 years ago
    Quote from: cobnet at Sep 08, 2007, 08:03 PM

    I am using your latest version from the very 1st post in this message thread. 1.2.0. The coding I posted comes from the SaveUserProfile() function, a little further down in that function, your coding here does appear.

    If I am not mistaken the following coding is where a new password is updated to the database?

    		if (!empty($_POST['password']) && isset($_POST['password']) && isset($_POST['passwordconfirm']))
    		{
    			if ($_POST['password'] === $_POST['passwordconfirm'])
    			{
    				if (md5($_POST['password']) === md5($modx->db->escape(strip_tags($_POST['password']))))
    				{
    					if (strlen($_POST['password']) > 5)
    					{
    						$passwordElement = "UPDATE ".$web_users." SET `password`='".md5($modx->db->escape($_POST['password']))."' WHERE `id`='".$internalKey."'";
    						$saveMyPassword = $modx->db->query($passwordElement);
    					}
    					else
    					{
    						$this->FormatMessage($this->LanguageArray[3]);
    						return;
    					}
    				}
    				else
    				{
    					$this->FormatMessage($this->LanguageArray[4]);
    					return;
    				}
    			}
    			else
    			{
    				$this->FormatMessage($this->LanguageArray[2]);
    				return;
    			}
    		}
    


    Please note the UPDATED message in my very 1st posting to this thread (Currently on page 13).

    Aha!
    I totally spaced that. Thanks bro.
    I will correct that. Since the password is fairly critical to authentication, I have given it special attention... sort of (LOL)... It looks like I forgot about it here!

    FIXED.

    -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
      • 31837
      • 59 Posts
      ok dokey. well, after copying my site to a godaddy environment from the Xammp one I’m developing in, I’ve been able to figure out and get working some of this stuff...

      I guess it’s now all in the tweaking of it and just understand what these parameters actually do. smiley



      If I get around to it, I’ll try and put a tutorial some where about how I did some of the stuff, to get this stuff working easily, such as user permissions and who can access what documents!

      I feel a lot better now that I’ve got it working. smiley

      Thanks Dr Scott for your work... I won’t say ignore my pm, but some of it you can now! ha ha..
        • 31837
        • 59 Posts
        Quote from: pixelchutes at Sep 04, 2007, 11:48 AM

        Aahh...but I am not passing photo


        I could not upload your photo. Please check the permissions of the "userimages" folder.

        Ah, I’m loving this forum idea... it is helping to solve all my coding problems! HA HA.

        Trouble, is, I’m getting that exact same error now just trying to update the country...

        I’ve changed the permissions to 777, but alias, the error continues. smiley

        hmm...
        any ideas? smiley

        Well, as I said earlier, yep, this is a good snippet. smiley
          • 26435
          • 1,193 Posts
          ScottyDelicious Reply #204, 19 years ago
          I think I remember getting that photo error when I had WebLoginPE called twice on the same page.
          I know only one of them shows up, but if there is a WLPE in the sidebar and a WLPE profile in the main content, they both have a service for ’saveprofile’ and I think it gets confused. I had to disable/remove WLPE from the sidebar on the profile page.

          -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
            • 14050
            • 788 Posts
            I have not had the chance to use WebLoginPE, but maybe it would be useful to add an "id" parameter, similar to ditto (http://ditto.modxcms.com/files/snippet-ditto-php.html#id) so that multiple instances of WLPE can be called on the same page, i.e., one call in the template for the sidebar, and another call in the content for the profile.

              Jesse R.
              Consider trying something new and extraordinary.
              Illinois Wine

              Have you considered donating to MODx lately?
              Donate now. Every contribution helps.
              • 31837
              • 59 Posts
              Quote from: vr_driver at Sep 10, 2007, 02:34 AM


              Trouble, is, I’m getting that exact same error now just trying to update the country...


              I feel like I’m just answering my own questions!

              Nevermind. I have since discovered that you must have the < label > tag around each input tag.

              I’ve been changing things and adding tables to make it look a bit prettier, and yep.. I found out the hard way. ha ha.

                • 8619
                • 229 Posts
                Dr. Scotty,

                This snippet looks really promising for a couple of projects that I am working on right now, so a few questions to guide me in playing around with it.

                I am looking to use this to login/logout of a members area that will contain a profile of the member and their family. Does this snippet allow for additional people to be listed, such as kids, spouses, etc? I would be using just a single login for the family or individual, so each person would not need their own login.

                Will this snippet allow for the family to modify their own profile and then be able to browse other profiles, maybe search by name, address, phone or zip code?

                Thanks for any direction with these, and as I begin playing around with this, I’m sure I’ll be back with more questions and maybe some advice or solutions!
                  • 26435
                  • 1,193 Posts
                  ScottyDelicious Reply #208, 19 years ago
                  Quote from: ejcross at Sep 10, 2007, 09:55 PM

                  Dr. Scotty,

                  This snippet looks really promising for a couple of projects that I am working on right now, so a few questions to guide me in playing around with it.

                  I am looking to use this to login/logout of a members area that will contain a profile of the member and their family. Does this snippet allow for additional people to be listed, such as kids, spouses, etc? I would be using just a single login for the family or individual, so each person would not need their own login.
                  Absolutely! using the &customFields parameter you can add additional columns you the WebLoginPE table (the default table name is `web_user_attributes_extended` but you can override that with &customTable). You could call WebLoginPE with this parameter:
                  &customFields=`spouse,children,family_motto` &profileTpl=`familyProfileChunk`

                  In familyProfileChunk you would have, in addition to any other fields you want the user to specify
                  ...
                  <input type="text" name="spouse" value="[+user.spouse+] />
                  <input type="text" name="children" value="[+user.children+]" />
                  <input type="text" name="family_motto" value="[+user.family_motto+]" />
                  ...

                  Quote from: ejcross at Sep 10, 2007, 09:55 PM

                  Will this snippet allow for the family to modify their own profile and then be able to browse other profiles, maybe search by name, address, phone or zip code?
                  Yes, anyone with the Username/Password can modify the profile if they want.
                  Search is a good Idea. I will work it in to the snippet. I don’t think [!AjaxSearch!] is gonna find that stuff?
                  Quote from: ejcross at Sep 10, 2007, 09:55 PM

                  Thanks for any direction with these, and as I begin playing around with this, I’m sure I’ll be back with more questions and maybe some advice or solutions!
                  Your welcome, and I look forward to hearing from you.

                  -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
                    • 7455
                    • 2,204 Posts
                    I am getting this error using the shipped form:
                      Error: 	move_uploaded_file(/home/httpd/vhosts/domain.nl/subdomains/name/httpdocs/photo-3.jpg): failed to open stream: Permission denied	 
                    


                    the userimages folder is set to 777, it looks like httpdocs is set as temp? but I do not want to change the permissions for that folder
                    I changed it to 700 and now I get the next error:

                      Error: 	imagejpeg(): Unable to open '/home/httpd/vhosts/domain.nl/subdomains/name/httpdocs/assets/snippets/webloginpe/userimages/.jpg' for writing	 
                    

                    looks like it tries to write a file called .jpg its missing the name before the .jpg
                    in httpdocs there is a file called photo-3.jpg so that works.

                    Dimmy
                      follow me on twitter: @dimmy01
                      • 8619
                      • 229 Posts
                      Thanks for the quick reply!

                      As for the search, I’m not sure either that AjaxSearch would work or not. My only concern with it would be if the members area that houses the profile and other private information could be searched from the front end without being logged in. I think I remember a setting someplace in it however that seperates the public from private info. I’ll look into it as I am getting ready to dive into this snippet for my church and another site.