[horde] redirection logout to a non-frameset(custom logout)

tdrewry at bu.edu tdrewry at bu.edu
Wed Aug 18 13:52:27 PDT 2004


Hi,

I am attempting to alter the logout function from the left hand menu in a HEAD
horde install. For our purposes here we use a custom login script which for
horde's purposes is transparent. The default behaviour of horde with this setup
is to simply reauthenticate whenever a user clicks the Log out button.

So, I've altered the behaviour by adding the following lines to the login.php
script in the main horde directory:

<- snip ->
/* Get parameters. */
$logout_reason = $auth->getLogoutReason();
$url_param = Util::getFormData('url');

// this is the if statement which I've added to make the redirect to
// our logout script.  It's just a call to a php file using header() to redirect
if ($logout_reason == 'logout') {
    include_once HORDE_BASE . '/BU_Logout.php';
    exit;
}
// end of edits

if ($logout_reason) {
    $login_screen = $auth->_getLoginScreen();
<- snip ->

At this point I should explain what I'm trying to accomplish.  The desired
results of selecting the Log out option is to have our script completely
override the frameset.  Currently the Portal's Log out button does this. 
However the left hand menu's option loads our Log out script into the
Horde_main frame.  While this does still successfully logout a client, it is a
bit confusing because the horde menu remains visible.

I've tried using config/registry.php to control this behaviour by adding the
target option to the logout conditional:

<- snip ->
if (Auth::getAuth()) {
    $this->applications['logout'] = array(
        'fileroot' => dirname(__FILE__) . '/..',
        'webroot' => $this->applications['horde']['webroot'],
        'initial_page' => 'login.php?' . AUTH_REASON_PARAM . '=' .
AUTH_REASON_LOGOUT,
        'icon' => $this->applications['horde']['webroot'] .
'/graphics/logout.gif',
        'name' => _("Log out"),
        'target' => '_parent',
        'status' => 'notoolbar'
        );
}
<- snip ->

This is uneffectual though.  I'm not sure why, but the logout button seems to
simply ignore this option. I'm using it for other entries from our modified
menu and it works great.

So, with that in mind I moved on to trying to track down how the top icon
functions and found that the menu items are generated differently as per the
following two file snips:

for the Portal Log out option(templates/portal/menu.inc):

echo
Menu::createItem(Auth::addLogoutParameters(Horde::applicationUrl('login.php'),
AUTH_REASON_LOGOUT), _("_Log out"), '
logout.gif', null, '_parent', null, '__noselection');

and for the left hand menu Log out option(templates/menu/menu.inc):

echo Menu::createItem($m['url'], $m['text'], $m['icon'], $m['icon_path']);

With this in mind I attempted to alter the way the templates/menu/menu.inc was
generated to reflect the desired
behaviour as follows:

<- snip ->
<?php
  foreach ($menu as $m) {
    if($m['text'] != 'Log out')
      echo Menu::createItem($m['url'], $m['text'], $m['icon'], $m['icon_path']);
    else
      echo Menu::createItem($m['url'], $m['text'], $m['icon'], $m['icon_path'],
null, '_parent', null, '__noselection');
    }
?>
<- snip ->

This also did not yield any success :(

Any ideas?  Am I looking in the wrong places?

Thanks,
Toby Drewry
Boston University


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the horde mailing list