Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Vanilla 2.6 is here! It includes security fixes and requires PHP 7.0. We have therefore ALSO released Vanilla 2.5.2 with security patches if you are still on PHP 5.6 to give you additional time to upgrade.
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

How to use Vanilla's forum accounts in my own site?

idaspinidaspin New
edited April 2015 in Vanilla 2.0 - 2.3

I have a page "http://lalala.com" by example.
And "http://lalala.com/forum" - is Vanilla module(2.1.9)
How i can check UserGroupID from "http://lalala.com" ?

Comments

  • idaspinidaspin New
    edited April 2015

    Ths. Could you give an example - how to use it?
    I mean this:

    <?php {/*Some code. Creating of $userIsAdmin*/;} if ($userIsAdmin) { /* my code of generating AdminPanel*/; } ?>
    <!DOCTYPE html>
    ...

  • What are you trying to to do? Create a single sign on experience, or check vanilla permissions?

    One thing you can do is create module in vanilla. You can load them through javascript on the client side, they will respect the permission of the session.

    grep is your friend.

  • I should check admin permision from non Vanilla page.

  • "online77mg.tk" - the main site.
    In the folder "online77mg.tk/forum" I installed Vanillas forum.
    I have to do this: if the user is online and authorized, he is an administrator, then on the home page ("online77mg.tk/index.php") displayed control panel.
    I do not know how to write this code.

  • hgtonighthgtonight ∞ · New Moderator

    Request the me module (forums.example.com/module/memodule) or profile (forums.example.com/profile.json) from the vanilla installation via AJAX. This will give you the status of the user being signed in or not.

    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.

    Shnoulle
  • x00x00 MVP
    edited April 2015

    Not really understanding you. Maybe you can write in your native language and perhaps somebody will able to translate.

    You want to be able to check permissions. Well you can do this server-server, but you need an API to do this, which is only available for 2.2 not yet officially released. It also carries a bit extra overhead to do the check every request.

    However another API, will work if you wish to load a vanilla module through javascript on the client side, and of-course respect the session, and permission checks for then module. This is the simplest solution, if applicable.

    However in a Single Sign On System. You are basically saying that the main site is goign to be the logon authority (you can also sync roles) over everything rather then vanilla. Therefore you mightn't have to check with vanilla, becuase you would already know based on the role.

    In Vanilla you normally check permissions not roles, as roles are assigned permissions and are subject to change.

    grep is your friend.

Sign In or Register to comment.