Re: [SMARTY] Authentication with Smarty

From: Date: Wed, 05 Nov 2003 11:37:24 +0000
Subject: Re: [SMARTY] Authentication with Smarty
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10501@lists.php.net to get a copy of this message
I would go exactly the same way as you did without smarty. However you could upload a set of rights in an array whenever somebody is logging in. In you smarty script you can use this to restrict acces in this way... {if $acces_view eq 'y' { bla bla } Don't forget Smarty isn't ment to do alot of programing. But is meant for the display part. PhP code sould do the rest. I always make A. libarary. (using pear) B. php receiving code from libarary C. Smarty template So three layers. Onno Timmerman (Enquest on the forum) Ps. hopes this helps... I'm not te expert like boots or other gurus! Vonleigh Simmons wrote:
Hello,
    I've been writing php pages for a while, but just recently discovered pear and smarty. I still don't have my head quite around some of the ways of working php with smarty together; so please excuse me if this question is very simple.
    Basically I want to make a section of the site only available to registered users. Normally I would've just included a security.php page that checks if you're logged in and if not prompts you for a login/password. Now, when doing this with smarty how exactly would I go about it? My initial thought would be to call the security.php page from the template files that require it, and that in turn would display the login form (maybe using another template, say security.tpl).
    Is this correct or am I using smarty incorrectly?
Vonleigh Simmons [vanlei] San Francisco, CA <www.illusionart.com/pi/>


« previous php.smarty.general (#10501) next »