How to: integrate other scripts with CMS via Session variables

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
pandamonium54

How to: integrate other scripts with CMS via Session variables

Post by pandamonium54 »

I'd ask this on the irc channel, but my school blocks all irc connections...

I want to have some form of password protection on some pages. These pages should only be viewable by backend users/admins/etc. For example, I removed all password protection from the administration section of a photo gallery, and would like all CMS users to have equal administrative rights to the photo gallery.

Instead of using .htaccess and maintaining a second set of passwords, I wanted to set a session variable like "authenticuser=yes" when a backend user logs in. I can't seem to access the session variables though. I feel like this issue is more php based, but I don't know what parts of CMS to modify to make this work.

Thanks!
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: How to: integrate other scripts with CMS via Session variables

Post by Ted »

By default sessions are turned off on the frontend.  In include.php, comment out:

Code: Select all

if(!@session_id() && (isset($_REQUEST[session_name()]) || isset($CMS_ADMIN_PAGE))) {
and uncomment:

Code: Select all

#if(!@session_id()) {
That should fix your problem.  I guess that should be a config.php option...
Locked

Return to “CMSMS Core”