Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Vanilla outdoors PHP class
DizCow
New
I was looking for a class that could authenticate me outside the Vanilla forums, since i could not find a class that could do this for me i wrote a new PHP class and would like to share it with the world.
Class info:
http://support.dizcow.com/discussion/3/vanilla-outdoors-class-use-vanilla-login-outside-vanilla/#Item_1
Download class:
http://code.google.com/p/dizcow/downloads/detail?name=vanilla_outdoors_1_0.rar
Hope this can help some of you to use the Vannilla loggin outside the forums.
Sample code:
Class info:
http://support.dizcow.com/discussion/3/vanilla-outdoors-class-use-vanilla-login-outside-vanilla/#Item_1
Download class:
http://code.google.com/p/dizcow/downloads/detail?name=vanilla_outdoors_1_0.rar
Hope this can help some of you to use the Vannilla loggin outside the forums.
Sample code:
require_once("./library/class.vanilla.outdoors.php"); $vanilla = new vanilla_outdoors(); if($vanilla->check_login()){ echo '<pre>'; print_r($vanilla->get_user_data()); // This will output an array with all the userdata like username, email etc etc. echo '</pre>'; }else{ echo 'You are not logged in, please loggin first.'; }
1
This discussion has been closed.
Comments
Thank You for this Lines, DizCow..
FYI: because i had a little struggle with that:
If you have the Problem like me, that although youre logged out it still shows as you where logged in (shows your Data), then set your Cookie domain in Config.php!!
$Configuration['Garden']['Cookie']['Domain'] = '.YourDomain.com';
that solves th issue..
ugh... sorry... my mistake... everything's fine...
This is a crude method that force load vanillas and clears the output buffer, so most likely you are not meeting the requirement of 2.1
I a strong believer if you use code like this you must understand what it is actually doing.
grep is your friend.
Hmm... so is there a "right" (AND EASY) Way to do it? What i momentarily need is the Loged in User ID and the discussionID... certainly more in the future, if i extend my "Event plugin" into a "Calender & Event plugin"...
The Outdoors plugin is functioning with 2.1B2, where i get the UserID... the Topic ID i have to steel over the URL....
The UserID and DiscussionID of what? What is the context?
You could use and API.
grep is your friend.
Am I the only one who interprets the title of this discussion as "Vanilla (training) class to be held outdoors"?
My shop | About Me
@Dr_Sommer
http://forum.example.com/profile.json
will contain the data for the currently logged in user in Vanilla.Every time!
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
I'll bring snacks. Who's getting the beers?
note: there is no such thing as "logged in" in a stateless system, you won't be logged in unless you have a session cookie. The basic api, you would connect by the client, or you can forward the session on.
grep is your friend.
@Hgtonight: "http://forum.example.com/profile.json" not working... just spits out an error...
Do i need to download the Vanilla API for that? I tried that, still the same Error (link not found)
You do not have pretty urls enabled, so you need http://caba.de/CaBaFoRuM/index.php?p=/profile.json
ok, great... thats working... thanx R_j
Ahh... this is making me crazy...
I am making a REAL Chat for Vanilla with Node.js... of course as always with minimum knowledge... )
Cause PHP will not quite work with Node,js (or JS is better in this context) i need to use the profile.json File with Javascript..
How can I put the "http://caba.de/CaBaFoRuM/index.php?p=/profile.json" into an Javascript Variable, so that I can read out the Name of the logged in User??
i tried:
and:
But nothing is working.... any Ideas? ThanX in advance...
@Dr_Sommer make a separate discussion srly
grep is your friend.
http://vanillaforums.org/discussion/27419/profile-json-into-a-javascript-variable and I'll close this one to prevent duplicates
There was an error rendering this rich post.