2
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/logout.php,v 1.20.2.2 2008/12/12 12:20:22 wurley Exp $
5
* For servers whose auth_type is set to 'cookie' or 'session'. Pass me
6
* the server_id and I will log out the user (delete the cookie)
8
* Variables that come in via common.php
3
* Log the user out of the application.
11
5
* @package phpLDAPadmin
16
12
require './common.php';
18
if (! $ldapserver->haveAuthInfo())
19
error(_('No one is logged in to that server.'),'error','index.php');
21
if (in_array($ldapserver->auth_type, array('cookie','session','http'))) {
22
syslog_notice (sprintf('Logout for %s',$ldapserver->getLoggedInDN()));
23
if($ldapserver->auth_type!='http')
24
$ldapserver->unsetLoginDN() or error(_('Could not logout.'),'error','index.php');
25
unset_lastactivity($ldapserver);
30
error(sprintf(_('Unknown auth_type: %s'),htmlspecialchars($ldapserver->auth_type)),'error','index.php');
34
'body'=>('Logged out successfully from server.'),
36
sprintf('index.php?server_id=%s',$ldapserver->server_id));
14
if ($app['server']->logout())
16
'title'=>_('Authenticate to server'),
17
'body'=>_('Successfully logged out of server.'),
19
sprintf('index.php?server_id=%s',$app['server']->getIndex()));
22
'title'=>_('Failed to Logout of server'),
23
'body'=>_('Please report this error to the admins.'),
25
sprintf('index.php?server_id=%s',$app['server']->getIndex()));