Commit ec6dc719 authored by David Surville's avatar David Surville
Browse files

Test si la classe de gestion d'un rôle possède une méthode __toString pour son...

Test si la classe de gestion d'un rôle possède une méthode __toString pour son affichage, sinon affichage du roleId
parent c7769831
Loading
Loading
Loading
Loading
+2 −1
Changes for src/UnicaenAuth/View/Helper/UserCurrent.php: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -44,7 +44,8 @@ class UserCurrent extends UserAbstract
        
        if ($this->getIdentity()) {
            if ($userProfileSelectable) {
                $status .= sprintf(", <small>%s</small>", $this->getUserContext()->getSelectedIdentityRole());
		$role = $this->getUserContext()->getSelectedIdentityRole();
                $status .= sprintf(", <small>%s</small>", !method_exists($role, '__toString') ? $role->getRoleId() : $role);
            }
        
            $userProfileHelper = $this->getView()->plugin('userProfile'); /* @var $userProfileHelper \UnicaenAuth\View\Helper\UserProfile */