2 nate_02631 Dec 15, 2008 22:43

where do you have session_start() before setting it in the b2 code?
Actually I don't have session statr (in _item_simple.form.php)... When I add one, i get headers already output there...
However - now I can out put the $_SESSION vars in the b2evo footer... However when I try to use them for authentication in a TinyMCE plugin they are empty... The Tinymce dev claims they aren't being destroyed by TinyMCE....
Hi all just an update - maybe will shed more light into the problem... But it seems either b2evo is nuking the sessions, or I am not accessing them correctly...
As a test, I set $_SESSION['usrlvl'] to some value in the edit page, then I have a link to a plain-jane .php page outside of the blog app (on same site of course), something to the effect of:
<? session_start();
echo 'usrlvl: '.$_SESSION['usrlvl'];
?>
Does anyone know why this session var isn't being carried in or how I may access it outside of b2evolution...
Thanks for any help - desperate for an answer ;-)
You might be able to use function AdminAfterMenuInit() in a plugin to start the session, if not then you'll need to use $_COOKIES as evo doesn't use $_SESSION
¥
Thanks for the reply.... Questions in bold...
Just so it's clear - here's what I need to accomplish... I need to be able to tell if the current logged in user is level 9 or above from a page outside of the /blogs/ directory...
My thought was I could simply set a $_SESSION var in the edit page(s) where I need this info passed then read that $_SESSION from an external page outside of /blogs/
Is the fact that the *cookie* domain is set to /blogs/ preventing me from seeing the $_SESSION vars outside of /blogs/ ? (I can't test cause anything in blogs tried to redirect)
As for cookies - it wasn't working at first, but I wasn't setting the path right... I can set and read the cookies, but I have to place it before anything is output.
How can I check the current user level and set the cookie before any output is made?
If all else failed I would have liked to just to be able to access $current_User->level outside of /blogs/. I try making an external file with:
require_once '../blogs/conf/_config.php';
require_once $inc_path.'_main.inc.php';
global $current_User;
echo $current_User->ID;
...but the object isn't recognized.
What is the method (if any) to access the $current_User outside of the /blogs/?
Thanks for the current and any future feedback. I feel like I'm missing something really stupid here...
1) no idea, I've never used sessions, but it sounds plausible
2) the function I referenced above will do that ( in a plugin )
3) I'm guessing you were right about #1 because you should have a $current_User;
¥
Hi - I think I have this... Kind of a dumb mistakes, but I guess those are the once that take you hours to figure out.
My settings are such that session_autostart is off... and the place where I was putting the session start was apparently after output so it wasn't actually starting the session (though not giving me feedback that it wasn't started)
Bump - redid title... I'm basically trying to get a plugin for my WYSIWYG editor to authenticate based on if b2 user is logged in or not...
It seems though that b2evolution is killing my $_SESSION var - how can I get it to not do this - or how can I pass the var to an outside script for authentication?
Any help is appreciated!
Related thread here: http://tinymce.moxiecode.com/punbb/viewtopic.php?pid=46676#p46676