phpldapadmin/logout.php

45 lines
1.2 KiB
PHP
Raw Permalink Normal View History

2009-06-30 08:12:47 +00:00
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/logout.php,v 1.9 2004/03/19 20:13:08 i18phpldapadmin Exp $
2009-06-30 08:05:37 +00:00
/*
* logout.php
2009-06-30 08:12:47 +00:00
* For servers whose auth_type is set to 'cookie' or 'session'. Pass me
2009-06-30 08:05:37 +00:00
* the server_id and I will log out the user (delete the cookie)
*
* Variables that come in as GET vars:
* - server_id
*/
2009-06-30 08:09:20 +00:00
require realpath( 'common.php' );
2009-06-30 08:05:37 +00:00
$server_id = $_GET['server_id'];
2009-06-30 08:12:47 +00:00
check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] );
have_auth_info( $server_id ) or pla_error( $lang['no_one_logged_in'] );
2009-06-30 08:05:37 +00:00
2009-06-30 08:12:47 +00:00
if( ! isset( $servers[ $server_id ][ 'auth_type' ] ) )
return false;
$auth_type = $servers[ $server_id ][ 'auth_type' ];
if( 'cookie' == $auth_type || 'session' == $auth_type )
unset_login_dn( $server_id ) or pla_error( $lang['could_not_logout'] );
else
pla_error( sprintf( $lang['unknown_auth_type'], htmlspecialchars( $auth_type ) ) );
2009-06-30 08:09:20 +00:00
include realpath( 'header.php' );
2009-06-30 08:05:37 +00:00
?>
<script language="javascript">
parent.left_frame.location.reload();
</script>
<center>
<br />
<br />
2009-06-30 08:12:47 +00:00
<?php echo sprintf( $lang['logged_out_successfully'], htmlspecialchars($servers[$server_id]['name']) ); ?><br />
2009-06-30 08:05:37 +00:00
</center>
</body>
</html>