From 6cfe392931ed2e18a0b53fd90c1103420b6c44f5 Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel
Date: Sun, 10 May 2009 10:46:17 +0200 Subject: [PATCH] Display the current user and the role associated to this user. --- koward/lib/Koward/Controller/Application.php | 8 ++++++++ koward/lib/Koward/View/shared/_menu.html.php | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/koward/lib/Koward/Controller/Application.php b/koward/lib/Koward/Controller/Application.php index 8346e9c6e..f44de83d5 100644 --- a/koward/lib/Koward/Controller/Application.php +++ b/koward/lib/Koward/Controller/Application.php @@ -37,6 +37,14 @@ class Koward_Controller_Application extends Horde_Controller_Base $this->welcome = isset($this->koward->conf['koward']['greeting']) ? $this->koward->conf['koward']['greeting'] : _("Welcome."); + $this->current_user = Auth::getAuth(); + + $session = Horde_Kolab_Session::singleton(); + if (!empty($session->user_uid)) { + $user = $this->koward->getObject($session->user_uid); + $type = $this->koward->getType($user); + $this->role = $this->koward->objects[$type]['label']; + } } /** diff --git a/koward/lib/Koward/View/shared/_menu.html.php b/koward/lib/Koward/View/shared/_menu.html.php index 3be3269c7..6aaf09724 100644 --- a/koward/lib/Koward/View/shared/_menu.html.php +++ b/koward/lib/Koward/View/shared/_menu.html.php @@ -1,5 +1,10 @@
+ current_user)): ?> +