Display the current user and the role associated to this user.
authorGunnar Wrobel <p@rdus.de>
Sun, 10 May 2009 08:46:17 +0000 (10:46 +0200)
committerGunnar Wrobel <p@rdus.de>
Sun, 10 May 2009 08:46:17 +0000 (10:46 +0200)
koward/lib/Koward/Controller/Application.php
koward/lib/Koward/View/shared/_menu.html.php

index 8346e9c..f44de83 100644 (file)
@@ -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'];
+        }
     }
 
     /**
index 3be3269..6aaf097 100644 (file)
@@ -1,5 +1,10 @@
 <div id="menu">
  <?= $this->menu->render(); ?>
 </div>
+     <?php if (!empty($this->current_user)): ?>
+  <div id="menuBottom"><?php echo _("Current user: ") . $this->current_user; ?>
+  <?php if (!empty($this->role)) {echo '| ' . _("Role: ") . $this->role;} ?>
+  </div><br class="clear" />
+<?php endif; ?>
 <?php $this->koward->notification->notify(array('listeners' => 'status')) ?>