vForums Support > vForums :: Report a Bug :: Resolved Bugs :: > API and Verification Email Bugs

API and Verification Email Bugs - Posted By dog199200 (dog199200) on 28th Jan 10 at 8:09am
Ross,

Problem One:

I was tweaking with the registration system some more and created an account and for some reason the validation email is being received like this {Unsure}

http://i25.photobucket.com/albums/c51/dog199200/errorvalid.jpg

The username, password, none of that can even be seen.



Problem Two:

After a few guess and hit clicks to be able to click the validation link, it gave me this:

http://www.divineshadowsonline.com/action/validate/key/9f0ba05d0918fec982589156cd469451

The problem is that it doesn't work to well since the url to use it is http://www.forum.divineshadowsonline.com/action/validate/key/9f0ba05d0918fec982589156cd469451 {Unsure} so its seeing my domain, but ignoring my subdomain which don't work.



Question:

I know there is a check in the API to see if the forum is sending the email, but how can you get it so that the forum doesn't send the email at all, where I can send my own custom email, from one of my own email addresses, and yet still be able to send the validation keys and stuff?

Re: API and Verification Email Bugs - Posted By Ross (admin) on 28th Jan 10 at 11:29am
Problem 1: It's having trouble loading the skin information. I'll have to check what you've got setup and what it is trying to load. I'll probably also put in a fail-safe so if it cannot find a skin to load it uses some basic one with a font size defined.

Problem 2: I will have to check which domain it attempts to use. It may need two domains defining (one for cookies and one for e-mail links). I'll do some tests and get back to you.

Re: API and Verification Email Bugs - Posted By dog199200 (dog199200) on 28th Jan 10 at 11:32am
OK oh and speaking of domains, i'd also like to note that the API doesn't exactly work to well with cross domain related things, and that includes sub-domains. I can logout of the forum at the same time as the website, but if there is places using another sub-domain like http://www.store.divineshadowsonline.com, it wont log out of it, even if all the system are exactly the same {Unsure}

Re: API and Verification Email Bugs - Posted By Ross (admin) on 28th Jan 10 at 11:12pm
You would need to make sure that all cookies are stored on the .divineshadowsonline.com domain. I've not looked at #2 yet so am not sure what domain your forum is using for cookies yet.

#1 should now be fixed.

Re: API and Verification Email Bugs - Posted By dog199200 (dog199200) on 28th Jan 10 at 11:50pm
Ok i'll test out the first bug and see if its fixed.

after for two, if its calling off of the forum for the cookie that cause the problem XD

Re: API and Verification Email Bugs - Posted By dog199200 (dog199200) on 2nd Feb 10 at 2:34am
any luck in finding out what domain all the cookies and stuff are being saved too as well as the second problem I pointed out?

Re: API and Verification Email Bugs - Posted By Ross (admin) on 6th Feb 10 at 12:07am
I'm just trialling a fix for the cookie issues. I've run out of time now but will try to get it applied to your forum sometime tomorrow (it also requires a slight change to the API)

Re: API and Verification Email Bugs - Posted By dog199200 (dog199200) on 6th Feb 10 at 1:34am
ok np, i'll just need an idea of how much it effect my coding, most everything i have done it login checks

Re: API and Verification Email Bugs - Posted By Ross (admin) on 6th Feb 10 at 11:25am
Posted By dog199200 on 6th Feb 10 at 1:34am
 
ok np, i'll just need an idea of how much it effect my coding, most everything i have done it login checks


It's just a case of changing 3 lines in the vforums_api.php file {Smile}

Re: API and Verification Email Bugs - Posted By dog199200 (dog199200) on 6th Feb 10 at 12:08pm
ah ok, so nothing drastic XD

Re: API and Verification Email Bugs - Posted By Ross (admin) on 6th Feb 10 at 9:34pm
OK, I have the necessary changes to the forum. Now for the API. In the vforums_api.php change these lines:

header("Set-Cookie: pass=$pass; expires=". date("D, d-M-Y H:i:s T", $login_time) ."; path=/; HTTPonly;", false);
header("Set-Cookie: user=$user; expires=". date("D, d-M-Y H:i:s T", $login_time) ."; path=/;", false);

if($this -> domain && !empty($this -> domain)) {
header("Set-Cookie: pass=$pass; domain=". preg_replace("/^https?:\/\//", "", $this -> domain) ."; expires=". date("D, d-M-Y H:i:s T", $login_time) ."; path=/; HTTPonly;", false);
header("Set-Cookie: user=$user; domain=". preg_replace("/^https?:\/\//", "", $this -> domain) ."; expires=". date("D, d-M-Y H:i:s T", $login_time) ."; path=/;", false);
}


With this:

if($this -> domain && !empty($this -> domain)) {
header("Set-Cookie: pass=$pass; domain=". preg_replace("/^https?:\/\//", "", $this -> domain) ."; expires=". date("D, d-M-Y H:i:s T", $login_time) ."; path=/; HTTPonly;", false);
header("Set-Cookie: user=$user; domain=". preg_replace("/^https?:\/\//", "", $this -> domain) ."; expires=". date("D, d-M-Y H:i:s T", $login_time) ."; path=/;", false);
} else {
header("Set-Cookie: pass=$pass; expires=". date("D, d-M-Y H:i:s T", $login_time) ."; path=/; HTTPonly;", false);
header("Set-Cookie: user=$user; expires=". date("D, d-M-Y H:i:s T", $login_time) ."; path=/;", false);
}


Then, whenever you initiate the API you need to ensure you set the third parameter as your domain (without the www)

$vf = new vforums_api('username.vforums.co.uk', 'SecretKey', 'divineshadowsonline.com');

I'd recommend manually clearing the cookies / using a fresh browser to test it incase you have old cookies stored still.

Re: API and Verification Email Bugs - Posted By dog199200 (dog199200) on 7th Feb 10 at 1:10am
What one do I change, ro do I chanve both cases that this shows up?
Code:
 
  1. header("Set-Cookie: pass=$pass; expires=". date("D, d-M-Y H:i:s T", $login_time) ."; path=/; HTTPonly;", false);
  2. header("Set-Cookie: user=$user; expires=". date("D, d-M-Y H:i:s T", $login_time) ."; path=/;", false);
  3. if($this -> domain && !empty($this -> domain)) {
  4. header("Set-Cookie: pass=$pass; domain=". preg_replace("/^https?:\/\//", "", $this -> domain) ."; expires=". date("D, d-M-Y H:i:s T", $login_time) ."; path=/; HTTPonly;", false);
  5. header("Set-Cookie: user=$user; domain=". preg_replace("/^https?:\/\//", "", $this -> domain) ."; expires=". date("D, d-M-Y H:i:s T", $login_time) ."; path=/;", false);
  6. }
 


Its shows up under both Logout and login_user functions

Re: API and Verification Email Bugs - Posted By Ross (admin) on 7th Feb 10 at 1:12am
Just for login. Logout is slightly different {Smile}

Re: API and Verification Email Bugs - Posted By dog199200 (dog199200) on 7th Feb 10 at 1:14am
yea i just noticed that when looking at then through a syntax highlighter

Edit: Ok it seems to be working ok, at least its not breaking the code. I just changed hosts and they have yet to configure my DNS settings for me, so I can't test the sub-domains, but i will as soon as I can. As well seems as if the email is working right again so thank you very much {Smile}

Re: API and Verification Email Bugs - Posted By Nick (nickb) on 7th Feb 10 at 8:12pm
I can confirm that it's working properly, because I registered and got the email, and it looked normal.