Print Page | Close Window

SSO Vanilla Forum + oeUserspace

Printed From: openElement Website
Category:

openElement


Forum Name: Dynamic OE - Databases, etc
Forum Description: openElement's database management system and Element Packs
URL: https://forums.openelement.uk/en/forum_posts.asp?TID=682
Printed Date: Mar 29 2024 at 8:43am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SSO Vanilla Forum + oeUserspace
Posted By: Vampaerus
Subject: SSO Vanilla Forum + oeUserspace
Date 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



Replies:
Posted By: Dmit OE
Date 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.


Posted By: Vampaerus
Date 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.


Posted By: Dmit OE
Date 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.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net