dog199200 Guest | API: Email Verification Check (How To) (26th Jan 10 at 12:29am UTC) | | Ross,
How would you go about doing an account confirmation check for the API? The reason i am asking is because even if the account is not verified via email they can still login on the website, and i want it to that they can't login anywhere unless their account is email verified. | |
|
Ross Administrator
    
![[Avatar]](http://uploads.virtualforums.co.uk/forums/pokemon/vforums-qr1.png) Posts: 3,709 Status: Offline Gender: Male Age: 9 1⁄4 Joined:
Additional Groups: Support Team
  
pmwwwgtalkvForum | Re: API: Email Verification Check (How To) (26th Jan 10 at 10:01am UTC) | | Something along these lines Obviously varying depending on how you have yours setup. I'd put it directly after you perform the login so that if they have not validated their e-mail you can straight away change their status to that of a guest.
$user_info = $vf -> login_user("user", "pass"); if(!is_array($user_info) || $user_info['validated_email'] == '0') { $user_info = $vf -> logged_in = $vf -> api_user = $vf -> api_pass = false; // + Any code here to tell the user they have to validate their e-mail }
| |
|
|
dog199200 Guest | Re: API: Email Verification Check (How To) (26th Jan 10 at 12:50pm UTC) | | The only problem I am seeing is that it does it automatically, it doesn't wait will they hit the submit button on the login form, and if run it after they login it doesn't log them back out i don't see how it work, maybe it work putting it into the API source?
| |
|
Ross Administrator
    
![[Avatar]](http://uploads.virtualforums.co.uk/forums/pokemon/vforums-qr1.png) Posts: 3,709 Status: Offline Gender: Male Age: 9 1⁄4 Joined:
Additional Groups: Support Team
  
pmwwwgtalkvForum | Re: API: Email Verification Check (How To) (26th Jan 10 at 1:42pm UTC) | | $user_info = $vf -> login_user("user", "pass"); if(!is_array($user_info) || $user_info['validated_email'] == '0') { if(is_array($user_info) && $user_info['validated_email'] == '0') { // + Any code here to tell the user they have to validate their e-mail } $user_info = $vf -> logged_in = $vf -> api_user = $vf -> api_pass = false; }
Try that. It's got an extra check to ensure they're tried to login. | |
|
|
dog199200 Guest | Re: API: Email Verification Check (How To) (26th Jan 10 at 2:11pm UTC) | | No change other then it wont say anything to guest. Though the person of the account can login perfectly fine | |
|
Ross Administrator
    
![[Avatar]](http://uploads.virtualforums.co.uk/forums/pokemon/vforums-qr1.png) Posts: 3,709 Status: Offline Gender: Male Age: 9 1⁄4 Joined:
Additional Groups: Support Team
  
pmwwwgtalkvForum | Re: API: Email Verification Check (How To) (26th Jan 10 at 11:13pm UTC) | | Can you clarify? It's still not showing the message etc. to those without validated e-mails?
If I get chance I'll try setting it up on one of my API powered sites. | |
|
|
dog199200 Guest | Re: API: Email Verification Check (How To) (26th Jan 10 at 11:43pm UTC) | | Well it shows the message when the login, but the idea is to prevent them from logging in and then displaying the message lol, I guess I could have it remove the cookie if verification returns false, and then echo out what i need to say.
Edit: nope that wont work either
and while i think about it, have you added a way to assign usergroups upon registration via the api? I know we talked about it before and you said it be something you'd look into, just not sure if its been added or is planning on being added. | |
|
Ross Administrator
    
![[Avatar]](http://uploads.virtualforums.co.uk/forums/pokemon/vforums-qr1.png) Posts: 3,709 Status: Offline Gender: Male Age: 9 1⁄4 Joined:
Additional Groups: Support Team
  
pmwwwgtalkvForum | Re: API: Email Verification Check (How To) (27th Jan 10 at 10:50am UTC) | | Can you post/pm the code you're using for the login / showing the message as well as which checks you're doing further down the page to see if the user is logged in?
Presuming the latest API version:
$vf -> request("add_to_group", Array("group" => 6));
That would add the currently logged in user to group6. | |
|
|
dog199200 Guest | Re: API: Email Verification Check (How To) (27th Jan 10 at 10:59am UTC) | | I have all of my pages build together using the include function, so i'll zip of a few relevant pages and PM them to you.
hmm ok i'll try that and see if it works, but you did say logged in, and my registration system is still very buggy and some times logged the person in when the register and some times it doesn't
Edit: yep, as i though, no go maybe i put it into my registration wrong, but i doubt it. | |
|