Esempio n. 1
0
 /**
  * Checks if link should be shown and return the nescessary code.
  *
  * @param string  $type      Type of link to display
  * @param string  $app       The name of the current Horde application.
  * @param boolean $override  Override Horde settings?
  * @param boolean $referrer  Include the current page as the referrer (url=)?
  *
  * @return string  The HTML to create the link.
  */
 function getServiceLink($type, $app, $override = false, $referrer = true)
 {
     if (!Horde::showService($type, $override)) {
         return false;
     }
     switch ($type) {
         case 'help':
             if ($GLOBALS['browser']->hasFeature('javascript')) {
                 Horde::addScriptFile('popup.js', 'horde', true);
             }
             $url = Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/help/', true);
             return Util::addParameter($url, 'module', $app);
         case 'problem':
             return Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/problem.php?return_url=' . urlencode(Horde::selfUrl(true, true, true)));
         case 'logout':
             return Horde::url(Auth::addLogoutParameters($GLOBALS['registry']->get('webroot', 'horde') . '/login.php', AUTH_REASON_LOGOUT));
         case 'login':
             return Auth::getLoginScreen('', $referrer ? Horde::selfUrl(true) : null);
         case 'options':
             global $conf;
             if ($conf['prefs']['driver'] != '' && $conf['prefs']['driver'] != 'none') {
                 return Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs.php?app=' . $app);
             }
             break;
     }
     return false;
 }
Esempio n. 2
0
    $login_screen = Util::addParameter($login_screen, 'frameset', Util::getFormData('frameset'));
    header('Location: ' . $login_screen);
    exit;
}
if ($browser->isMobile()) {
    require_once HORDE_LIBS . 'Horde/Mobile.php';
    require HORDE_TEMPLATES . '/login/mobile.inc';
    exit;
}
/* Build the <select> widget containing the available languages. */
if (!$prefs->isLocked('language')) {
    $_SESSION['horde_language'] = NLS::select();
    $langs = '<select name="new_lang" onchange="selectLang()">';
    foreach ($nls['languages'] as $key => $val) {
        $sel = $key == $_SESSION['horde_language'] ? ' selected="selected"' : '';
        $langs .= "<option value=\"{$key}\"{$sel}>{$val}</option>";
    }
    $langs .= '</select>';
}
$title = _("Log in");
$notification->push('setFocus()', 'javascript');
if ($logout_reason && $conf['menu']['always']) {
    $notification->push('if (window.parent.frames.horde_menu) window.parent.frames.horde_menu.location.reload();', 'javascript');
}
$reason = $auth->getLogoutReasonString();
/* Add some javascript. */
Horde::addScriptFile('enter_key_trap.js', 'horde');
require HORDE_TEMPLATES . '/common-header.inc';
$notification->notify(array('listeners' => 'status'));
require HORDE_TEMPLATES . '/login/login.inc';
require HORDE_TEMPLATES . '/common-footer.inc';
Esempio n. 3
0
            }
        } else {
            $tmp[$app] = $params;
        }
    }
    $registry->applications = $tmp;
}
@define('AUTH_HANDLER', true);
@define('HORDE_BASE', dirname(__FILE__) . '/../..');
require_once HORDE_BASE . '/lib/base.php';
require_once HORDE_LIBS . 'Horde/Menu.php';
require_once HORDE_LIBS . 'Horde/Help.php';
if (!Auth::getAuth() && !$conf['menu']['always']) {
    Horde::authenticationFailureRedirect();
}
Horde::addScriptFile('menu.js');
Menu::useAccessKeys(false);
if ($browser->hasQuirk('scrollbar_in_way')) {
    $notification->push('correctWidthForScrollbar()', 'javascript');
}
$bodyClass = 'sidebar';
if (Util::getFormData('mozbar')) {
    $target = '_content';
    $bodyClass .= ' nomargin';
} else {
    $target = 'horde_main';
}
require HORDE_TEMPLATES . '/common-header.inc';
// Build the array so we have parents and children all lined up.
buildMenu();
// Loop through the registry and create the <div>s.