From: Gunnar Wrobel Date: Fri, 1 May 2009 14:21:42 +0000 (+0200) Subject: Allow defining default views per object type. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=4cc438df9f9fceb2d7045a5524a7bcda84b10936;p=horde.git Allow defining default views per object type. --- diff --git a/koward/lib/Koward/Controller/IndexController.php b/koward/lib/Koward/Controller/IndexController.php index 43fd698a7..60560ff9a 100644 --- a/koward/lib/Koward/Controller/IndexController.php +++ b/koward/lib/Koward/Controller/IndexController.php @@ -37,7 +37,16 @@ class IndexController extends Koward_Controller_Application $entry = sprintf('Login success for %s [%s] to Horde', Auth::getAuth(), $_SERVER['REMOTE_ADDR']); Horde::logMessage($entry, __FILE__, __LINE__, PEAR_LOG_NOTICE); - header('Location: ' . $this->urlFor(array('controller' => 'index', 'action' => 'index'))); + + $type = $this->koward->getType(); + if (!empty($type) && isset($this->koward->objects[$type]['default_view'])) { + $url = $this->urlFor($this->koward->objects[$type]['default_view']); + } else if (isset($this->koward->conf['koward']['default_view'])) { + $url = $this->urlFor($this->koward->conf['koward']['default_view']); + } else { + $url = $this->urlFor(array('controller' => 'index', 'action' => 'index')); + } + header('Location: ' . $url); exit; } else { $entry = sprintf('FAILED LOGIN for %s [%s] to Horde',