RE: [SMARTY] RE: [PEAR] Pear::Auth and Smarty

From: Date: Mon, 16 Dec 2002 17:46:52 +0000
Subject: RE: [SMARTY] RE: [PEAR] Pear::Auth and Smarty
References: 1  Groups: php.pear.general php.smarty.general 
Request: Send a blank email to pear-general+get-2997@lists.php.net to get a copy of this message
Me again! OK I've almost got it to work I think. I just have one problem...Smarty doesn’t seem to recognise: &SmartyPool::alloc(); Is this from an old version or something? I have checked the Smarty mailing lists but have come up with nothing as yet. Can you shed some light on this? Thanks Simon H > -----Original Message----- > From: LIMBOURG Arnaud [mailto:arnaud.limbourg@cegetel.fr] > Sent: Monday, December 16, 2002 4:56 PM > To: Simon H; LIMBOURG Arnaud; 'Pear-General'; 'Smarty-General' > Subject: [SMARTY] RE: [PEAR] Pear::Auth and Smarty > Sensitivity: Confidential > > > class myAuth extends Auth > { > function drawLogin($username = '') > { > $server = &Auth::_importGlobalVariable("server"); > > $smarty = &SmartyPool::alloc(); > > $msg = 'Open Session'; > > if (!empty($this->status) && $this->status == AUTH_EXPIRED) { > $msg = 'Votre session a expirée. Veuillez vous > authentifier à nouveau.'; > } else if (!empty($this->status) && $this->status == > AUTH_IDLED) { > $msg = 'Votre session est ouverte depuis trop > longtemps. Veuillez vous authentifier à nouveau.'; > } else if (!empty ($this->status) && $this->status == > AUTH_WRONG_LOGIN) { > $msg = 'Données incorrectes.'; > } > > $smarty->assign('AUTHMESSAGE', $msg); > $buffer = $smarty->fetch('login.tpl'); > > $smarty->assign('MIDDLE', $edito); > $smarty->display('portail.tpl'); > SmartyPool::free($smarty); > exit; > } // end func drawLogin > > } > > This code is very old but it is used in production and works well. > > Arnaud. > > > Thanks for your quick reply Arnaud! > > > > Would you have an example you could provide. I did think > > that extending > > the class might be the way to go, but this is beyond me > unfortunately. > > > > Thanks for your help once again. > > > > Simon H >

« previous php.pear.general (#2997) next »