RE: [PEAR] Pear::Auth and Smarty
| From: | LIMBOURG Arnaud | Date: | Mon, 16 Dec 2002 16:56:10 +0000 |
| Subject: | RE: [PEAR] Pear::Auth and Smarty | ||
| Groups: | php.pear.general php.smarty.general | ||
| Request: | Send a blank email to pear-general+get-2996@lists.php.net to get a copy of this message | ||
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