You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
(51) |
Apr
(688) |
May
(260) |
Jun
(108) |
Jul
(42) |
Aug
|
Sep
(2) |
Oct
|
Nov
(74) |
Dec
(217) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(3) |
Jun
(6) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2004 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
(8) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Lo?c C. <lo...@us...> - 2001-04-03 20:11:18
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/catalan In directory usw-pr-cvs1:/tmp/cvs-serv3595/chat/localization/catalan Modified Files: localized.chat.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.chat.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/catalan/localized.chat.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** localized.chat.php3 2001/03/28 22:29:06 1.1.1.1 --- localized.chat.php3 2001/04/03 20:11:13 1.2 *************** *** 146,149 **** --- 146,150 ---- define('L_BEEP', 'So/sense so quan entri un usuari'); define('L_PROFILE', 'Veure perfil'); + define('L_NO_PROFILE', 'No profile'); // input frame |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:11:18
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/chinese_simplified In directory usw-pr-cvs1:/tmp/cvs-serv3595/chat/localization/chinese_simplified Modified Files: localized.chat.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.chat.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/chinese_simplified/localized.chat.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** localized.chat.php3 2001/03/28 22:28:15 1.1.1.1 --- localized.chat.php3 2001/04/03 20:11:14 1.2 *************** *** 147,150 **** --- 147,151 ---- define('L_BEEP', 'Beep/no beep at user entrance'); define('L_PROFILE', 'Display profile'); + define('L_NO_PROFILE', 'No profile'); // input frame |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:11:18
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/brazilian_portuguese In directory usw-pr-cvs1:/tmp/cvs-serv3595/chat/localization/brazilian_portuguese Modified Files: localized.chat.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.chat.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/brazilian_portuguese/localized.chat.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** localized.chat.php3 2001/03/28 22:28:15 1.1.1.1 --- localized.chat.php3 2001/04/03 20:11:13 1.2 *************** *** 146,149 **** --- 146,150 ---- define('L_BEEP', 'Liga/Desliga do bipe de aviso de entrada'); define('L_PROFILE', 'Mostrar detalhes'); + define('L_NO_PROFILE', 'No profile'); // input frame |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:11:18
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/turkish In directory usw-pr-cvs1:/tmp/cvs-serv3595/chat/localization/turkish Modified Files: localized.admin.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/turkish/localized.admin.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:11:18
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/arabic In directory usw-pr-cvs1:/tmp/cvs-serv3595/chat/localization/arabic Modified Files: localized.chat.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.chat.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/arabic/localized.chat.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** localized.chat.php3 2001/03/28 22:29:04 1.1.1.1 --- localized.chat.php3 2001/04/03 20:11:13 1.2 *************** *** 146,149 **** --- 146,150 ---- define('L_BEEP', 'ÅÕÏÇÑ ÕæÊ/ÚÏã ÅÕÏÇÑ ÕæÊ ÚäÏ ÏÎæá ÚÖæ ÌÏíÏ'); define('L_PROFILE', 'ÚÑÖ ÇáãáÝ ÇáÔÎÕí'); + define('L_NO_PROFILE', 'No profile'); // input frame |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:11:17
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/bosnian In directory usw-pr-cvs1:/tmp/cvs-serv3595/chat/localization/bosnian Modified Files: localized.chat.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.chat.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/bosnian/localized.chat.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** localized.chat.php3 2001/03/28 22:28:12 1.1.1.1 --- localized.chat.php3 2001/04/03 20:11:13 1.2 *************** *** 146,149 **** --- 146,150 ---- define('L_BEEP', 'Beep/no beep at user entrance'); define('L_PROFILE', 'Display profile'); + define('L_NO_PROFILE', 'No profile'); // input frame |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:11:17
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/swedish In directory usw-pr-cvs1:/tmp/cvs-serv3595/chat/localization/swedish Modified Files: localized.admin.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/swedish/localized.admin.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:11:17
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/russian In directory usw-pr-cvs1:/tmp/cvs-serv3595/chat/localization/russian Modified Files: localized.admin.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/russian/localized.admin.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:11:17
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/spanish In directory usw-pr-cvs1:/tmp/cvs-serv3595/chat/localization/spanish Modified Files: localized.admin.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/spanish/localized.admin.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:11:17
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/slovak In directory usw-pr-cvs1:/tmp/cvs-serv3595/chat/localization/slovak Modified Files: localized.admin.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/slovak/localized.admin.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:11:17
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/romanian In directory usw-pr-cvs1:/tmp/cvs-serv3595/chat/localization/romanian Modified Files: localized.admin.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/romanian/localized.admin.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:11:17
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/portuguese In directory usw-pr-cvs1:/tmp/cvs-serv3595/chat/localization/portuguese Modified Files: localized.admin.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/portuguese/localized.admin.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:11:16
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/korean In directory usw-pr-cvs1:/tmp/cvs-serv3595/chat/localization/korean Modified Files: localized.admin.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/korean/localized.admin.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:11:16
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/polish In directory usw-pr-cvs1:/tmp/cvs-serv3595/chat/localization/polish Modified Files: localized.admin.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/polish/localized.admin.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:11:16
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/italian In directory usw-pr-cvs1:/tmp/cvs-serv3595/chat/localization/italian Modified Files: localized.admin.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/italian/localized.admin.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:11:16
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/german In directory usw-pr-cvs1:/tmp/cvs-serv3595/chat/localization/german Modified Files: localized.admin.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/german/localized.admin.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:11:16
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/french_canadian In directory usw-pr-cvs1:/tmp/cvs-serv3595/chat/localization/french_canadian Modified Files: localized.admin.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/french_canadian/localized.admin.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:10:20
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/chinese_traditional In directory usw-pr-cvs1:/tmp/cvs-serv3216/chat/localization/chinese_traditional Modified Files: localized.admin.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/chinese_traditional/localized.admin.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:10:20
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/catalan In directory usw-pr-cvs1:/tmp/cvs-serv3216/chat/localization/catalan Modified Files: localized.admin.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/catalan/localized.admin.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:10:19
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/bosnian In directory usw-pr-cvs1:/tmp/cvs-serv3216/chat/localization/bosnian Modified Files: localized.admin.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/bosnian/localized.admin.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:10:19
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/arabic In directory usw-pr-cvs1:/tmp/cvs-serv3216/chat/localization/arabic Modified Files: localized.admin.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/arabic/localized.admin.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:10:19
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/brazilian_portuguese In directory usw-pr-cvs1:/tmp/cvs-serv3216/chat/localization/brazilian_portuguese Modified Files: localized.admin.php3 Log Message: The first dev. version that works! Still many things to do, of course... Index: localized.admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/brazilian_portuguese/localized.admin.php3,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:10:19
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv3216/chat Added Files: exit.php3 handle_input.php3 input.php3 loader.php3 Log Message: The first dev. version that works! Still many things to do, of course... --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This script defines the 'exit' frame. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: exit.php3,v 1.1 2001/04/03 20:10:15 loic1 Exp $ // // The 'exit' frame. // /** * Gets the extension for the php scripts */ if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF']; define('C_EXTENSION', (substr($PHP_SELF, -1) == 3) ? 'php3' : 'php'); /** * Gets some core libraries */ require('./config/config.lib.' . C_EXTENSION); require('./lib/common.lib.' . C_EXTENSION); require('./lib/database/' . C_DB_TYPE . '.lib.' . C_EXTENSION); require('./lib/clean.lib.' . C_EXTENSION); /** * Gets the session id sent to this script * * Uses the 'pmcGrabGlobals()' function defined in the * 'chat/lib/common.lib.php3' library. */ pmcGrabGlobals('dbSessionId'); /** * Start the session handler */ require('./lib/db_sessions.lib.' . C_EXTENSION); dbSessionInitIt( C_DB_TYPE, C_DB_HOST, C_DB_NAME, C_DB_USER, C_DB_PASS, C_SESS_TBL, C_REG_DEL, C_SESS_DEL * 60 ); dbSessionstart(); /** * Defines the language to be used */ require('./localization/' . $dbSessionVars['lang'] . '/localized.chat.' . C_EXTENSION); /** * Sends HTTP headers * * The 'pmcHttpHeaders()' fonction is defined in the 'chat/lib/common.lib.php3' * library */ pmcHttpHeaders(L_CHARSET, false); /** * Displays the frame * * Uses the 'pmcUrlForStyleSheet()' function from the * 'chat/lib/common.lib.php3' library */ // The url for the style sheet $cssUrl = pmcUrlForStyleSheet('style', L_CHARSET, (defined('L_FONT_NAME')) ? L_FONT_NAME : '', L_FONT_SIZE); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html dir="<?php echo((L_CHARSET == 'windows-1256') ? 'rtl' : 'ltr'); ?>"> <head> <title>Exit frame</title> <link rel="stylesheet" href="<?php echo($cssUrl); ?>" type="text/css" /> </head> <body class="frame" onunload="window.parent.pmcClosePopups()"> <center> <?php // Defines the url to exit the chat $exitUrl = $dbSessionVars['from'] . '?' . dbSessionSID('GET') . $pmcQueryArgSeparator . 'exitMode=2'; ?> <a href="<?php echo($exitUrl); ?>" target="_parent"><?php echo(L_EXIT); ?></a> <br /> <?php if (L_FONT_SIZE < 11) echo('<br />' . "\n"); echo("\n"); if ($dbSessionVars['jsVersion'] == 'high') { ?> <!-- Display the big + clickable icon used to expand/collapse all rooms --> <a href="#" onclick="window.parent.pmcExpandAll(); return false"> <img name="imgExpandAll" src="images/closed_big.gif" width="13" height="13" align="middle" border="0" alt="<?php echo(L_EXPCOL_ALL); ?>" /></a> <?php } echo("\n"); // Defines the url to lauch the users_popup $usersPopupUrl = 'users_popup' . (($dbSessionVars['jsVersion'] == 'high') ? '' : '_low') . '.' . C_EXTENSION . '?' . dbSessionSID('GET'); ?> <!-- Display the icon to launch the users popup --> <a href="<?php echo($usersPopupUrl); ?>" onclick="pmcUsersPopup('<?php echo(uniqid('')); ?>'); return false" target="_blank"> <img src="images/popup.gif" width="13" height="13" align="middle" border="0" alt="<?php echo(L_DETACH); ?>" /></a> <?php if ($dbSessionVars['jsVersion'] == 'high') { ?> <!-- Display the connection state icon --> <a href="#" onclick="window.parent.pmcReConnect(); window.parent.pmcSetMsgBoxFocus(); return false"> <img name="imgConState" src="images/connect_off.gif" width="13" height="13" align="middle" border="0" alt="<?php echo(L_CONN_STATE); ?>" /></a> <?php } echo("\n"); ?> </center> </body> </html> --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This script is called when the user submitted a message or a command at | // | the message box in the 'input' frame if his/her browser is DHTML | // | enabled. | // | | // | Note that this script runs in a hidden frame. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: handle_input.php3,v 1.1 2001/04/03 20:10:15 loic1 Exp $ // // The input handler. // /** * Gets the extension for the php scripts */ if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF']; define('C_EXTENSION', (substr($PHP_SELF, -1) == 3) ? 'php3' : 'php'); /** * Gets some core libraries */ require('./config/config.lib.' . C_EXTENSION); require('./lib/common.lib.' . C_EXTENSION); require('./lib/database/' . C_DB_TYPE . '.lib.' . C_EXTENSION); require('./lib/clean.lib.' . C_EXTENSION); /** * Gets the values of variables sent or posted to this script * * Uses the 'pmcGrabGlobals()' and the 'pmcHandleMagicQuotes()' functions * defined in the 'chat/lib/common.lib.php3' library. */ $toGrab = array('dbSessionId', '%POST', 'cookieColor'); pmcGrabGlobals($toGrab); if (!empty($msgTo)) $msgTo = pmcHandleMagicQuotes($msgTo, '1', '', 'del'); if (!empty($message)) $message = pmcHandleMagicQuotes($message, '1', '', 'del'); /** * Start the session handler */ require('./lib/db_sessions.lib.' . C_EXTENSION); dbSessionInitIt( C_DB_TYPE, C_DB_HOST, C_DB_NAME, C_DB_USER, C_DB_PASS, C_SESS_TBL, C_REG_DEL, C_SESS_DEL * 60 ); dbSessionstart(); /** * Defines the language to be used */ require('./localization/' . $dbSessionVars['lang'] . '/localized.chat.' . C_EXTENSION); $latin1 = (L_CHARSET == 'iso-8859-1'); /** * Sends HTTP headers * * The 'pmcHttpHeaders()' fonction is defined in the 'chat/lib/common.lib.php3' * library */ pmcHttpHeaders(L_CHARSET, true); /** * Gets/Updates the users' informations from/in the connected users table */ $slashedNick = pmcSlashSingleQuotes($dbSessionVars['nick']); $currentRoomType = $dbSessionVars['roomType']; $slashedCurrentRoomName = pmcSlashSingleQuotes($dbSessionVars['targetRoom']); require('./lib/check_and_kick_user.lib.' . C_EXTENSION); pmcCheckAndKickUser(false); /** * Define the default color that will be used for messages */ // set default color to black if (empty($color)) $color = (isset($cookieColor)) ? $cookieColor : '#000000'; // Red colors are reserved to the admin or a moderator for the current room if (ereg('#(FF0000|fc403f|fc4b34|fa582a|f66421|f27119|ec7e11|ec117f|f21971|f62164|fa2a58|fc344b)', $color) && ($dbSessionVars['status'] != 'a' && $dbSessionVars['status'] != 'm')) $color = '#000000'; // Cookie expires in one year setcookie("cookieColor", $color, time() + 60*60*24*365); /** * Send the message */ $isCommand = false; $doRefreshMessages = false; $enforceFirstLoad = false; $isPopup = false; $displayMessage = false; if (isset($message) && trim($message) != '') { include('./lib/format_messages.lib.' . C_EXTENSION); // Tests for online commands if (substr($message, 0, 1) == '/') { include('./lib/commands.lib' . C_EXTENSION); if (!($isCommand) && !isset($error)) $error = L_BAD_CMD; } // end of handle commands // Tests for 'true' messages if ((!isset($prevMessage) || $message != $prevMessage) && !($isCommand || isset($error))) { // Ensure color is valid checkColor($color); // Remove swearings if (C_BAD_WORDS) { include('./lib/swearing.lib.' . C_EXTENSION); $message = checkwords($message, false); } // Format original message and set enhanced one (with graphical smilies) $strictMessage = $message; $originalMessage = formatMessage($message); $enhancedMessage = $originalMessage; unset($message); if (C_USE_SMILIES) { include('./lib/smilies.lib.' . C_EXTENSION); checkForSmilies($enhancedMessage, $smilies); unset($smilies); } // Put the message in the 'messages' table if (empty($msgTo)) $slashedMsgTo = 'NULL'; else $slashedMsgTo = '\'' . pmcSlashSingleQuotes($msgTo) . '\''; $msgQuery = 'INSERT INTO ' . C_MSG_TBL . ' ' . 'VALUES (' . $currentRoomType . ', ' . '\'' . $slashedCurrentRoomName . '\', ' . '\'' . $slashedNick . '\', ' . $latin1 . ', ' . time() . ', ' . $slashedMsgTo . ', ' . '\'' . $color . '\', ' . '\'' . pmcSlashSingleQuotes($originalMessage) . '\', ' . '\'' . pmcSlashSingleQuotes($enhancedMessage) . '\'' . ')'; $dbLink = new pmcDB; $dbLink->query($msgQuery); $dbLink->close(); $doRefreshMessages = true; } // end of handle 'true' messages } // end of handle submitted message /** * Save session data */ dbSessionSave(); /** * "Displays" the frame */ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html dir="<?php echo((L_CHARSET == 'windows-1256') ? 'rtl' : 'ltr'); ?>"> <head> <title>Handle input hidden frame</title> <script type="text/javascript" language="javascript1.2"> <!-- var inputSent = window.parent.pmcGetInputForm('sent'); if (inputSent && inputSent.value != 0) { // Udate the Form at the 'input' frame with (window.parent.frames['input'].window.document.forms['inputForm']) { elements['prevMessage'].value = '<?php echo(isset($strictMessage) ? pmcSlashSingleQuotes(htmlspecialchars($strictMessage)) : ''); ?>'; <?php // Get the value to put in the message box : // - previous message value for '/!' command; // - last submission if it was an erroneous command; // - else nothing. $msgValue = ($displayMessage) ? htmlspecialchars($prevMessage) : ''; if (isset($error) && !($isCommand)) $msgValue = pmcSlashSingleQuotes(htmlspecialchars($strictMessage)); ?> elements['message'].value = '<?php echo($msgValue); ?>'; elements['msgTo'].value = ''; elements['color'].value = '<?php echo($color); ?>'; elements['sent'].value = '0'; if (document.all) elements['submitType'].disabled = false; } <?php /** * Refresh the messages frame if necessary */ if ($doRefreshMessages) { // done in $dbSessionVars // $tmp = (isset($ign)) ? "&Ign=".urlencode(stripslashes($Ign)) : ""; ?> // Refresh the messages frame if necessary <?php if ($enforceFirstLoad) { echo("\n"); ?> window.parent.frames['messages'].window.document.close(); window.parent.jsIsInitLoad = true; window.parent.jsLastLoadedMsgTime = 0; window.parent.jsLastCheckedUserTime = 0; window.parent.jsConnect = 0; <?php } echo("\n"); ?> if (window.parent.jsConnect == 0) window.parent.pmcDoRefreshLoader(); <?php } /** * Display a JavaScript alert box with the error message if necessary */ if (isset($error)) { echo("\n"); ?> // Display a JavaScript alert box with the error message if necessary window.parent.pmcSetMsgBoxFocus(); alert('<?php echo(str_replace('\\\\n', '\\n', pmcSlashSingleQuotes($error))); ?>'); <?php } /** * Enforce reloading of the input frame if the user's status has changed */ echo("\n"); if ($dbSessionVars['status'] == 'm') { ?> // Add the red colors when the user has just been promoted to moderator if (!window.parent.jsIsModerator) { window.parent.frames['input'].window.location.replace('input.<?php echo(C_EXTENSION . '?dummy=' . uniqid('')); ?>'); window.parent.jsIsModerator = 1; } <?php } else if ($dbSessionVars['status'] != 'a') { echo("\n"); ?> // Remove the red colors when the user has became a 'simple user' if (window.parent.jsIsModerator) { window.parent.frames['input'].window.location.replace('input.<?php echo(C_EXTENSION . '?dummy=' . uniqid('')); ?>'); window.parent.jsIsModerator = 0; } <?php } echo("\n"); ?> } // --> </script> </head> <body> <?php /** * Display JavaScript instructions that commands may have set */ if (isset($jsToRun)) { for (reset($jsToRun); $jsInst = current($jsToRun); next($jsToRun)) { echo($jsInst . "\n"); } unset($jsTbl); } else { echo("\t" . '<!-- Not a blank document ;) -->' . "\n"); } ?> </body> </html> --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This script defines the 'input' frame. | // | | // | Note that the results of the form defined here are sent: | // | - to the script itself if the browser does not support DHTML; | // | - to the 'handle_input.php3' script else. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: input.php3,v 1.1 2001/04/03 20:10:15 loic1 Exp $ // // The 'input' frame. // /** * Gets the extension for the php scripts */ if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF']; define('C_EXTENSION', (substr($PHP_SELF, -1) == 3) ? 'php3' : 'php'); /** * Gets some core libraries */ require('./config/config.lib.' . C_EXTENSION); require('./lib/common.lib.' . C_EXTENSION); require('./lib/database/' . C_DB_TYPE . '.lib.' . C_EXTENSION); require('./lib/clean.lib.' . C_EXTENSION); /** * Gets the values of variables sent or posted to this script * * Uses the 'pmcGrabGlobals()' and the 'pmcHandleMagicQuotes()' functions * defined in the 'chat/lib/common.lib.php3' library. */ $toGrab = array('dbSessionId', '%POST', 'cookieColor'); pmcGrabGlobals($toGrab); if (!empty($msgTo)) $msgTo = pmcHandleMagicQuotes($msgTo, '1', '', 'del'); if (!empty($message)) $message = pmcHandleMagicQuotes($message, '1', '', 'del'); /** * Start the session handler */ require('./lib/db_sessions.lib.' . C_EXTENSION); dbSessionInitIt( C_DB_TYPE, C_DB_HOST, C_DB_NAME, C_DB_USER, C_DB_PASS, C_SESS_TBL, C_REG_DEL, C_SESS_DEL * 60 ); dbSessionstart(); /** * Defines the language to be used */ require('./localization/' . $dbSessionVars['lang'] . '/localized.chat.' . C_EXTENSION); $latin1 = (L_CHARSET == 'iso-8859-1'); /** * Sends HTTP headers * * The 'pmcHttpHeaders()' fonction is defined in the 'chat/lib/common.lib.php3' * library */ pmcHttpHeaders(L_CHARSET, false); /** * Gets/Updates the users' informations from/in the connected users table */ $slashedNick = pmcSlashSingleQuotes($dbSessionVars['nick']); $currentRoomType = $dbSessionVars['roomType']; $slashedCurrentRoomName = pmcSlashSingleQuotes($dbSessionVars['targetRoom']); require('./lib/check_and_kick_user.lib.' . C_EXTENSION); pmcCheckAndKickUser(false); /** * Define the default color that will be used for messages */ // set default color to black if (empty($color)) $color = (isset($cookieColor)) ? $cookieColor : '#000000'; // Red colors are reserved to the admin or a moderator for the current room if (ereg('#(FF0000|fc403f|fc4b34|fa582a|f66421|f27119|ec7e11|ec117f|f21971|f62164|fa2a58|fc344b)', $color) && ($dbSessionVars['status'] != 'a' && $dbSessionVars['status'] != 'm')) $color = '#000000'; // Cookie expires in one year setcookie("cookieColor", $color, time() + 60*60*24*365); /** * Send the message */ $isCommand = false; $doRefreshMessages = false; $enforceFirstLoad = false; $isPopup = false; $displayMessage = false; if (isset($message) && trim($message) != '') { include('./lib/format_messages.lib.' . C_EXTENSION); // Tests for online commands if (substr($message, 0, 1) == '/') { include('./lib/commands.lib' . C_EXTENSION); if (!($isCommand) && !isset($error)) $error = L_BAD_CMD; } // end of handle commands // Tests for 'true' messages if ((!isset($prevMessage) || $message != $prevMessage) && !($isCommand || isset($error))) { // Ensure color is valid checkColor($color); // Remove swearings if (C_BAD_WORDS) { include('./lib/swearing.lib.' . C_EXTENSION); $message = checkwords($message, false); } // Format original message and set enhanced one (with graphical smilies) $strictMessage = $message; $originalMessage = formatMessage($message); $enhancedMessage = $originalMessage; unset($message); if (C_USE_SMILIES) { include('./lib/smilies.lib.' . C_EXTENSION); checkForSmilies($enhancedMessage, $smilies); unset($smilies); } // Put the message in the 'messages' table if (empty($msgTo)) $slashedMsgTo = 'NULL'; else $slashedMsgTo = '\'' . pmcSlashSingleQuotes($msgTo) . '\''; $msgQuery = 'INSERT INTO ' . C_MSG_TBL . ' ' . 'VALUES (' . $currentRoomType . ', ' . '\'' . $slashedCurrentRoomName . '\', ' . '\'' . $slashedNick . '\', ' . $latin1 . ', ' . time() . ', ' . $slashedMsgTo . ', ' . '\'' . $color . '\', ' . '\'' . pmcSlashSingleQuotes($originalMessage) . '\', ' . '\'' . pmcSlashSingleQuotes($enhancedMessage) . '\'' . ')'; $dbLink = new pmcDB; $dbLink->query($msgQuery); $dbLink->close(); $doRefreshMessages = true; } // end of handle 'true' messages } // end of handle submitted message /** * Save session data */ dbSessionSave(); /** * Displays the frame * * Uses the 'pmcUrlForStyleSheet()' function from the * 'chat/lib/common.lib.php3' library */ // The url for the style sheet $cssUrl = pmcUrlForStyleSheet('style', L_CHARSET, (defined('L_FONT_NAME')) ? L_FONT_NAME : '', L_FONT_SIZE); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html dir="<?php echo((L_CHARSET == 'windows-1256') ? 'rtl' : 'ltr'); ?>"> <head> <title>Input frame</title> <link rel="stylesheet" href="<?php echo($cssUrl); ?>" type="text/css" /> <script type="text/javascript" language="javascript1.2"> <!-- // Get the position for the help popup if (window.parent.jsIsNS4) document.captureEvents(Event.MOUSEDOWN); document.onmousedown = window.parent.pmcDisplayLocation; // --> </script> </head> <body class="frame"<?php if (!$isPopup) echo(' onload="window.parent.pmcSetMsgBoxFocus()"'); ?>> <table border="0" cellpadding="0" cellspacing="0"> <tr> <!-- Input form --> <td> <?php // Define the way posted values will be handled according to the javascript // abilities of the browser $target = ($dbSessionVars['jsVersion'] == 'high') ? 'handle_input' : 'input'; $action = $target . '.' . C_EXTENSION; ?> <form name="inputForm" action="<?php echo($action); ?>" method="post" autocomplete="off" target="<?php echo($target); ?>" onsubmit="return window.parent.pmcValidateInputForm()"> <?php // Put the session id in an hidden field echo("\t" . dbSessionSID('POST') . "\n"); ?> <!-- Whether a message has been sent or not (used to avoid multiple submission) --> <input type="hidden" name="sent" value="0" /> <!-- Last sent message or command (used for the '/!' command) --> <input type="hidden" name="prevMessage" value="<?php echo(isset($strictMessage) ? htmlspecialchars(stripslashes($strictMessage)) : ''); ?>" /> <!-- Addressee that will be filled when the user click on a nick at the users frame --> <input type="hidden" name="msgTo" value="" /> <?php // Url for the help popup $helpUrl = 'help_popup.' . C_EXTENSION . '?lang=' . $dbSessionVars['lang'] . $pmcQueryArgSeparator . 'jsVersion=' . $dbSessionVars['jsVersion']; ?> <!-- Help popup link --> <a href="<?php echo($helpUrl); ?>" onclick="window.parent.pmcHelpPopup(<?php echo((L_CHARSET == 'windows-1256') ? 610 : 10); ?>); return false" target="_blank" onmouseover="document.images['helpImg'].src = window.parent.jsImgHelpOn.src" onmouseout="document.images['helpImg'].src = window.parent.jsImgHelpOff.src"><img name="helpImg" src="images/help_off.gif" width="15" height="15" border="0" alt="<?php echo(L_HLP); ?>" onclick="window.parent.pmcSetMsgBoxFocus()" /></a> <?php // Get the value to put in the message box : // - previous message value for '/!' command; // - last submission if it was an erroneous command; // - else nothing. $msgValue = ($displayMessage) ? htmlspecialchars($prevMessage) : ''; if (isset($error) && !($isCommand)) $msgValue = htmlspecialchars($strictMessage); ?> <!-- Message box --> <input type="text" name="message" size="50" maxlength="299" value="<?php echo($msgValue); ?>" /> <!-- Message color --> <?php // Color of the message if ($dbSessionVars['jsVersion'] == 'low') { // Drop down list of colors for non-enabled JavaScript1.1+ browsers echo("\t\t" . '<select name="color">' . "\n"); while (list($colorName, $colorCode) = each($textColors)) { // Red color is reserved to the admin or a moderator for the current room if ($colorCode == '#FF0000' && !($dbSessionVars['status'] == 'a' || $dbSessionVars['status'] == 'm')) continue; echo("\t\t\t" . '<option value="' . $colorCode . '"'); if ($color == $colorCode || $colorCode == '#000000') echo(' selected="selected"'); echo('>' . $colorName . '</option>' . "\n"); } echo("\t\t" . '</select> ' ."\n"); } else { echo("\t\t" . '<input type="hidden" name="color" value="' . $color . '" />' ."\n"); } // end of color ?> <input type="submit" name="submitType" value="<?php echo(L_OK); ?>" /> </td> <?php // Define the colors picker for JavaScript1.1+ enabled browsers if ($dbSessionVars['jsVersion'] != 'low') { unset($textColors); $textColors = array('#000000', '#ffffff'); for($x = 0; $x < 360; $x += 6) { $r = ceil(126 * (cos(deg2rad($x)) + 1)); $g = ceil(126 * (cos(deg2rad($x + 240)) + 1)); $b = ceil(126 * (cos(deg2rad($x + 120)) + 1)); if (!($r > 128 && $g < 128 && $b < 128 && !(isset($status) && ($dbSessionVars['status'] == 'a' || $dbSessionVars['status'] == 'm')))) { $textColors[] = '#' . substr('0'.dechex($r), -2) . substr('0'.dechex($g), -2) . substr('0'.dechex($b), -2); } } ?> <td> </td> <!-- The color picker --> <td> <table border="0" cellpadding="0" cellspacing="0"> <tr> <?php while (list($key, $colorCode) = each($textColors)) { $i = $key + 1; if ($colorCode == $color) { $wichImage = 'sel_color.gif'; $wichSelected = $i; } else { $wichImage = 'unsel_color.gif'; } echo("\n\t\t\t"); echo('<td bgcolor="' . $colorCode . '"><a href="#" onclick="window.parent.pmcChangeColor(\'' . $colorCode . '\', \'C' . $i .'\'); return false"><img src="images/' . $wichImage . '" alt="' . $colorCode . '" name="C' . $i . '" border="0" width="2" height="20" /></a></td>'); } unset($textColors); echo("\n"); ?> </tr> </table> </td> <?php } echo("\n"); ?> <td> </form> </td> </tr> </table> <?php /** * Ensure a color is selected in the colors picker, else select the default one */ if ($dbSessionVars['jsVersion'] != 'low') { ?> <script type="text/javascript" language="javascript"> <!-- <?php if (isset($wichSelected)) echo('window.parent.jsSelectedColor = \'C' . $wichSelected . '\';' . "\n"); else echo('window.parent.pmcChangeColor(\'#000000\', \'C1\');' . "\n"); ?> // --> </script> <?php } echo("\n"); /** * Refresh the messages frame if necessary */ if ($doRefreshMessages) { // done in $dbSessionVars // $tmp = (isset($ign)) ? "&Ign=".urlencode(stripslashes($Ign)) : ""; ?> <script type="text/javascript" language="javascript"> <!-- // Refresh the messages frame if necessary <?php echo("\n"); if ($dbSessionVars['jsVersion'] == 'high') { if ($enforceFirstLoad) { ?> window.parent.frames['messages'].window.document.close(); window.parent.jsIsInitLoad = true; window.parent.jsLastLoadedMsgTime = 0; window.parent.jsLastCheckedUserTime = 0; window.parent.jsConnect = 0; <?php } echo("\n"); ?> if (window.parent.jsConnect == 0) window.parent.pmcDoRefreshLoader(); <?php } else { $messagesLowUrl = 'messages_low.' . C_EXTENSION . '?' . dbSessionSID(); ?> window.parent.frames['messages'].window.location = '<?php echo($messagesLowUrl); ?>'; <?php } echo("\n"); ?> // --> </script> <?php } echo("\n"); /** * Display a JavaScript alert box with the error message if necessary */ if (isset($error)) { ?> <script type="text/javascript" language="javascript"> <!-- // Display a JavaScript alert box with the error message if necessary window.parent.pmcSetMsgBoxFocus(); alert('<?php echo(str_replace('\\\\n', '\\n', pmcSlashSingleQuotes($error))); ?>'); // --> </script> <?php } echo("\n"); /** * Put JavaScript instructions that commands may have set */ if (isset($jsToRun)) { for (reset($jsToRun); $jsInst = current($jsToRun); next($jsToRun)) { echo($jsToRun . "\n"); } unset($jsToRun); } ?> </body> </html> --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This script is used in a hidden frame with DHTML enabled browsers. It: | // | - loads new messages from the 'messages' table and push them to the | // | 'messages' frame; | // | - checks for modifications among the connected users table and enforces | // | reloading of the 'users' frame if necessary. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: loader.php3,v 1.1 2001/04/03 20:10:15 loic1 Exp $ // // The message and connected users loader. // /** * Gets the extension for the php scripts */ if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF']; define('C_EXTENSION', (substr($PHP_SELF, -1) == 3) ? 'php3' : 'php'); /** * Gets some core libraries */ require('./config/config.lib.' . C_EXTENSION); require('./lib/common.lib.' . C_EXTENSION); require('./lib/database/' . C_DB_TYPE . '.lib.' . C_EXTENSION); require('./lib/clean.lib.' . C_EXTENSION); /** * Gets the values of variables sent or posted to this script * * Uses the 'pmcGrabGlobals()' and the 'pmcHandleMagicQuotes()' functions * defined in the 'chat/lib/common.lib.php3' library. */ pmcGrabGlobals('%GET'); /** * Start the session handler */ require('./lib/db_sessions.lib.' . C_EXTENSION); dbSessionInitIt( C_DB_TYPE, C_DB_HOST, C_DB_NAME, C_DB_USER, C_DB_PASS, C_SESS_TBL, C_REG_DEL, C_SESS_DEL * 60 ); dbSessionstart(); /** * Defines the language to be used */ require('./localization/' . $dbSessionVars['lang'] . '/localized.chat.' . C_EXTENSION); $textDirection = (L_CHARSET == 'windows-1256') ? 'rtl' : 'ltr'; /** * Sends HTTP headers * * The 'pmcHttpHeaders()' fonction is defined in the 'chat/lib/common.lib.php3' * library */ pmcHttpHeaders(L_CHARSET, true); /** * Gets/Updates the users' informations from/in the connected users table */ $slashedNick = pmcSlashSingleQuotes($dbSessionVars['nick']); $currentRoomType = $dbSessionVars['roomType']; $slashedCurrentRoomName = pmcSlashSingleQuotes($dbSessionVars['targetRoom']); require('./lib/check_and_kick_user.lib.' . C_EXTENSION); pmcCheckAndKickUser(true); /** * Instanciates a new pmcDB object */ $dbLink = new pmcDB; /** * Check for updates in users list */ $doRefreshUsers = false; // $isUsrCleaned is defined in 'chat/lib/clean.lib.php3' if ($isInitLoad || $isUsrCleaned) { $doRefreshUsers = true; } else { // Define the SQL query (depends on the type -public or private- of the // current room $refreshRoomQuery = 'SELECT DISTINCT m_time FROM ' . C_MSG_TBL . ' ' . 'WHERE ' . 'm_time > ' . $lastUsrCheck . ' AND ' . 'username IN (\'SYS enter\', \'SYS exit\', \'SYS promote\') AND ' . '(type = 1' . (($dbSessionVars['roomType'] == 0) ? ' OR (type = 0 AND room = \'' . $dbSessionVars['targetRoom'] .'\')) ' : ') ') . 'ORDER BY m_time DESC ' . 'LIMIT 1'; $dbLink->query($refreshRoomQuery); list($newLastUsrCheck) = $dbLink->nextRecord(); if ($newLastUsrCheck > $lastUsrCheck) { $lastUsrCheck = $newLastUsrCheck; $doRefreshUsers = true; $dbLink->cleanResults(); } unset($newLastUsrCheck); } /** * Check for updates in messages list and get new messages * * The 'pmcHandleMagicQuotes()' and the 'pmcSlashSingleQuotes()' functions are * defined inside the 'chat/lib/common.lib.php3' script. */ // Define the SQL query (depends on the ignored users list and on whether to // display notification messages or not) $ignoredSendersList = ''; if (dbSessionIsRegistered('ignoredSenders') && !empty($dbSessionVars['ignoredSenders'])) $ignoredSendersList .= '\'' . str_replace(',', '\', \'', pmcSlashSingleQuotes($dbSessionVars['ignoredSenders'])) . '\''; if ($dbSessionVars['notify'] == 0) $ignoredSendersList .= (($ignoredSendersList != '') ? ', ':'') . '\'SYS enter\', \'SYS exit\''; if ($ignoredSendersList != '') $ignoredSendersList = 'username NOT IN (' . $ignoredSendersList . ') AND '; $slashedNick = pmcSlashSingleQuotes($dbSessionVars['nick']); $slashedCurrentRoomName = pmcSlashSingleQuotes($dbSessionVars['targetRoom']); $getMessagesQuery = 'SELECT username, latin1, m_time, address, color, msg_' . $dbSessionVars['msgKind'] . ' ' . 'FROM ' . C_MSG_TBL . ' ' . 'WHERE ' . (($isInitLoad) ? '' : 'm_time > ' . $lastMsgLoad . ' AND ') . $ignoredSendersList . '(' . 'address = \' *\' OR ' . '(address = \'' . $slashedNick .'\' AND (room = \'' . $slashedCurrentRoomName . '\' OR username = \'SYS inviteTo\')) OR ' . '(room = \'' . $slashedCurrentRoomName . '\' AND (address IS NULL OR username = \''. $slashedNick . '\'))' . ') ' . 'ORDER BY m_time DESC' . (($isInitLoad) ? ' LIMIT ' . $dbSessionVars['msgNumber'] : ''); // Get new messages and store them in an array $grabedMessages = array(); $dbLink->query($getMessagesQuery); while (list($sender, $senderLatin1, $sentTime, $addressee, $msgColor, $message) = $dbLink->nextRecord()) { $grabedMessages[] = array( 'sender' => pmcHandleMagicQuotes($sender, '', 1, 'del'), 'senderLatin1' => $senderLatin1, 'sentTime' => $sentTime, 'addressee' => pmcHandleMagicQuotes($addressee, '', 1, 'del'), 'msgColor' => $msgColor, 'message' => pmcHandleMagicQuotes($message, '', 1, 'del') ); } $dbLink->cleanResults(); $dbLink->close(); /** * Format new messages * * The 'pmcSpecialChars()' and the 'pmcSlashSingleQuotes()' functions are * defined inside the 'chat/lib/common.lib.php3' script. */ $newMessages = array(); $grabedMessagesCnt = count($grabedMessages); if ($grabedMessagesCnt == 0) { if ($isInitLoad) $newMessages[] = '<span class="notify">' . L_NO_MSG . '<\/span>'; } else { reset($grabedMessages); for ($k = 0; $k < $grabedMessagesCnt; $k++) { // Get the values of messages variables while (list($name, $value) = each($grabedMessages[$k])) $$name = $value; // Skip the oldest message if the day seperator has been added if (isset($daySeparator) && $isInitLoad && $k == $grabedMessagesCnt - 1) continue; // Separator between messages sent before today and other ones if (!isset($daySeparator) && date('j', $sentTime) != date('j', time())) { $newMessages[] = '<p class="msg"><span class="notify">--------- ' . L_TODAY_DWN . ' ---------<\/span><\/p>'; $daySeparator = 1; } // Messages $aMessage = '<p class="msg">'; // The timestamp of the message if ($dbSessionVars['showTimestamp'] == 1) $aMessage .= '<span class="time">' . date('H:i:s', $sentTime + C_TMZ_OFFSET * 60 * 60) . '<\/span> '; // 'Standard' messages if (substr($sender,0,4) != 'SYS ') { $simpleSender = pmcSpecialChars($sender, $senderLatin1); $slashedSender = pmcSlashSingleQuotes($simpleSender); $sender = '<a href="#" onclick="window.parent.pmcUserClick(\'' . $slashedSender . '\', true); return false" class="sender">' . $simpleSender . '<\/a>'; if ($addressee != '') $addressee = ']<bdo dir="' . $textDirection . '"><\/bdo>>[' . htmlspecialchars($addressee); $aMessage .= '<b>[' . $sender . $addressee . ']<bdo dir="' . $textDirection .'"><\/bdo><\/b> ' . '<font color="' . $msgColor . '">' . $message . '<\/font>'; } // 'System' messages else { $aMessage .= '<span class="notify">'; if ($addressee == ' *') { $aMessage .= '[' . L_ANNOUNCE . ']<bdo dir="' . $textDirection . '"><\/bdo> ' . $message; } else { if ($addressee != '') $aMessage .= '<b>>[' . htmlspecialchars($addressee) . ']<bdo dir="' . $textDirection . '"><\/bdo><\/b> '; if (strpos($message, 'printf(')) eval('$aMessage .= ' . $message . ';'); else $aMessage .= $message; } $aMessage .= '<\/span>'; } $aMessage .= '<\/p>'; $newMessages[] = $aMessage; if ($sentTime > $lastMsgLoad) $lastMsgLoad = $sentTime; } } // end of formatting new messages unset($grabedMessages); /** * "Displays" the frame */ // Define the URL for the http refresh header $refreshUrl = 'loader.' . C_EXTENSION . '?' . dbSessionSID('GET') . $pmcQueryArgSeparator . 'isInitLoad=0' . $pmcQueryArgSeparator . 'lastMsgLoad=' . $lastMsgLoad . $pmcQueryArgSeparator . 'lastUsrCheck=' . $lastUsrCheck; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html dir="<?php echo($textDirection); ?>"> <head> <title>Loader hidden frame</title> <?php if ($dbSessionVars['refreshDelay'] > 0) echo('<meta http-equiv="Refresh" content="' . $dbSessionVars['refreshDelay'] . '; url=' . $refreshUrl . '" />' . "\n"); ?> <script type="text/javascript" language="javascript"> <!-- // Emulates replace method for non-js1.1 compliant browsers if (typeof(location.replace) == 'undefined') location.replace = location.assign; // Updates the time for last checked user and the last loaded message window.parent.jsIsInitLoad = 0; window.parent.jsLastLoadedMsgTime = <?php echo($lastMsgLoad); ?>; window.parent.jsLastCheckedUserTime = <?php echo($lastUsrCheck); ?>; <?php /** * Do refresh the 'users' frame if necessary */ if ($doRefreshUsers) { $usersUrl = 'users.' . C_EXTENSION . '?' . dbSessionSID(); ?> // Do refresh the 'users' frame window.parent.frames['users'].window.location.replace('<?php echo($usersUrl); ?>'); <?php } echo("\n"); /** * Do refresh the 'messages' frame if necessary * * The 'pmcUrlForStyleSheet' is defined in the 'chat/lib/common.lib.php3' * script. */ ?> // Push data to the 'message' frame with (window.parent.frames['messages'].window) { <?php // Set the headers for the 'messages' frame at first load if ($isInitLoad) { // The url for the style sheet $cssUrl = pmcUrlForStyleSheet('style', L_CHARSET, (defined('L_FONT_NAME')) ? L_FONT_NAME : '', L_FONT_SIZE); ?> // Set the headers for the 'messages' frame document.open('text/html', 'replace'); document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">'); document.write('<html dir="<?php echo($textDirection); ?>">\n\n<head>\n'); document.write('<title>Dynamic messages frame<\/title>\n'); document.write('<link rel="stylesheet" href="<?php echo($cssUrl); ?>" type="text/css" \/>\n'); document.write('<\/head>\n\n'); document.write('<body class="mainframe">\n'); <?php } // Send new message(s) if there is at least one, else an empty string to ensure // the message frame isn't closed because of a too long inactive delay $newMessagesCnt = count($newMessages); if ($newMessagesCnt > 0) { reset($newMessages); for ($i = 0; $i < $newMessagesCnt; $i++) { // doubles backslashes except the ones for closing HTML tags $toPush = str_replace('\\', '\\\\', $newMessages[$newMessagesCnt - 1 - $i]); $toPush = str_replace('<\\\\/', '<\\/', $toPush); $toPush = pmcSlashSingleQuotes($toPush); echo("\n"); if ($i == 0) echo("\t" . '// Send new message(s)' . "\n"); ?> document.write('<?php echo($toPush); ?>\n'); <?php } ?> // Scrolls to the bottom of the message frame if (typeof(scrollBy(0, 0)) != 'undefined') { scrollBy(0, 65000); scrollBy(0, 65000); } else { scroll(0, 65000); scroll(0, 65000); } <?php } // end if ($newMessagesCnt > 0) else { echo("\n"); ?> // Send an empty string to ensure the message frame isn't closed because of // a too long inactive delay document.write(''); <?php } echo("\n"); ?> } // --> </script> </head> <body onunload="if (typeof(window.parent.frames['exit']) != 'undefined' && typeof(window.parent.jsLeaveChat) != 'undefined' && !window.parent.jsLeaveChat) window.parent.pmcConnecting(window.parent.jsConnect + 1)"> <script type="text/javascript" language="javascript1.1"> <!-- if (typeof(window.parent.frames['exit']) != 'undefined' && typeof(window.parent.pmcConnectDone) != 'undefined') window.parent.pmcConnectDone(); // --> </script> </body> </html> |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:10:19
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib In directory usw-pr-cvs1:/tmp/cvs-serv3216/chat/lib Modified Files: clean.lib.php3 common.lib.php3 db_sessions.lib.php3 Added Files: banish.lib.php3 check_and_kick_user.lib.php3 format_messages.lib.php3 gen_password.lib.php3 get_ip.lib.php3 Log Message: The first dev. version that works! Still many things to do, of course... --- NEW FILE --- <? // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This library allows to ensure the user who wants to enter in the chat is | // | not a banished one. | // | | // | It is called by the 'chat/lib/index_libs/main_index.lib.php3', the | // | 'chat/lib/index_libs/index_validation.lib.php3' and the | // | 'chat/lib/commands/join.cmd.php3' scripts. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // | & Tomas Haluza <th...@ki...> | // | & Fabiano R. Prestes <zo...@po...> | // +--------------------------------------------------------------------------+ // // $Id: banish.lib.php3,v 1.1 2001/04/03 20:10:14 loic1 Exp $ // // Checks for banishment status of the current user. // /** * Initializes some variables and cleans the banished users table */ $isBanished = false; $dbLink->query("DELETE FROM " . C_BAN_TBL . " WHERE ban_until < " . time()); /** * Gets the IP of the user */ if (!defined('_CHAT_PATH')) define('_CHAT_PATH', ''); if (empty($ip)) include('./' . _CHAT_PATH . 'lib/get_ip.lib.' . C_EXTENSION); /** * Searches for a banished nick * * The 'pmcHandleMagicQuotes()' and the 'pmcIsInto()' functions are defined * inside the 'chat/lib/common.lib.php3' library */ $dbLink->query("SELECT ip, rooms FROM " . C_BAN_TBL . " WHERE username = '$slashedNick' LIMIT 1"); // This nick is banished from some rooms if (list($oldIp, $banishedFromRooms) = $dbLink->nextRecord()) { $dbLink->cleanResults(); $banishedFromRooms = pmcHandleMagicQuotes($banishedFromRooms, '', 1, 'del'); // Is the user banished from the room he wants to enter in? if ($banishedFromRooms == '*') { $isBanished = true; } else if (!empty($createRoomName)) { $isBanished = (pmcIsInto($createRoomName, $banishedFromRooms) >= 0); } else if (!empty($enterOtherRoomName)) { $isBanished = (pmcIsInto($enterOtherRoomName, $banishedFromRooms) >= 0); } else if (!empty($enterDefaultRoomName)) { $isBanished = (pmcIsInto($enterDefaultRoomName, $banishedFromRooms) >= 0); } // Update the IP of the user in the banished table if necessary if ($isBanished && $ip != $oldIp && (substr($ip, 0, 1) != 'p' || substr($oldIp, 0, 1) == 'p')) { $dbLink->query("UPDATE " . C_BAN_TBL . " SET ip = '$ip' WHERE username = '$slashedNick'"); } } // end of the case where nick is banished from some rooms // This nick isn't banished from any room, seek for a banished IP else { $dbLink->cleanResults(); $dbLink->query("SELECT rooms, ban_until FROM " . C_BAN_TBL . " WHERE ip = '$ip' LIMIT 1"); // IP is banished from some rooms if (list($banishedFromRooms, $banUntil) = $dbLink->nextRecord()) { $dbLink->cleanResults(); $banishedFromRooms = pmcHandleMagicQuotes($banishedFromRooms, '', 1, 'del'); // Is the IP banished from the room user wants to enter in? if ($banishedFromRooms == '*') { $isBanished = true; } else if (!empty($createRoomName)) { $isBanished = (pmcIsInto($createRoomName, $banishedFromRooms) >= 0); } else if (!empty($enterOtherRoomName)) { $isBanished = (pmcIsInto($enterOtherRoomName, $banishedFromRooms) >= 0); } else if (!empty($enterDefaultRoomName)) { $isBanished = (pmcIsInto($enterDefaultRoomName, $banishedFromRooms) >= 0); } // Add the nick to the banished users table if necessary if ($isBanished) $dbLink->query("INSERT INTO " . C_BAN_TBL . " VALUES ('$slashedNick', '$latin1', '$ip', '$banishedFromRooms', '$banUntil')"); } // end of the case where IP is banished from some rooms else { $dbLink->cleanResults(); } } ?> --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This library is used to ensure an user is defined inside the connected | // | users table (else it can creates it) and then to get his/her status to | // | enforce him/her to leave the chat if it is required. | // | | // | This library is called by the 'chat/input.php3', the | // | 'chat/handle_input.php3', the 'chat/messages_low.php3' and the | // | 'chat/loader.php3' scripts. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: check_and_kick_user.lib.php3,v 1.1 2001/04/03 20:10:14 loic1 Exp $ // // Checks users existence and kick him/her if required. // /** * Gets/Updates the users' informations from/in the connected users table * * The 'pmcSlashSingleQuotes()', 'pmcHandleMagicQuotes()' and * 'pmcSpecialChars()' functions are defined inside the * 'chat/lib/common.lib.php3' library * * @param boolean whether the connected users table should be updated or not * * @global boolean whether the current character set is 'iso-8859-1' or not * @global string the session id * @global array the session data * @global string the slashed nick of the current user * @global integer the type of the current room * @global string the slashed name of the current room */ function pmcCheckAndKickUser($doUpdate = false) { global $latin1; global $dbSessionId; global $dbSessionVars; global $slashedNick; global $currentRoomType; global $slashedCurrentRoomName; $checkLink = new pmcDB; $checkLink->query("SELECT room, status FROM " . C_USR_TBL . " WHERE username = '$slashedNick' LIMIT 1"); $isLoggedIn = (list($loggedInRoom, $status) = $checkLink->nextRecord()); $checkLink->cleanResults(); // The user exists in the connected users table if ($isLoggedIn) { // Same nick in another room if ($loggedInRoom != $slashedCurrentRoomName) { $checkLink->query("INSERT INTO " . C_MSG_TBL . " VALUES ($currentRoomType, '$slashedCurrentRoomName', 'SYS exit', '', " . time() . ", '', '#666699', 'sprintf(L_EXIT_ROM, \'" . pmcSpecialChars($slashedNick, $latin1) . "\')', 'sprintf(L_EXIT_ROM, \'" . pmcSpecialChars($slashedNick, $latin1) . "\')')"); $dbSessionVars['kicked'] = 1; } // The admin just deleted the room else if ($status == 'd') { $dbSessionVars['kicked'] = 2; } // Kicked by a moderator or the admin. else if ($status == 'k') { $checkLink->query("INSERT INTO " . C_MSG_TBL . " VALUES ($currentRoomType, '$slashedCurrentRoomName', 'SYS exit', '', " . time() . ", '', '#666699', 'sprintf(L_KICKED, \'" . pmcSpecialChars($slashedNick, $latin1) . "\')', 'sprintf(L_KICKED, \'" . pmcSpecialChars($slashedNick, $latin1) . "\')')"); $dbSessionVars['kicked'] = 3; } // Banished by a moderator or the admin. else if ($status == 'b') { $checkLink->query("INSERT INTO " . C_MSG_TBL . " VALUES ($currentRoomType, '$slashedCurrentRoomName', 'SYS exit', '', " . time() . ", '', '#666699', 'sprintf(L_BANISHED, \'" . pmcSpecialChars($slashedNick, $latin1) . "\')', 'sprintf(L_BANISHED, \'" . pmcSpecialChars($slashedNick, $latin1) . "\')')"); $dbSessionVars['kicked'] = 4; } // Do exit from the current room if required if (!empty($dbSessionVars['kicked'])) { dbSessionSave(); $exitQueryUrl = '?' . dbSessionSID() . $GLOBALS['pmcQueryArgSeparator'] . 'exitMode=0'; $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</title> <script type="text/javascript" language="javascript"> <!-- window.parent.window.location = '<?php echo($jsExitUrl); ?>'; // --> </script> </head> <body> <!-- For browser that do not support JavaScript --> <p><b> <a href="<?php echo($htmlExitUrl); ?>" target="_parent"><?php echo(C_CHAT_URL); ?></a> </b></p> </body> </html> <?php exit(); } // end of the case where the user has to be left from the current room // Do some updates... else { // ... the status if it has been modified if ($dbSessionVars['status'] != $status) $dbSessionVars['status'] = $status; // ... the time to ensure the user won't be cleaned from the // connected users table $checkLink->query("UPDATE " . C_USR_TBL . " SET u_time = " . time() . " WHERE session_id = '$dbSessionId'"); } } // end the case where the user has been found // The user doesn't exists in the connected users table but it should! else if ($doUpdate) { // Gets the IP address include('./lib/get_ip.lib.' . C_EXTENSION); $checkLink->query("INSERT INTO " . C_USR_TBL . " VALUES ('$dbSessionId', " . time() . ", '$slashedCurrentRoomName', '$slashedNick', '$latin1', '$status', '$ip')"); } // end of the case where user should be in users table $checkLink->close(); } // end of the 'pmcCheckAndKickUser()' function ?> --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This library is used to define formated message that will be inserted | // | into the message table and ensure the associated color is valid. | // | | // | This library is called by the 'chat/input.php3' and the | // | 'chat/handle_input.php3' scripts. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: format_messages.lib.php3,v 1.1 2001/04/03 20:10:14 loic1 Exp $ // // Define formated message and the associated color. // /** * Format a message according to the configuartion file directives * * The 'pmcSlashSingleQuotes()', 'pmcHandleMagicQuotes()' and * 'pmcSpecialChars()' functions are defined inside the * 'chat/lib/common.lib.php3' library * * @param string the message sent by the user * * @return string the formatted message * * @global boolean whether the current character set is 'iso-8859-1' or not */ function formatMessage($theMessage) { global $latin1; // Text formating tags if (C_HTML_TAGS_KEEP == 'none') { if (!C_HTML_TAGS_SHOW) { // eliminates every HTML like tags $theMessage = ereg_replace('<[^>]+>', '', $theMessage); } else { // or keep it without effect $theMessage = str_replace('<', '<', $theMessage); $theMessage = str_replace('>', '>', $theMessage); } } else { // then C_HTML_TAGS_KEEP == 'simple', we keep u, b and i tags $theMessage = str_replace('<', '<', $theMessage); $theMessage = str_replace('>', '>', $theMessage); if (@function_exists('preg_match')) { while (preg_match('/<([ubi]?)>(.*?)<(\/\\1)>/i', $theMessage)) { $theMessage = preg_replace('/<([ubi]?)>(.*?)<(\/\\1)>/i', '<\\1>\\2<\\3>', $theMessage); } if (!C_HTML_TAGS_SHOW) { $theMessage = preg_replace('/<\/?[ubi]?>/i', '', $theMessage); } } } // URLs // no prefix (www.myurl.ext) -> add 'http://' $theMessage = eregi_replace('([[:space:]]|^)(www)', '\\1http://\\2', $theMessage); // creates html link $prefix = '(http|https|ftp|telnet|news|gopher|file|wais)://'; $pureUrl = '([[:alnum:]/\n+-=%&:_.~?]+[#[:alnum:]+]*)'; $theMessage = eregi_replace($prefix . $pureUrl, '<a href="\\1://\\2" target="_blank">\\1://\\2</a>', $theMessage); // e-mail addresses $theMessage = eregi_replace('([0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-wyz][a-z](fo|g|l|m|mes|o|op|pa|ro|seum|t|u|v|z)?)', '<a href="mailto:\\1">\\1</a>', $theMessage); // transform ISO-8859-1 special characters if ($latin1) { $pattern = '(.*)(' . $GLOBALS['msgTo']. '(>)?)(.*)'; ereg($pattern, $theMessage, $regs); if ($GLOBALS['msgTo'] != '' && ($regs[1] == '' && $regs[4] == '')) $regs[4] = $theMessage; if (!ereg('&[[:alnum:]]{1,10}', $regs[1]) && !ereg('&[[:alnum:]]{1,10}',$regs[4])) { for ($i = 1; $i <= 4; $i++) { if (($i != 1 && $i != 4) || $regs[$i] == '') continue; $part = $regs[$i]; $part = htmlentities($part); $part = str_replace('<', '<', $part); $part = str_replace('>', '>', $part); $part = str_replace('&lt;', '<', $part); $part = str_replace('&gt;', '>', $part); $part = str_replace('"', '"', $part); $part = ereg_replace('&(#[[:digit:]]{2,5})', '&\\1', $part); $regs[$i] = $part; } $theMessage = $regs[1] . $regs[2] . $regs[4]; } } // end if ($latin1) // Slashes the slash character $theMessage = str_replace('\\', '\\\\', $theMessage); return $theMessage; } // end of the 'formatMessage()' function /** * Check and validate the color of the message * * @param string the color code * * @global array the session data */ function checkColor(&$theColor) { global $dbSessionVars; // Red colors are reserved to the admin or a moderator for the current room if ((ereg('#(FF0000|fc403f|fc4b34|fa582a|f66421|f27119|ec7e11|ec117f|f21971|f62164|fa2a58|fc344b)', $theColor)) && !($dbSessionVars['status'] == 'a' || $dbSessionVars['status'] == 'm')) $theColor = '#000000'; } // end of the 'checkColor()' function ?> --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This library is used during the registration process to generate a | // | random password. | // | | // | It is called by the 'chat/profile_reg.php3' script. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: gen_password.lib.php3,v 1.1 2001/04/03 20:10:14 loic1 Exp $ // // Generates a password. // /** * Length of the password to generate */ if (!defined('_MAILV_PSWD_LENGTH')) define('_MAILV_PSWD_LENGTH', 8); /** * Generates the password * * It uses the 'pmcIsInto()' function defined inside the * 'chat/lib/common.lib.php3' script * * Credit for this function goes to halcyon_42. * It can be found here: http://www.zend.com/codex.php?id=149&single=1 * * @return string the password * * @access private */ function genPassword() { // set ASCII range for random character generation $lowerAsciiBound = 50; // '2' $upperAsciiBound = 122; // 'z' // Exclude special characters and some confusing alphanumerics // o,O,0,I,1,l etc $notUse = array(58, 59, 60, 61, 62, 63, 64, 73, 79, 91, 92, 93, 94, 95, 96, 108, 111); $i = 0; $password = ''; while ($i < _MAILV_PSWD_LENGTH) { mt_srand((double)microtime() * 1000000); // random limits within ASCII table $randNum = mt_rand($lowerAsciiBound, $upperAsciiBound); if (pmcIsInto($randNum, $notUse) < 0) { $password = $password . chr($randNum); $i++; } } return $password; } // end of the 'genPassword()' function ?> --- NEW FILE --- <? // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This library will try to get the most probable IP address of an user. | // | It is based on a free of charge 'identifier' script written by Marc | // | Meurrens (http://www.cgsa.net/php). | // | | // | It is called by many of the phpMyChat scripts. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: get_ip.lib.php3,v 1.1 2001/04/03 20:10:14 loic1 Exp $ // // Gets the IP address of an user. // /** * Gets the values of some PHP environment variables that may contain the * IP address * * Uses the 'pmcGrabGlobals()' function defined in the * 'chat/lib/common.lib.php3' library. */ $toGrab = array('REMOTE_ADDR', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED'); pmcGrabGlobals($toGrab); $simpleIp = $REMOTE_ADDR; $trueIp = isset($HTTP_X_FORWARDED_FOR) ? $HTTP_X_FORWARDED_FOR : ''; if ($trueIp == '' && isset($HTTP_X_FORWARDED)) $trueIp = $HTTP_X_FORWARDED; if ($trueIp == '' && isset($HTTP_FORWARDED_FOR)) $trueIp = $HTTP_FORWARDED_FOR; if ($trueIp == '' && isset($HTTP_FORWARDED)) $trueIp = $HTTP_FORWARDED; $isProxy = ($trueIp != ''); if (!$isProxy) { $toGrab = array('HTTP_VIA', 'HTTP_X_COMING_FROM', 'HTTP_COMING_FROM'); pmcGrabGlobals($toGrab); $trueIp = isset($HTTP_VIA) ? $HTTP_VIA : ''; if ($trueIp == '' && isset($HTTP_X_COMING_FROM)) $trueIp = $HTTP_X_COMING_FROM; if ($trueIp == '' && isset($HTTP_COMING_FROM)) $trueIp = $HTTP_COMING_FROM; if ($trueIp != '') $isProxy = '2'; } if ($trueIp == $simpleIp) $isProxy = 0; unset($toGrab); /** * Returns the true IP if it has been found, else the proxy IP prefixed with * a 'p' character */ switch ($isProxy) { case 0: // True IP without proxy $ip = $simpleIp; break; case 1: $b = ereg ('^([0-9]{1,3}\.){3,3}[0-9]{1,3}', $trueIp, $regs); if ($b && (count($regs) > 0)) { // True IP behind a proxy $ip = $regs[0]; } else { // Proxy IP $ip = 'p' . $simpleIp; } break; case 2: // Proxy IP $ip = 'p' . $simpleIp; default: // void } ?> Index: clean.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/clean.lib.php3,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** clean.lib.php3 2001/03/29 22:52:17 1.1 --- clean.lib.php3 2001/04/03 20:10:14 1.2 *************** *** 25,52 **** $chatClean = new pmcDB; $chatClean->query("DELETE FROM " . C_MSG_TBL . " WHERE m_time < " . (time() - C_MSG_DEL * 60 * 60)); ! ! // TODO: This is uggly !!! It must be improved. ! $usrToDeleteQuery = 'SELECT u.session_id FROM ' . C_USR_TBL . ' u, ' . C_SESS_TBL . ' s ' ! . 'WHERE u.session_id = s.session_id ' ! . 'AND ((s.last < ' . (time() - C_USR_DEL * 60) . ') ' ! . 'OR (u.status = \'k\' AND s.last < ' . (time() - 20) . '))'; ! $chatClean->query($usrToDeleteQuery); ! $listToDelete = ''; ! while (list($toDelete) = $chatClean->nextRecord()) ! { ! if (!empty($listToDelete)) ! $listToDelete .= ', '; ! $listToDelete .= '\'' . $toDelete . '\''; ! } ! if (!empty($listToDelete)) ! { ! $usrToDeleteQuery = 'DELETE FROM ' . C_USR_TBL . ' WHERE session_id IN (' . $listToDelete . ')'; ! $chatClean->query($usrToDeleteQuery); ! $isUsrCleaned = ($chatClean->affectedRows() > 0); ! } ! else ! { ! $isUsrCleaned = FALSE; ! } $chatClean->close(); ?> --- 25,30 ---- $chatClean = new pmcDB; $chatClean->query("DELETE FROM " . C_MSG_TBL . " WHERE m_time < " . (time() - C_MSG_DEL * 60 * 60)); ! $chatClean->query("DELETE FROM " . C_USR_TBL . " WHERE u_time < " . (time() - C_USR_DEL * 60) . " OR (status = 'k' AND u_time < " . (time() - 20) . ")"); ! $isUsrCleaned = ($chatClean->affectedRows() > 0); $chatClean->close(); ?> Index: common.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/common.lib.php3,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** common.lib.php3 2001/03/29 22:52:17 1.1 --- common.lib.php3 2001/04/03 20:10:14 1.2 *************** *** 8,28 **** // | This library contains a set of variables and functions used by many of | // | the phpMyChat scripts: | ! // | - $pmcIsPhp4 = whether the current release of phpMyChat | ! // | is 4+ or not | ! // | - $pmcQueryArgSeparator = the separator used in PHP generated URLs | ! // | to separate arguments | ! // | - isInto() = ensures a value exist inside a list or an | ! // | array | ! // | - grabGlobals() = grabs variables from the $HHTP_*_VARS | ! // | arrays | ! // | - handleMagicQuotes() = adds or removes slashes before special | ! // | characters according to the 'magic quotes | ! // | gpc' and the 'magic quotes runtime' PHP | ! // | configuration directives | ! // | - httpHeaders() = sends HTTP headers | ! // | - slashSingleQuotes() = slashes single quotes in a string | ! // | - specialChars() = converts all applicable characters to HTML | ! // | entities, depending on the charset used | ! // | - urlForStyleSheet() = defines the URL of the stylesheet | // +------------------------------------------------------------------------+ // | From the phpMyChat project: | --- 8,29 ---- // | This library contains a set of variables and functions used by many of | // | the phpMyChat scripts: | ! // | - $pmcIsPhp4 = whether the current release of phpMyChat | ! // | is 4+ or not | ! // | - $pmcQueryArgSeparator = the separator used in PHP generated URLs | ! // | to separate arguments | ! // | - pmcIsInto() = ensures a value exist inside a list or an | ! // | array | ! // | - pmcGrabGlobals() = grabs variables from the $HTTP_*_VARS | ! // | arrays | ! // | - pmcHandleMagicQuotes() = adds or removes slashes before special | ! // | characters according to the 'magic quotes | ! // | gpc' and the 'magic quotes runtime' PHP | ! // | configuration directives | ! // | - pmcHttpHeaders() = sends HTTP headers | ! // | - pmcSlashSingleQuotes() = slashes single quotes in a string | ! // | - pmcSpecialChars() = converts all applicable characters to | ! // | HTML entities, depending on the charset | ! // | used | ! // | - pmcUrlForStyleSheet() = defines the URL of the stylesheet | // +------------------------------------------------------------------------+ // | From the phpMyChat project: | *************** *** 69,73 **** * @access public */ ! function isInto($toFind = '', &$in) { $target = (is_array($in)) ? $in : explode(',', $in); --- 70,74 ---- * @access public */ ! function pmcIsInto($toFind = '', &$in) { $target = (is_array($in)) ? $in : explode(',', $in); *************** *** 80,84 **** unset($target); return ($i < $max) ? $i : -1; ! } // end of the 'isInto()' function --- 81,85 ---- unset($target); return ($i < $max) ? $i : -1; ! } // end of the 'pmcIsInto()' function *************** *** 123,127 **** * @access public */ ! function grabGlobals($which = '%ALL') { global $pmcIsPhp4; --- 124,128 ---- * @access public */ ! function pmcGrabGlobals($which = '%ALL') { global $pmcIsPhp4; *************** *** 148,152 **** while (list($key, $value) = each($which)) { ! $ret += grabGlobals($value); } return $ret; --- 149,153 ---- while (list($key, $value) = each($which)) { ! $ret += pmcGrabGlobals($value); } return $ret; *************** *** 158,162 **** // Get the array to handle $atomKeywordsList = array('%ENV', '%GET', '%POST', '%COOKIE', '%SERVER', '%SESSION'); ! if (isInto($which, $atomKeywordsList) >= 0) eval('$theArray = ' . ($pmcIsPhp4 ? '&' : '') . '$GLOBALS[\'HTTP_' . substr($which, 1) . '_VARS\'];'); unset($atomsKeywordsList); --- 159,163 ---- // Get the array to handle $atomKeywordsList = array('%ENV', '%GET', '%POST', '%COOKIE', '%SERVER', '%SESSION'); ! if (pmcIsInto($which, $atomKeywordsList) >= 0) eval('$theArray = ' . ($pmcIsPhp4 ? '&' : '') . '$GLOBALS[\'HTTP_' . substr($which, 1) . '_VARS\'];'); unset($atomsKeywordsList); *************** *** 167,176 **** { $ret = 0; ! $ret += grabGlobals('%ENV'); ! $ret += grabGlobals('%GET'); ! $ret += grabGlobals('%POST'); ! $ret += grabGlobals('%COOKIE'); ! $ret += grabGlobals('%SERVER'); ! $ret += grabGlobals('%SESSION'); // Return true if at least one of the previous actions returns true return $ret; --- 168,177 ---- { $ret = 0; ! $ret += pmcGrabGlobals('%ENV'); ! $ret += pmcGrabGlobals('%GET'); ! $ret += pmcGrabGlobals('%POST'); ! $ret += pmcGrabGlobals('%COOKIE'); ! $ret += pmcGrabGlobals('%SERVER'); ! $ret += pmcGrabGlobals('%SESSION'); // Return true if at least one of the previous actions returns true return $ret; *************** *** 240,244 **** } // end of variable case } ! } // end of the 'grabGlobals()' function --- 241,245 ---- } // end of variable case } ! } // end of the 'pmcGrabGlobals()' function *************** *** 251,257 **** * @access public */ ! function httpHeaders($theCharset = '', $noCache = true) { ! grabGlobals('HTTP_USER_AGENT'); // Avoids using cache --- 252,258 ---- * @access public */ ! function pmcHttpHeaders($theCharset = '', $noCache = true) { ! pmcGrabGlobals('HTTP_USER_AGENT'); // Avoids using cache *************** *** 276,280 **** flush(); ! } // end of the 'httpHeaders()' function --- 277,281 ---- flush(); ! } // end of the 'pmcHttpHeaders()' function *************** *** 293,298 **** * @access public */ ! function urlForStyleSheet( $theCssFileName = '', ! $theCharset = '', $theFontName = '', $theFontSize = '' ) { --- 294,299 ---- * @access public */ ! function pmcUrlForStyleSheet( $theCssFileName = '', ! $theCharset = '', $theFontName = '', $theFontSize = '' ) { *************** *** 306,310 **** return $tmpUrl; ! } // end of the 'urlForStyleSheet()' function --- 307,311 ---- return $tmpUrl; ! } // end of the 'pmcUrlForStyleSheet()' function *************** *** 320,327 **** * @access public */ ! function specialChars($str = '', $isLatin1 = false) { return ($isLatin1) ? htmlentities($str) : htmlspecialchars($str); ! } // end of the 'specialChars()' function --- 321,328 ---- * @access public */ ! function pmcSpecialChars($str = '', $isLatin1 = false) { return ($isLatin1) ? htmlentities($str) : htmlspecialchars($str); ! } // end of the 'pmcSpecialChars()' function *************** *** 343,347 **** * @access public */ ! function handleMagicQuotes($str = '', $isGpcOn = '', $isRtimeOn = '', $action = 'del') { if ($isGpcOn != '') --- 344,348 ---- * @access public */ ! function pmcHandleMagicQuotes($str = '', $isGpcOn = '', $isRtimeOn = '', $action = 'del') { if ($isGpcOn != '') *************** *** 358,362 **** return $str; ! } // end of the 'handleMagicQuotes()' function --- 359,363 ---- return $str; ! } // end of the 'pmcHandleMagicQuotes()' function *************** *** 370,377 **** * @access public */ ! function slashSingleQuotes($str = '') { return str_replace('\'', '\\\'', $str); ! } // end of the 'slashSingleQuotes()' function ?> --- 371,378 ---- * @access public */ ! function pmcSlashSingleQuotes($str = '') { return str_replace('\'', '\\\'', $str); ! } // end of the 'pmcSlashSingleQuotes()' function ?> Index: db_sessions.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/db_sessions.lib.php3,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 |
From: Lo?c C. <lo...@us...> - 2001-04-03 20:10:19
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs In directory usw-pr-cvs1:/tmp/cvs-serv3216/chat/lib/index_libs Added Files: connect_state.lib.js do_enter_db_work.lib.php3 do_enter_frameset.lib.php3 do_enter_js_work.lib.php3 help_popup.lib.js index_validation.lib.php3 Log Message: The first dev. version that works! Still many things to do, of course... --- NEW FILE --- // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | Set of JavaScript functions used to handle the connection state for the | // | 'standard' version of phpMyChat (the JavaScript loader is used). | // | | // | This library is called by the 'chat/lib/index_libs/main_index.lib.php3' | // | script. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: connect_state.lib.js,v 1.1 2001/04/03 20:10:15 loic1 Exp $ // // Handle the connection state for the 'standard' version of phpMyChat. // var jsImgConnectOff = new Image(13,13); jsImgConnectOff.src = jsChatPath + 'images/connect_off.gif'; var jsImgConnectOn = new Image(13,13); jsImgConnectOn.src = jsChatPath + 'images/connect_on.gif'; var jsImgConnectErr = new Image(13,13); jsImgConnectErr.src = jsChatPath + 'images/connect_error.gif'; var jsImgConnect = new Image(13,13); var jsLeaveChat = false; var jsConnect = 0; var jsIsConnecting = null; /** * Tries to connect twice if necessary and sets the icon for connection status * at the 'exit' frame * * @param numTry number of connection tries */ function pmcConnecting(numTry) { var exitFrm = window.frames['exit']; if (jsIsConnecting) clearTimeout(jsIsConnecting); jsConnect = numTry; if (numTry == 1 || numTry == 2) { jsImgConnect.src = jsImgConnectOn.src; } else if (numTry == 3) { jsImgConnect.src = jsImgConnectErr.src; } if (typeof(document.all) != 'undefined') { exitFrm.document.all['imgConState'].src = jsImgConnect.src; } else if (typeof(document.images) != 'undefined') { exitFrm.document.images['imgConState'].src = jsImgConnect.src; } else return; if (numTry < 3) { numTry = numTry + 1; jsIsConnecting = setTimeout('pmcConnecting(' + numTry + ')', 30000); } else { clearTimeout(jsIsConnecting); jsConnect = 0; } } // end of the 'pmcConnecting()' function /** * Kills the timeout defined in the 'pmcConnecting()' function to reconnect once * if the first connection failed, and sets the connection status icon to * 'done' in the exit frame */ function pmcConnectDone() { var exitFrm = window.frames['exit']; jsConnect = 0; if (jsIsConnecting) clearTimeout(jsIsConnecting); if (typeof(document.all) != 'undefined') { if (typeof(exitFrm.document.all['imgConState']) != 'undefined') exitFrm.document.all['imgConState'].src = jsImgConnectOff.src; } else if (typeof(document.images) != 'undefined') { if (typeof(exitFrm.document.images['imgConState']) != 'undefined') exitFrm.document.images['imgConState'].src = jsImgConnectOff.src; } else return; } // end of the 'pmcConnectDone()' function /** * Enforces a new connection try (used when the user click on the 'connection * status' icon at the exit frame) */ function pmcReConnect() { if (jsConnect != 1 && jsConnect != 2) { pmcConnecting(1); // The function below is defined inside the // 'chat/lib/index_libs/main_index.lib.php3' script pmcDoRefreshLoader(); } } // end of the 'pmcReConnect()' function --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This library contains all the database work to be done just before | // | entering the chat. | // | It is called by the 'chat/lib/index_libs/main_index.lib.php3' if the | // | validation of the settings submitted by an user succeeded. | // | | // | It uses the 'pmcGrabGlobals()', the 'pmcSlashSingleQuotes()' and the | // | 'pmcIsInto()' functions defined inside the 'chat/lib/common.lib.php3' | // | script. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: do_enter_db_work.lib.php3,v 1.1 2001/04/03 20:10:15 loic1 Exp $ // // Database work to do when the user is allowed to enter the chat. // // Harmonizes type and name of the room to enter in if (!empty($createRoomName)) { $targetRoom = $createRoomName; } else if (!isset($targetRoom)) // $targetRoom is set when the frameset is { // reloaded because of the NN4+ resize bug. $roomType = 1; $targetRoom = (!empty($enterDefaultRoomName)) ? $enterDefaultRoomName : $enterOtherRoomName; } // Sets cookies that will expire in one year $cookieRoom = urlencode($targetRoom); setcookie('cookieRoom', $cookieRoom, time() + 60*60*24*365); setcookie('cookieRoomType', $roomType, time() + 60*60*24*365); // Gets some variables values from session data or cookies pmcGrabGlobals('%COOKIE'); if (dbSessionIsRegistered('msgKind')) $msgKind = $dbSessionVars['msgKind']; else if (isset($cookieMsgKind)) $msgKind = $cookieMsgKind; if (empty($msgKind)) $msgKind = 'enhanced'; if (dbSessionIsRegistered('msgOrder')) $msgOrder = $dbSessionVars['msgOrder']; else if (isset($cookieMsgOrder)) $msgOrder = $cookieMsgOrder; if (empty($msgOrder)) $msgOrder = C_MSG_ORDER; if (dbSessionIsRegistered('showTimestamp')) $showTimestamp = $dbSessionVars['showTimestamp']; else if (isset($cookieShowTimestamp)) $showTimestamp = $cookieShowTimestamp; if (empty($msgOrder)) $showTimestamp = C_SHOW_TIMESTAMP; if (dbSessionIsRegistered('notify')) $notify = $dbSessionVars['notify']; else if (isset($cookieNotify)) $notify = $cookieNotify; if (empty($msgOrder)) $notify = C_NOTIFY; // Sets the encrypted password and gets the ip on the user if (empty($pwdHash)) $pwdHash = ($isRegUser) ? md5($password) : ''; if (empty($ip)) include('./' . _CHAT_PATH .'lib/get_ip.lib.' . C_EXTENSION); // Defines the user status to be put in the users table if necessary. // Skipped when the frameset is reloaded because of the NS4+ resize bug. if (!isset($reloading) || $reloading != 'nsResize') { if ($regUserPerms == '' && !$isRegUser) $regUserPerms = 'noreg'; switch ($regUserPerms) { case 'admin': // administrator $status = 'a'; break; case 'moderator': // moderator or registered user $status = (pmcIsInto($targetRoom, $regUserModeratedRooms) >= 0) ? 'm' : 'r'; break; case 'noreg': // non-registered user $status = 'u'; break; default: // registered user $status = 'r'; } } // Defines some variables $currentTime = time(); $nickForNotifications = pmcSlashSingleQuotes(pmcSlashSingleQuotes(pmcSpecialChars($slashedNick, $latin1))); if (C_WELCOME) { // ensures the welcome msg is the last one $currentTimePlus = $currentTime + 1; // Insert a new welcome message in the messages table include('./' . _CHAT_PATH . 'lib/welcome.lib.' . C_EXTENSION); $slashedWelcomeMsg = pmcSlashSingleQuotes(WELCOME_MSG); } // Udpates the IP address and the last log. time of the user in the // regsistered users table if necessary if ($isRegUser) $dbLink->query("UPDATE " . C_REG_TBL . " SET reg_time = '$currentTime', ip = '$ip' WHERE username = '$slashedNick'"); // 1. In the case of a registered user that relogs... // 1.a ...in the same room -> updates his last loggin time and his IP address; // 1.b ...in an other room -> kicks him from the other room, puts a // notification message of exit for this room, updates the users table, // puts a notification message of entrance for the room he logs in and // send him a welcome message if required. if ($wasInRoom != '') { if ($targetRoom == $wasInRoom) // Case 1.a { $dbLink->query("UPDATE " . C_USR_TBL . " SET u_time = '$currentTime', ip = '$ip' WHERE session_id = '$dbSessionId'"); } else // Case 1.b { $slashedRoomName = pmcSlashSingleQuotes($wasInRoom); $dbLink->query("SELECT type FROM " . C_MSG_TBL . " WHERE room = '$slashedRoomName' LIMIT 1"); list($type) = $dbLink->nextRecord(); $dbLink->clean_results(); $dbLink->query("INSERT INTO " . C_MSG_TBL . " VALUES ($roomType, '$slashedRoomName', 'SYS exit', '', '$currentTime', NULL, '#666699', 'sprintf(L_EXIT_ROM, \'" . $nickForNotifications . "\')', 'sprintf(L_EXIT_ROM, \'" . $nickForNotifications . "\')')"); $slashedRoomName = pmcSlashSingleQuotes($targetRoom); $dbLink->query("INSERT INTO " . C_MSG_TBL . " VALUES ($roomType, '$slashedRoomName', 'SYS enter', '', '$currentTime', NULL, '#666699', 'sprintf(L_ENTER_ROM, \'" . $nickForNotifications . "\')', 'sprintf(L_ENTER_ROM, \'" . $nickForNotifications . "\')')"); $dbLink->query("UPDATE " . C_USR_TBL . " SET u_time = '$currentTime', room = '$slashedRoomName', status = '$status', ip = '$IP' WHERE session_id = '$dbSessionId'"); if (C_WELCOME) { // Delete the old welcome messages sent to the current user $dbLink->query("DELETE FROM " . C_MSG_TBL . " WHERE username = 'SYS welcome' AND address = '$slashedNick'"); $dbLink->query("INSERT INTO " . C_MSG_TBL . " VALUES ($roomType, '$slashedRoomName', 'SYS welcome', '', '$currentTimePlus', '$slashedNick', '#666699', '" . $slashedWelcomeMsg . "', '" . $slashedWelcomeMsg . "')"); } } } // end of case where a registered user relogs // 2. In the case of an user that relogs because of the resize bug of NS4+ // updates his logging time and his IP address elseif (isset($reloading) && $reloading == 'nsResize') { $slashedRoomName = pmcSlashSingleQuotes($targetRoom); $dbLink->query("UPDATE " . C_USR_TBL . " SET u_time = '$currentTime', room = '$slashedRoomName', ip = '$ip' WHERE session_id = '$dbSessionId'"); } // end of case where an is relogged because of NS4+ resize bug // 3. In all other cases of users entering in, sets user infos. in 'users' // table and puts a notification message of entrance and a welcome message // if required into the 'messages' table else { $slashedRoomName = pmcSlashSingleQuotes($targetRoom); $dbLink->query("INSERT INTO " . C_USR_TBL . " VALUES ('$dbSessionId', '$currentTime', '$slashedRoomName', '$slashedNick', '$latin1', '$status', '$ip')"); $dbLink->query("INSERT INTO " . C_MSG_TBL . " VALUES ($roomType, '$slashedRoomName', 'SYS enter', '', '$currentTime', NULL, '#666699', 'sprintf(L_ENTER_ROM, \'" . $nickForNotifications . "\')', 'sprintf(L_ENTER_ROM, \'" . $nickForNotifications . "\')')"); if (C_WELCOME) { // Deletes the old welcome messages sent to the current user $dbLink->query("DELETE FROM " . C_MSG_TBL . " WHERE username = 'SYS welcome' AND address = '$slashedNick'"); $dbLink->query("INSERT INTO " . C_MSG_TBL . " VALUES ($roomType, '$slashedRoomName', 'SYS welcome', '', '$currentTimePlus', '$slashedNick', '#666699', '" . $slashedWelcomeMsg . "', '" . $slashedWelcomeMsg . "')"); } } // end of "all other cases" // Prepares (ie removes unnecessary data) and saves session data $keptLang = $dbSessionVars['lang']; $keptFrom = $dbSessionVars['from']; unset($dbSessionVars); $dbSessionVars['from'] = $keptFrom; $dbSessionVars['lang'] = $keptLang; $dbSessionVars['jsVersion'] = $jsVersion; $dbSessionVars['nick'] = $nick; $dbSessionVars['pwdHash'] = $pwdHash; $dbSessionVars['roomType'] = $roomType; $dbSessionVars['targetRoom'] = $targetRoom; $dbSessionVars['status'] = (empty($status)) ? 'u' : $status; $dbSessionVars['refreshDelay'] = C_MSG_REFRESH; $dbSessionVars['msgKind'] = $msgKind; $dbSessionVars['msgOrder'] = $msgOrder; $dbSessionVars['msgNumber'] = C_MSG_NB; $dbSessionVars['showTimestamp'] = $showTimestamp; $dbSessionVars['notify'] = $notify; dbSessionSave(); unset($keptLang); unset($keptFrom); // Deletes invite messages sent to the user for the room he will enter in $dbLink->query("SELECT m_time FROM " . C_MSG_TBL . " WHERE username = 'SYS inviteTo' AND address = '$slashedNick' AND room = '$slashedRoomName'"); while (list($sentTime) = $dbLink->nextRecord()) { $dbLink->query("DELETE FROM " . C_MSG_TBL . " WHERE m_time = '$sentTime' AND (username = 'SYS inviteFrom' OR (username = 'SYS inviteTo' AND address = '$slashedNick'))"); } ?> --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | This library defines the frameset depending on whether the browser knows | // | or not. | // | | // | It is called by the 'chat/lib/index_libs/main_index.lib.php3' script. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: do_enter_frameset.lib.php3,v 1.1 2001/04/03 20:10:15 loic1 Exp $ // // Defines the frameset for phpMyChat. // /** * Defines some URLs */ // The url to be used as a fix for the Netscape resize bug $nsResizeUrl = $dbSessionVars['from'] . '?' . dbSessionSID('GET') . $pmcQueryArgSeparator . 'reloading=nsResize'; // The url to be used for the loader if ($jsVersion == 'high') { $loaderUrl = _CHAT_PATH . 'loader.' . C_EXTENSION . '?' . dbSessionSID('GET') . $pmcQueryArgSeparator . 'isInitLoad=1' . $pmcQueryArgSeparator . 'lastMsgLoad=0' . $pmcQueryArgSeparator . 'lastUsrCheck=0'; } /** * Defines the frameset */ // With DHTML : 3 imbricated framesets if ($jsVersion == 'high') { ?> <frameset cols="100%,*,*" frameborder="0" border="0" framespacing="0" onresize="if (typeof(document.layers) != 'undefined') window.location = '<?php echo($nsResizeUrl); ?>';"> <!-- Visible framesets --> <frameset cols="*,130" frameborder="0" border="0" framespacing="0"> <frameset rows="*,50" frameborder="0" border="0" framespacing="0"> <frame src="<?php echo(_CHAT_PATH); ?>blank.htm" name="messages" frameborder="0" border="0" framespacing="0" marginwidth="3" marginheight="3" /> <frame src="<?php echo(_CHAT_PATH); ?>input.<?php echo(C_EXTENSION . '?' . dbSessionSID('GET')); ?>" name="input" frameborder="0" border="0" framespacing="0" marginwidth=0 marginheight=0 scrolling="no" noresize="noresize" /> </frameset> <frameset rows="80,*,50" frameborder="0" border="0" framespacing="0"> <frame src="<?php echo(_CHAT_PATH); ?>exit.<?php echo(C_EXTENSION . '?' . dbSessionSID('GET')); ?>" name="exit" frameborder="0" border="0" framespacing="0" marginwidth=3 marginheight=3 scrolling="no" /> <frame src="<?php echo(_CHAT_PATH); ?>users.<?php echo(C_EXTENSION . '?' . dbSessionSID('GET')); ?>" name="users" frameborder="0" border="0" framespacing="0" marginwidth=3 marginheight=3 /> <frame src="<?php echo(_CHAT_PATH); ?>link.php3" name="link" frameborder="0" border="0" framespacing="0" marginwidth=0 marginheight=0 scrolling="no" /> </frameset> </frameset> <!-- Hidden frame for the input work when something has been sent --> <frame src="<?php echo(_CHAT_PATH); ?>blank.htm" name="handle_input" frameborder="0" border="0" framespacing="0" marginheight="0" marginwidth="0" scrolling="no" /> <!-- Hidden frame for the loader --> <frame src="<?php echo($loaderUrl); ?>" name="loader" frameborder="0" border="0" framespacing="0" marginheight="0" marginwidth="0" scrolling="no" /> </frameset> <?php } // end of the 'DHTML enabled' case // Without DHTML : 2 imbricated framesets else { ?> <frameset cols="*,130" frameborder="0" border="0" framespacing="0" onResize="if (typeof(document.layers) != 'undefined') window.location = '<?php echo($nsResizeUrl); ?>';"> <frameset rows="*,50" border=0> <frame src="<?php echo(_CHAT_PATH); ?>messages_low.<?php echo(C_EXTENSION . '?' . dbSessionSID('GET')); ?>" name="messages" marginwidth=3 marginheight=3 /> <frame src="<?php echo(_CHAT_PATH); ?>input.<?php echo(C_EXTENSION . '?' . dbSessionSID('GET')); ?>" name="input" marginwidth=0 marginheight=0 scrolling="no" noresize="noresize" /> </frameset> <frameset rows="80,*,50" border=0> <frame src="<?php echo(_CHAT_PATH); ?>exit.<?php echo(C_EXTENSION . '?' . dbSessionSID('GET')); ?>" name="exit" marginwidth=3 marginheight=3 scrolling="no" /> <frame src="<?php echo(_CHAT_PATH); ?>users_low.<?php echo(C_EXTENSION . '?' . dbSessionSID('GET')); ?>" name="users" marginwidth=3 marginheight=3 /> <frame src="<?php echo(_CHAT_PATH); ?>link.php3" name="link" marginwidth=0 marginheight=0 scrolling="no" /> </frameset> </frameset> <?php } // end of the 'DHTML not-enabled' case ?> --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | Set of JavaScript instructions to use when the user is allowed to enter | // | the chat. | // | | // | This library is called by the 'chat/lib/index_libs/main_index.lib.php3' | // | script. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: do_enter_js_work.lib.php3,v 1.1 2001/04/03 20:10:15 loic1 Exp $ // // Defines some JavaScript instructions when the user is allowed to enter. // ?> <!-- Defines some js variables --> <script type="text/javascript" language="javascript"> <!-- var jsPhpExt = '<?php echo(C_EXTENSION); ?>'; var jsChatPath = '<?php echo(_CHAT_PATH); ?>'; var jsDbSessionSID = '<?php echo(dbSessionSID('GET')); ?>'; var jsIsNS4 = (typeof(document.layers) != 'undefined') ? 1 : 0; var jsIsIE4 = ((typeof(document.all) != 'undefined') && (parseInt(navigator.appVersion) >= 4)) ? 1 : 0; var jsIsVersion4 = (jsIsNS4 || jsIsIE4) ? 1 : 0; var jsIsJs11 = (typeof(window.focus) != 'undefined'); var jsIgnoredPopupWin = null; var jsUsersPopupWin = null; var jsInputForm = null; var jsUrlQueryForHelp = '<?php echo('lang=' . $dbSessionVars['lang'] . $pmcQueryArgSeparator . 'jsVersion=' . $jsVersion); ?>'; var jsInvalidCommandMsg = '<?php echo(pmcSlashSingleQuotes(L_BAD_CMD)); ?>'; // --> </script> <script type="text/javascript" language="javascript1.1"> <!-- var jsIsModerator = <?php echo((isset($status) && ($status == 'a' || $status == 'm')) ? 1 : 0); ?>; // --> </script> <!-- Gets the library containing miscellaneous js functions --> <script src="<?php echo(_CHAT_PATH); ?>lib/index_libs/misc.lib.js" type="text/javascript" language="javascript"></script> <!-- Required to display the server time at the status bar --> <script src="<?php echo(_CHAT_PATH); ?>lib/index_libs/server_time.lib.js" type="text/javascript" language="javascript"></script> <script type="text/javascript" language="javascript"> <!-- var jsClockDisplay = null; var jsServerTimeString = '<?php echo(L_SVR_TIME); ?>'; <?php if ($dbSessionVars['showTimestamp'] == 1) { $currentDate = mktime(date('H') + C_TMZ_OFFSET, date('i'), date('s'), date('m'), date('d'), date('Y')); ?> var jsClockGap = pmcCalcGap('<?php echo(date('F d, Y H:i:s', $currentDate)); ?>'); pmcClock(); <?php } else { ?> var jsClockGap = null; <?php } echo("\n"); ?> // --> </script> <!-- Gets the library that allows to modify the color picker --> <script src="<?php echo(_CHAT_PATH); ?>lib/index_libs/set_msg_color.lib.js" type="text/javascript" language="javascript1.1"></script> <!-- Gets the library that allows to launch the help popup --> <script src="<?php echo(_CHAT_PATH); ?>lib/index_libs/help_popup.lib.js" type="text/javascript" language="javascript"></script> <?php // For DHTML enabled browsers if ($jsVersion == 'high') { ?> <!-- Required to enforce reloading of the 'loader' frame --> <script type="text/javascript" language="javascript"> <!-- var jsIsInitLoad = 1; var jsLastLoadedMsgTime = 0; var jsLastCheckedUserTime = 0; if (typeof(location.replace) == 'undefined') // Emulates the replace method location.replace = location.assign; // Refreshes the 'loader' frame function pmcDoRefreshLoader() { var jsLoaderUrl = 'loader.<?php echo(C_EXTENSION); ?>' + '?<?php echo(dbSessionSID()); ?>' + '<?php echo($pmcQueryArgSeparator); ?>isInitLoad=' + jsIsInitLoad + '<?php echo($pmcQueryArgSeparator); ?>lastMsgLoad=' + jsLastLoadedMsgTime + '<?php echo($pmcQueryArgSeparator); ?>lastUsrCheck=' + jsLastCheckedUserTime; window.frames['loader'].window.location.replace(jsLoaderUrl); } // --> </script> <!-- Gets the libraries for collapsible list and connection state --> <script src="<?php echo(_CHAT_PATH); ?>lib/index_libs/users.lib.js" type="text/javascript" language="javascript1.2"></script> <script src="<?php echo(_CHAT_PATH); ?>lib/index_libs/connect_state.lib.js" type="text/javascript" language="javascript1.2"></script> <?php } // end of the DHTML enabled browser case ?> --- NEW FILE --- // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | Defines the position of the help popup and launches it. | // | | // | This library is called by the 'chat/lib/index_libs/main_index.lib.php3' | // | script. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: help_popup.lib.js,v 1.1 2001/04/03 20:10:15 loic1 Exp $ // // Defines the position of the help popup and launches it. // var jsMouseX = 0; var jsMouseY = 0; var jsHelpPopupWin = null; if (typeof(Image) != 'undefined') // 'Image' is a js1.1 object { var jsImgHelpOff = new Image(15,15); jsImgHelpOff.src = jsChatPath + 'images/help_off.gif'; var jsImgHelpOn = new Image(15,15); jsImgHelpOn.src = jsChatPath + 'images/help_on.gif'; } /** * Sets the position of the help popup * * @param object event type (used under NS4+) * * @access public */ function pmcDisplayLocation(e) { if (jsIsVersion4) { if (jsIsIE4) e = window.frames['input'].window.event; jsMouseX = e.screenX; jsMouseY = e.screenY; } return; } // end of the function 'pmcDisplayLocation()' /** * Launches the help popup * * @param leftOffset a value depending on the text direction */ function pmcHelpPopup(leftOffset) { if (typeof(jsHelpPopupWin) != 'undefined' && jsHelpPopupWin && !jsHelpPopupWin.closed) { if (jsIsJs11) jsHelpPopupWin.focus(); } else { var scrTop = jsMouseY - 400; var scrLeft = jsMouseX - leftOffset; var scrPos = 'top=' + scrTop + ',screenY=' + scrTop + ',left=' + scrLeft + ',screenX=' + scrLeft + ','; jsHelpPopupWin = window.open('help_popup.' + jsPhpExt + '?' + jsUrlQueryForHelp, 'help_popup', scrPos + 'width=600,height=350,scrollbars=yes,resizable=yes'); } } // end of the function 'pmcHelpPopup()' --- NEW FILE --- <? // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | Set of functions used to validate the settings submitted by the starting | // | page of phpMyChat. | // | | // | This library is called by the 'chat/lib/index_libs/main_index.lib.php3' | // | script. | // | It uses: | // | - the 'pmcHandleMagicQuotes()', the 'pmcSlashSingleQuotes()' and the | // | 'pmcIsInto()' functions defined inside the | // | 'chat/lib/common.lib.php3' script; | // | - the 'checkWords()' function defined inside the | // | 'chat/lib/swearing.lib.php3' script. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <php...@ya...> | // +--------------------------------------------------------------------------+ // // $Id: index_validation.lib.php3,v 1.1 2001/04/03 20:10:15 loic1 Exp $ // // Validates the settings submitted by the starting page of phpMyChat. // /** * Validates the nick and the password submitted by the starting form of * phpMyChat * * @param $isRegNick true if the nick is a registered one * @param $regNickPerms permission level associated to the nick * @param $regNickModeratedRooms list of the room moderated by the user * @param $loggedInRoom name of the room the user was chatting into * * @return string error number (empty if no error) * * @global object the instance of the pmcDB object * @global string the nick of the user who wants to enter the * chat * @global string the slashed nick of the user who wants to * enter the chat * @global string the password entered by this user * @global string the md5 hash of this password * * @access public */ function pmcValidateNickAndPaswd( &$isRegNick, &$regNickPerms, &$regNickModeratedRooms, &$loggedInRoom) { global $dbLink; global $nick, $slashedNick; global $password, $pwdHash; $error1 = ''; $isLoggedIn = false; $requireReg = C_REQUIRE_REGISTER; // 1. Ensures invalid characters/words aren't in use for the nick // Ensures a nick has been submitted if ($nick == '') { $error1 = L_ERR_USR_2; } // Checks for invalid characters or empty nick else if (trim($nick) == '' || ereg('[\, ]', $nick)) { $error1 = L_ERR_USR_16; } // Checks for bad words in the nick else if (C_BAD_WORDS) { if (checkWords($nick, true)) $error1 = L_ERR_USR_18; } // end of the 1st stage (character validation inside the nick) // 2. If the nick is currently in use, gets the corresponding room name and // sets the $requireReg variable to true if ($error1 == '') { $dbLink->query("SELECT room FROM " . C_USR_TBL . " WHERE username = '$slashedNick' LIMIT 1"); $isLoggedIn = (list($loggedInRoom) = $dbLink->nextRecord()); if ($isLoggedIn) { $loggedInRoom = pmcHandleMagicQuotes($loggedInRoom, '', 1, 'del'); $requireReg = true; } } // end of the 2nd stage (checking if the nick is already in use) // 3. If registration is required but no password has been submitted // -> deny access if ($error1 == '' && $requireReg) { if ($password == '' && $pwdHash == '') $error1 = ($isLoggedIn) ? L_ERR_USR_1 : L_ERR_USR_14; } // end of the 3rd stage (a password has been submitted if required) // 4. Ensure a valid password has been submitted if the nick is a // registered one, then gets permission levels for this nick if ($error1 == '') { $dbLink->query("SELECT password, perms, rooms FROM " . C_REG_TBL . " WHERE username = '$slashedNick' LIMIT 1"); $isRegNick = (list($regUserPassword, $regNickPerms, $regNickModeratedRooms) = $dbLink->nextRecord()); if ($isRegNick) $regNickModeratedRooms = pmcHandleMagicQuotes($regNickModeratedRooms, '', 1, 'del'); $dbLink->cleanResults(); // Skip the validation work when it has already be done before the // 'main_index.lib.php3' is run if (!isset($GLOBALS['$exitMode']) && $isRegNick) { // Reserved nick but no password submitted -> deny access if ($password == '' && $pwdHash == '') { $error1 = L_ERR_USR_3; } // Validates the password submitted else { if ($password != '') $pwdHash = md5($password); if ($pwdHash != $regUserPassword) { $isRegNick = false; $password = ''; $pwdHash = ''; $regNickPerms = 'user'; $regNickModeratedRooms = ''; $error1 = L_ERR_USR_4; } } } } // end of the 4th stage (validation of the password) return $error1; } // end of the 'pmcValidateNickAndPaswd()' function /** * Validates the name of the room to create and defines the permission level * the user will be granted inside this room * * @param $userPerms permission level associated to the nick * @param $userModeratedRooms list of the room moderated by the user * * @return string error number * * @global object the instance of the pmcDB object * @global string the slashed nick of the user who wants to * enter the chat * @global boolean whether this nick is a registered one or * not * @global string the name of the room to create * @global string the slashed name of the room to create * @global integer the type of the room to create * @global string the list of default public rooms * @global string the list of default private rooms * * @access public */ function pmcValidateRoomCreation(&$userPerms, &$userModeratedRooms) { global $dbLink; global $slashedNick; global $isRegUser; global $createRoomName, $slashedRoomName, $roomType; global $defaultChatRooms, $defaultPrivateRooms; $error2 = ''; // 1. Validates the room name // Skipped if the frameset is reloaded because of the NS4+ resize bug, // because the user has run a '/join' command or because he has clicked // on a room name at the users frame. if (!isset($GLOBALS['reloading'])) { // User is not registered -> deny room creation if (!$isRegUser) { $error2 = L_ERR_USR_13; } // Checks for invalid characters or empty room name else if (trim($createRoomName) == '' || ereg('[\,]', $createRoomName)) { $error2 = L_ERR_ROM_1; } // Checks for bad words in the room name else if (C_BAD_WORDS && checkWords($createRoomName, true)) { $error2 = L_ERR_ROM_2; } // Ensures there is no existing room with the same name but a different // type... else { // ...among reserved name for private/public (default) rooms $searchIn = ($roomType == 1) ? $defaultPrivateRooms : $defaultChatRooms; if (pmcIsInto($slashedRoomName, $searchIn) >= 0) $error2 = ($roomType == 0) ? L_ERR_ROM_3 : L_ERR_ROM_4; unset($searchIn); // ...among other rooms created by users if ($error2 == '') { $oppositeType = 1 - $roomType; $dbLink->query("SELECT COUNT(*) FROM " . C_MSG_TBL . " WHERE room = '$slashedRoomName' AND type = '$oppositeType' LIMIT 1"); list($isOpposite) = $dbLink->nextRecord(); $dbLink->cleanResults(); if ($isOpposite != 0) $error2 = ($T == 0) ? L_ERR_ROM_3 : L_ERR_ROM_4; } } } // end of the 1st stage (validation of the name of the room to create) // 2. Defines the permission level of the user for the room to create if ($error2 == '') { $isNewRoom = true; // If the name of the room to be created is a reserved one for // private/public (default) rooms, status will be 'user'. // Skipped if the frameset is reloaded because of the NS4+ resize bug, // because the user has run a '/join' command or because he has clicked // on a room name at the users frame. if (!isset($GLOBALS['reloading'])) { $searchIn = ($roomType == 1) ? $defaultChatRooms : $defaultPrivateRooms; $isNewRoom = (pmcIsInto($slashedRoomName, $searchIn) >= 0); unset($searchIn); } // If the name of the room to be created is the same than one of an // existing room containing 'true' messages (not only notifications of // users entrance/exit) or containing only 'system' message but an user // is currently logged in, status will be 'user' if ($isNewRoom) { $dbLink->query("SELECT COUNT(*) FROM " . C_MSG_TBL . " WHERE room = '$slashedRoomName' AND username NOT LIKE 'SYS %' LIMIT 1"); list($isTrueMsg) = $dbLink->nextRecord(); $isNewRoom = ($isTrueMsg == 0); $dbLink->cleanResults(); } if ($isNewRoom) { $dbLink->query("SELECT COUNT(*) FROM " . C_USR_TBL . " WHERE room = '$slashedRoomName' AND username != '$slashedNick' LIMIT 1"); list($isAnybody) = $dbLink->nextRecord(); $isNewRoom = ($isAnybody == 0); $dbLink->cleanResults(); } // end of true new room } // end of the 2nd stage (getting the status of the user) // 3. Updating permission levels inside the registered users table if ($error2 == '' && $isNewRoom) { // If an other registered user is already moderator for the room to // create but there is no 'true' message in this room then sets his // status to 'user' for this room $dbLink->query("SELECT username, rooms FROM " . C_REG_TBL . " WHERE perms = 'moderator' AND username != '$slashedNick'"); while (list($otherModerator, $otherModeratedRooms) = $dbLink->nextRecord()) { $changed = false; $otherModerator = pmcHandleMagicQuotes($otherModerator, '', 1, 'del'); $otherModeratedRooms = pmcHandleMagicQuotes($otherModeratedRooms, '', 1, 'del'); $rooms = explode(',', $otherModeratedRooms); for ($i = 0; $i < count($rooms); $i++) { if (strcasecmp($createRoomName, $rooms[$i]) == 0) { $rooms[$i] = ''; $changed = true; break; } } if ($changed) { $otherModeratedRooms = implode(',', $rooms); $otherModeratedRooms = ereg_replace('^,|,$', '', $otherModeratedRooms); $otherModeratedRooms = str_replace(',,', ',', $otherModeratedRooms); $dbLink->query("UPDATE " . C_REG_TBL . " SET rooms = '" . pmcSlashSingleQuotes($otherModeratedRooms) . "' WHERE username = '" . pmcSlashSingleQuotes($otherModerator) . "'"); $dbLink->query("UPDATE " . C_USR_TBL . " SET status = 'r' WHERE room = '$slashedRoomName' AND username = '" . pmcSlashSingleQuotes($otherModerator) . "'"); } unset($rooms); } // Update the current user status for the room to be created $changed = false; if (pmcIsInto($createRoomName, $userModeratedRooms) < 0) { if ($userModeratedRooms != '') $userModeratedRooms .= ','; $userModeratedRooms .= $createRoomName; $changed = true; } if ($userPerms == 'user' || $userPerms == '') { $userPerms = 'moderator'; $changed = true; } if ($changed && $userPerms != 'admin') { $dbLink->query("UPDATE " . C_REG_TBL . " SET perms = '$userPerms', rooms = '" . pmcSlashSingleQuotes($userModeratedRooms) ."' WHERE username = '$slashedNick'"); } // end of updating tables } // end of the 3rd stage (updating registered users tables) return $error2; } // end of the 'pmcValidateRoomCreation()' function ?> |