BullGuard Antivirus Sale - 60% Off with openElement !
Forum openElement Homepage
Forum Home Forum Home >

openElement

> Dynamic OE - Databases, etc
  New Posts New Posts RSS Feed - SSO Vanilla Forum + oeUserspace
  FAQ FAQ  Forum Search   Register Register  Login Login

SSO Vanilla Forum + oeUserspace

 Post Reply Post Reply
Author
Message
Vampaerus View Drop Down
Newbie
Newbie
Avatar

Joined: Apr 03 2016
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vampaerus Quote  Post ReplyReply Direct Link To This Post Topic: SSO Vanilla Forum + oeUserspace
    Posted: Apr 03 2016 at 5:58pm
Hello,
I created a private web space using OE and the Userspace01 packs. Very impressive how robust a site was possible to create quickly.  I would love to embed a Vanilla Forum in this site.  Vanilla provides a library for making a Single Sign On with existing user db. But I need to stitch in the code necessary to access the current session and retrieve username/email from the database.   I assume userspace is already performing this as a core function.  I took a quick look under the hood but there is so much going on I am having trouble finding my way around the code.  Does anyone have any experience tying together oe with 3rd party forums? Or anyone can point me toward what file(s) I could include and functions I could use to retrieve the current user if one exists?
thanx in advance, -Dan
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group
Avatar

Joined: May 31 2012
Status: Offline
Points: 5186
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: Apr 03 2016 at 10:38pm
Hi,

Please tell what data you need to read and to write, precisely, what operations there are to be coded.
Back to Top
Vampaerus View Drop Down
Newbie
Newbie
Avatar

Joined: Apr 03 2016
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vampaerus Quote  Post ReplyReply Direct Link To This Post Posted: Apr 04 2016 at 6:27am
part of the example file from Vanilla:

// 2. Grab the current user from your session management system or database here.
$signedIn = true; // this is just a placeholder
// YOUR CODE HERE.
// 3. Fill in the user information in a way that Vanilla can understand.
$user = array();
if ($signedIn) {
   // CHANGE THESE FOUR LINES.
   $user['uniqueid'] = '123';
   $user['name'] = 'John PHP';
   $user['email'] = 'john.php@anonymous.com';
   $user['photourl'] = '';
}


eta: I only need read access to userspace.


Edited by Vampaerus - Apr 04 2016 at 6:29am
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group
Avatar

Joined: May 31 2012
Status: Offline
Points: 5186
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: Apr 04 2016 at 4:22pm
When a user is connecte,it's unique ID is accessed as:

$userID = $_SESSION['oelog01_UserID'];

(don't forget to call session_start() before using the session).

With this you can get other values, but it depends on the chosen database engine (do you use SQLite or MySQL? You can use a database edit tool like PHPMyAdmin to see the data structure).

There's also a way to do this using the dynamic engine of OE (the same engine used to make the Packs work - they are all created in OE with nearly no manual code) to create amnual function but the interface is "developers-only" (to not tell bad words) and it may be rather hard even for experienced pros.

You can also do it in 2 stages - get the needed values using the Pack 70, then send it to another page or by Ajax.

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 10.11
Copyright ©2001-2012 Web Wiz Ltd.

This page was generated in 0,039 seconds.