public static function getInitialPage() { global $injector, $prefs, $registry; $init_url = $prefs->getValue('initial_page'); if (!$init_url || !$injector->getInstance('IMP_Factory_Imap')->create()->access(IMP_Imap::ACCESS_FOLDERS)) { $init_url = 'INBOX'; } if ($init_url == IMP::INITIAL_FOLDERS) { $mbox = null; } else { $mbox = IMP_Mailbox::get($init_url); if (!$mbox->exists) { $mbox = IMP_Mailbox::get('INBOX'); } } $result = new stdClass(); $result->mbox = $mbox; switch ($registry->getView()) { case Horde_Registry::VIEW_BASIC: case Horde_Registry::VIEW_DYNAMIC: $result->url = IMP_Dynamic_Mailbox::url(array('mailbox' => is_null($mbox) ? 'INBOX' : $mbox)); break; case Horde_Registry::VIEW_MINIMAL: case Horde_Registry::VIEW_SMARTMOBILE: $result->url = is_null($mbox) ? Horde::url('smartmobile.php', true) : $mbox->url('mailbox'); break; } return $result; }
<?php /** * Base redirection page for IMP. * * Copyright 1999-2015 Horde LLC (http://www.horde.org/) * * See the enclosed file COPYING for license information (GPL). If you * did not receive this file, see http://www.horde.org/licenses/gpl. * * @author Chuck Hagenbuch <*****@*****.**> * @category Horde * @copyright 1999-2015 Horde LLC * @license http://www.horde.org/licenses/gpl GPL * @package IMP */ // Will redirect to login page if not authenticated. require_once __DIR__ . '/lib/Application.php'; Horde_Registry::appInit('imp'); IMP::getInitialPage()->url->redirect();