2010-09-14 16:37:30 +00:00

19 lines
568 B
PHP

<?php
class Zend_View_Helper_ProfileLink extends Zend_View_Helper_Abstract
{
public function profileLink()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$username = $auth->getIdentity();
$logoutUrl = $this->view->url(array(
'controller' => 'user',
'action' => 'logout'
));
return '<a href="'.$logoutUrl.'" alt="Se déconnecter">Login : ' . $username . '</a>';
} else {
return '<p>Identifiez-vous pour accèder aux ressources</p>';
}
}
}