Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib
In directory usw-pr-cvs1:/tmp/cvs-serv23849/chat/lib
Modified Files:
check_and_kick_user.lib.php3
Added Files:
move_to_start.lib.php3
Log Message:
Improve the way users are logged out
--- NEW FILE ---
<?php
//
// +--------------------------------------------------------------------------+
// | phpMyChat version 0.15.0 |
// +--------------------------------------------------------------------------+
// | Copyright (c) 2000-2001 The phpHeaven-team |
// +--------------------------------------------------------------------------+
// | This library is used to automatically log out an user and move him/her |
// | to the starting page of phpMyChat. |
// | |
// | It is called by all the scripts from the phpMyChat frameset. |
// +--------------------------------------------------------------------------+
// | From the phpMyChat project: |
// | http://www.phpheaven.net/projects/phpMyChat/ |
// | |
// | Authors: the phpHeaven-team <php...@ya...> |
// +--------------------------------------------------------------------------+
//
// $Id: move_to_start.lib.php3,v 1.1 2001/04/13 10:26:25 loic1 Exp $
//
// Log out an user and move him/her to the starting page.
//
/**
* Do exit (javascript and html stuffs)
*
* The url to move to ($exitUrl) should be defined in the calling script, else
* this script points to the url defined inside the configuration file of
* phpMyChat.
*/
if (empty($exitUrl))
$exitUrl = C_CHAT_URL;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Enforce exit of an user</title>
<script type="text/javascript" language="javascript">
<!--
// Close the loader
if (typeof(window.parent.jsLeaveChat) != 'undefined')
window.parent.jsLeaveChat = true;
if (window.parent.frames['loader'] && !window.parent.frames['loader'].closed)
window.parent.frames['loader'].close();
window.parent.window.location = '<?php echo($exitUrl); ?>';
// -->
</script>
</head>
<body>
<!-- For browsers that do not support JavaScript -->
<p>
<a href="<?php echo($exitUrl); ?>" target="_parent"><b><?php echo(C_CHAT_URL); ?></b></a>
</p>
</body>
</html>
Index: check_and_kick_user.lib.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/check_and_kick_user.lib.php3,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** check_and_kick_user.lib.php3 2001/04/12 23:38:26 1.8
--- check_and_kick_user.lib.php3 2001/04/13 10:26:25 1.9
***************
*** 81,119 ****
{
dbSessionSave();
! $exitQueryUrl = '?' . dbSessionSID('GET') . $GLOBALS['pmcQueryArgSeparator'] . 'exitMessage=1';
! $jsExitUrl = $dbSessionVars['from'] . $exitQueryUrl;
! $htmlExitUrl = C_CHAT_URL . $exitQueryUrl;
$checkLink->close();
!
! // Do exit
! ?>
! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
! <html>
! <head>
! <title>Exit from input or messages frame</title>
! <script type="text/javascript" language="javascript">
! <!--
! // Close the loader
! if (typeof(window.parent.jsLeaveChat) != 'undefined')
! window.parent.jsLeaveChat = true;
! if (window.document.title != 'Loader hidden frame'
! && (window.parent.frames['loader'] && !window.parent.frames['loader'].closed))
! window.parent.frames['loader'].close();
!
! window.parent.window.location = '<?php echo($jsExitUrl); ?>';
! // -->
! </script>
! </head>
! <body>
! <!-- For browsers that do not support JavaScript -->
! <p>
! <a href="<?php echo($htmlExitUrl); ?>" target="_parent"><b><?php echo(C_CHAT_URL); ?></b></a>
! </p>
! </body>
! </html>
! <?php
exit();
! } // end of the case where the user has to be left from the current room
! // Do some updates...
else
{
--- 81,93 ----
{
dbSessionSave();
! $exitUrl = $dbSessionVars['from']
! . '?' . dbSessionSID('GET')
! . $GLOBALS['pmcQueryArgSeparator'] . 'exitMessage=1';
$checkLink->close();
! include('./lib/move_to_start.lib.' . C_EXTENSION);
exit();
! } // end of the case where the user has to leave from the current room
!
! // Else do some updates...
else
{
|