Page 1 of 1

creating a session in the front end

Posted: Thu Oct 11, 2007 10:26 am
by scotch33
I have a site that has a login area that is (for reasons not relavant here) not part of CMSMS.

However, once the user is logged in, they occasionally move into the pages that are controlled by CMSMS.  In the pages there are two elements i would like to hide to logged in users (the login form and the register button - both html in the template and not controlled by cmsms)

I have created a user tag {session} which I am calling at the top of the template as follows -

session_start();
$showstuff ="yes";
if ($_SESSION['hav_logged_in'] == 'true') {
$showstuff = "no";
}

the idea being that I can then create smarties to show the html elements accordingly using the $showstuff variable as a control.

However, the session is not working.

Can anyone help on this?  Is there a CMSMS frontend session that is part of the system which could be creating the issue?

thanks

John

Re: creating a session in the front end

Posted: Fri Oct 12, 2007 5:28 pm
by Pierre M.
Hello,

you haven't found the FrontEnd Users (FEU) module yet, have you ?
Nor CustomContent ? Which could integrate calls to your other system's content.

Pierre M.

Re: creating a session in the front end

Posted: Mon Oct 15, 2007 9:49 am
by scotch33
hi,

yes I have, and have used it on a number of sites over the past couple of years - its not appropriate for this site - thus my question as above.  Thanks for the tip - but FEU is no use to me on this one - unless it can be used as a way of simply opening a session that will allow me to refer to my existing session as created in the external system I am using.

thanks

Re: creating a session in the front end

Posted: Mon Oct 15, 2007 1:03 pm
by calguy1000
Have you looked at the smarty manual at http://smarty.php.net/manual/en
smarty has access to all of the variables you can get in php.

Also, CMS Made Simple does a session_start() automatically.

Re: creating a session in the front end

Posted: Tue Oct 16, 2007 5:57 pm
by scotch33
thanks!  Will take a look.

Re: creating a session in the front end

Posted: Sun Nov 25, 2007 9:33 pm
by beamer
Hi,

Did you get this problem resolved?  I'm having the exact same issue and am having no success in resolving it.

Ideas greatfully accepted!!

Thanks!

Re: creating a session in the front end

Posted: Sun Nov 25, 2007 10:42 pm
by beamer