phpldapadmin/htdocs/logout.php

50 lines
1.2 KiB
PHP
Raw Normal View History

2009-06-30 09:22:30 +00:00
<?php
2009-06-30 10:26:08 +00:00
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/logout.php,v 1.17.4.4 2005/12/16 11:33:07 wurley Exp $
2009-06-30 09:22:30 +00:00
2009-06-30 09:29:51 +00:00
/**
* For servers whose auth_type is set to 'cookie' or 'session'. Pass me
2009-06-30 09:22:30 +00:00
* the server_id and I will log out the user (delete the cookie)
*
2009-06-30 09:29:51 +00:00
* Variables that come in via common.php
2009-06-30 09:22:30 +00:00
* - server_id
2009-06-30 09:29:51 +00:00
*
* @package phpLDAPadmin
*/
/**
2009-06-30 09:22:30 +00:00
*/
2009-06-30 09:29:51 +00:00
require './common.php';
2009-06-30 09:22:30 +00:00
2009-06-30 09:29:51 +00:00
if (! $ldapserver->haveAuthInfo())
2009-06-30 10:26:08 +00:00
pla_error(_('No one is logged in to that server.'));
2009-06-30 09:22:30 +00:00
2009-06-30 09:29:51 +00:00
if (in_array($ldapserver->auth_type, array('cookie','session'))) {
2009-06-30 10:26:08 +00:00
syslog_notice (sprintf('Logout for %s',$ldapserver->getLoggedInDN()));
$ldapserver->unsetLoginDN() or pla_error(_('Could not logout.'));
2009-06-30 09:29:51 +00:00
unset_lastactivity($ldapserver);
2009-06-30 09:22:30 +00:00
2009-06-30 10:26:08 +00:00
if (isset($_SESSION['cache'][$ldapserver->server_id]['tree'])) {
unset($_SESSION['cache'][$ldapserver->server_id]['tree']);
}
pla_session_close();
2009-06-30 09:29:51 +00:00
} else
2009-06-30 10:26:08 +00:00
pla_error(sprintf(_('Unknown auth_type: %s'), htmlspecialchars($ldapserver->auth_type)));
2009-06-30 09:22:30 +00:00
2009-06-30 09:29:51 +00:00
include './header.php';
2009-06-30 09:22:30 +00:00
?>
2009-06-30 10:26:08 +00:00
<body>
<script type="text/javascript" language="javascript">
2009-06-30 09:22:30 +00:00
parent.left_frame.location.reload();
</script>
<center>
<br />
<br />
2009-06-30 10:26:08 +00:00
<?php echo sprintf(_('Logged out successfully from server <b>%s</b>'),htmlspecialchars($ldapserver->name)); ?><br />
2009-06-30 09:22:30 +00:00
</center>
</body>
</html>