Fix logging out.
authorJan Schneider <jan@horde.org>
Mon, 22 Feb 2010 14:17:16 +0000 (15:17 +0100)
committerJan Schneider <jan@horde.org>
Mon, 22 Feb 2010 14:49:50 +0000 (15:49 +0100)
kronolith/index.php
kronolith/js/kronolith.js
kronolith/templates/index/index.inc

index 1c733c5..a557e53 100644 (file)
@@ -17,10 +17,6 @@ if (!$prefs->getValue('dynamic_view') || !$browser->hasFeature('xmlhttpreq') ||
 }
 
 /* Load Ajax interface. */
-$logout_link = Horde::getServiceLink('logout', 'kronolith');
-if ($logout_link) {
-    $logout_link = Horde::widget($logout_link, _("_Logout"), 'logout');
-}
 $help_link = Horde::getServiceLink('help', 'kronolith');
 if ($help_link) {
     $help_link = Horde::widget($help_link, _("Help"), 'helplink', 'help', Horde::popupJs($help_link, array('urlencode' => true)) . 'return false;');
index 824fe5e..90a1039 100644 (file)
@@ -125,7 +125,7 @@ KronolithCore = {
         msgs.find(function(m) {
             switch (m.type) {
             case 'horde.ajaxtimeout':
-                this.logout(Kronolith.conf.timeout_url);
+                this.logout(m.message);
                 return true;
 
             case 'horde.alarm':
@@ -207,10 +207,10 @@ KronolithCore = {
         }, this);
     },
 
-    logout: function(url)
+    logout: function()
     {
         this.is_logout = true;
-        this.redirect(url || (Kronolith.conf.URI_IMP + '/LogOut'));
+        this.redirect(Kronolith.conf.URI_AJAX + 'LogOut');
     },
 
     redirect: function(url)
@@ -2728,6 +2728,11 @@ KronolithCore = {
                 e.stop();
                 return;
 
+            case 'kronolithLogout':
+                this.logout();
+                e.stop();
+                return;
+
             case 'kronolithMinicalDate':
                 this.go('month:' + orig.retrieve('date'));
                 e.stop();
index 7ed8d9e..2714e15 100644 (file)
@@ -20,7 +20,7 @@
     <?php endif; ?>
     <a href="#" id="kronolithNotifications" class="kronolithNotifications" title="<?php echo ("0 notifications") ?>"></a>
     <span class="kronolithSeparator">|</span>
-    <a href="#" id="kronolithOptions"><?php echo _("Options") ?></a><?php if ($help_link) echo ' <span class="kronolithSeparator">|</span> ' . $help_link; if ($logout_link) echo ' <span class="kronolithSeparator">|</span> ' . $logout_link ?>
+    <a href="#" id="kronolithOptions"><?php echo _("Options") ?></a><?php if ($help_link) echo ' <span class="kronolithSeparator">|</span> ' . $help_link; if (Horde_Menu::showService('logout')) { $ak = Horde::getAccessKey(_("_Logout")); echo ' <span class="kronolithSeparator">|</span> <a href="#" accesskey="' . $ak . '" id="kronolithLogout">' . Horde::highlightAccessKey(_("_Logout"), $ak) . '</a>'; } ?>
   </div>
   <!-- end services -->