phpldapadmin/htdocs/logout.php

44 lines
1.0 KiB
PHP
Raw Normal View History

2009-06-30 09:22:30 +00:00
<?php
2009-06-30 09:29:51 +00:00
// $Header: /cvsroot/phpldapadmin/phpldapadmin/logout.php,v 1.17 2005/09/25 16:11:44 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())
pla_error($lang['no_one_logged_in']);
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'))) {
syslog_notice (sprintf("Logout for %s",get_logged_in_dn($ldapserver)));
unset_login_dn($ldapserver) or pla_error($lang['could_not_logout']);
unset_lastactivity($ldapserver);
2009-06-30 09:22:30 +00:00
2009-06-30 09:29:51 +00:00
} else
pla_error(sprintf($lang['unknown_auth_type'], 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
?>
<script language="javascript">
parent.left_frame.location.reload();
</script>
<center>
<br />
<br />
2009-06-30 09:29:51 +00:00
<?php echo sprintf($lang['logged_out_successfully'],htmlspecialchars($ldapserver->name)); ?><br />
2009-06-30 09:22:30 +00:00
</center>
</body>
</html>