19 lines
568 B
PHP
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>';
|
|
}
|
|
}
|
|
} |