vForums Support :: vForums :: Report a Bug :: Resolved Bugs :: API and Verification Email Bugs - View Topic
 |  |
| dog199200 Guest | | 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 and Verification Email Bugs (28th Jan 10 at 11:29am UTC) | | 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. | |
|
| dog199200 Guest | Re: API and Verification Email Bugs (28th Jan 10 at 11:32am UTC) | | 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 | |
| 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 and Verification Email Bugs (28th Jan 10 at 11:12pm UTC) | | 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.
| |
|
| dog199200 Guest | Re: API and Verification Email Bugs (28th Jan 10 at 11:50pm UTC) | | 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 | |
| dog199200 Guest | Re: API and Verification Email Bugs (2nd Feb 10 at 2:34am UTC) | | 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? | |
| 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 and Verification Email Bugs (6th Feb 10 at 12:07am UTC) | | 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) | |
|
| dog199200 Guest | Re: API and Verification Email Bugs (6th Feb 10 at 1:34am UTC) | | ok np, i'll just need an idea of how much it effect my coding, most everything i have done it login checks | |
| 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 and Verification Email Bugs (6th Feb 10 at 11:25am UTC) | | 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 | |
|
| dog199200 Guest | Re: API and Verification Email Bugs (6th Feb 10 at 12:08pm UTC) | | ah ok, so nothing drastic XD | |
| 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 and Verification Email Bugs (6th Feb 10 at 9:34pm UTC) | | 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. | |
|
| dog199200 Guest | Re: API and Verification Email Bugs (7th Feb 10 at 1:10am UTC) | | What one do I change, ro do I chanve both cases that this shows up?
 Code: - 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);
- }
Its shows up under both Logout and login_user functions | |
| 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 and Verification Email Bugs (7th Feb 10 at 1:12am UTC) | | Just for login. Logout is slightly different | |
|
| dog199200 Guest | Re: API and Verification Email Bugs (7th Feb 10 at 1:14am UTC) | | 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
| |
| Nick Very Senior Member
    
![[Avatar]](http://uploads.vforums.co.uk/forums/support/f_5e7b1402b305d883af97446b2fedc6c2_1-eog.jpeg) Posts: 3,012 Status: Offline Gender: Male Location: vForums Age: 35 Joined:
pmwww | Re: API and Verification Email Bugs (7th Feb 10 at 8:12pm UTC) | | I can confirm that it's working properly, because I registered and got the email, and it looked normal. | |
| |
 |  |
|