• Is there a way to post users info without them being logged in?

    I use this method to post a new registered users name and email on the check email for activation page is have. And the only way I can do that is when I have them logged in automatically after they register and it’s been causing Conflict with my Redirects I have for logged in members.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter threwthenevr

    (@threwthenevr)

    I’ve also used $_POST and $_GET but those never worked for me.

    Bunty

    (@bhargavbhandari90)

    Are you sending mail during registration?

    Thread Starter threwthenevr

    (@threwthenevr)

    Odd I never received an email that notified there was a reply.
    I figured out what I needed to do.

       <center><h1> Check Your Email To Activate Your Account!</h1><center>
    
        
     Thanks for registering,<b><?php echo $_POST["signup_username"]; ?></b><br /> You have successfully created your account! <br />To begin using this site you will need to activate your 
       account via the email we have just sent to <b><?php echo $_POST  ["signup_email"] ;?><b>

    I wanted to have the new registered users name and email show up on a certain page for a more personalized feel.

    Moderator bcworkz

    (@bcworkz)

    If they were not logged in, all you could do is rely on a previously set cookie from when they were logged in (or registered). The WP cookies are not useful, they have a hash that can be confirmed on login, but cannot be used to identify anyone without anything to compare against. That is the nature of hashes. Plus the WP cookies are not that long lived.

    You would need to set your own long lived cookie when they are logged in. Then you can check for such cookie when anyone visits (in $_COOKIE). Of course you may not always get their cookie, they could be using a different browser or computer. But if there is one, it’s almost certainly the correct user. Since some people share logins (!), it’s not an absolute certainty.

    Honestly, I don’t think what you are proposing is a good idea. For me, if I were an unsophisticated visitor, demonstrating you know who I am without me logging in is kind of creepy. It would feel like I’m being spied upon. I know a few well known sites do this, so maybe I’m misjudging how people would react. Since references to some of the spyware used by U.S. spy agencies have recently appeared on wikileaks, people are becoming more aware of privacy and security issues. Apparently some Americans now believe their FBI could be watching them through their microwave oven!

    User names are one thing. It’s probably not that big an issue. I would seriously think twice about showing their email. Someone could easily believe their email would also be visible to email scrapers. Of course that is silly, but people do not always think rationally. Those are my thoughts on the matter anyway, you are free to do as you wish on your own site of course. I will try to help you regardless ??

    Thread Starter threwthenevr

    (@threwthenevr)

    Thanks for the reply I really appreciate it. I understand what your saying about showing the new registered users info to that same user without being logged in first.

    Even after you register with Facebook they log you in on the check email for activation link page.

    I was trying to do what they done but I have a custom redirect for users who login and it caused some conflicts when they auto logged in after registration so I had to find another way.

    This code is what I’ll use for now until I am able to find a safer way.

      <center><h1> Check Your Email To Activate Your Account!</h1><center>
    
        
     Thanks for registering,<b><?php echo $_POST["signup_username"]; ?></b><br /> You have successfully created your account! <br />To begin using this site you will need to activate your 
       account via the email we have just sent to <b><?php echo $_POST  ["signup_email"] ;?><b>

    the page that it’s on if refreshed gets the postdata error and redirects to my homepage if they click continue,otherwise if they click exit it returns a blank template.idk if that would make it safer but I’m still learning new stuff as I go pretty much.

    I don’t mind having the WP cookies being short lived if that’s how the code I used works because I only needed that code for a 1 time use per new registered user.I was aiming to give the registration/activation process a more personalized feel for the user. But I don’t want to risk security issues or email scrapers doing any harm with their emails if that code leaves some sort of door open.Im still new to php and still would like to pick up javascript and html. Eventually I’ll get better.

    I really appreciate your help and thoughts.

    Moderator bcworkz

    (@bcworkz)

    Honestly, usernames and emails are not supposed to be sensitive personal information, but some people treat them as such. My suggestions were more based on the perception of insecurity than any real privacy breach. A lot depends on your typical visitor. Some people seem to have little concept of online privacy, and others rabidly protect trivial information as they would passphrases to their bank account.

    AFAIK there is no real risk in exposing this information unless someone has access to your server, in which case you have much bigger problems. Just because the risk is not there does not mean some people would not have great angst over a perceived breach of their privacy.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Wp get current user question’ is closed to new replies.