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-05-24 15:16:01
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/install/database In directory usw-pr-cvs1:/tmp/cvs-serv24993/chat/install/database Modified Files: pgsql.sql mysql.sql Log Message: Password are no long md5 hashed Index: pgsql.sql =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/install/database/pgsql.sql,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** pgsql.sql 2001/04/21 15:16:52 1.3 --- pgsql.sql 2001/05/24 15:15:59 1.4 *************** *** 59,63 **** gender int2 NOT NULL DEFAULT '0' ); ! INSERT INTO pmc_reg_users VALUES('admin', '', '21232f297a57a5a743894a0e4a801fc3', '', '', '', '', '', 0, 'admin', '', '', '', ''); CREATE INDEX reg_time ON pmc_reg_users (reg_time); CREATE INDEX perms ON pmc_reg_users (perms); --- 59,63 ---- gender int2 NOT NULL DEFAULT '0' ); ! INSERT INTO pmc_reg_users VALUES('admin', '', 'admin', '', '', '', '', '', 0, 'admin', '', '', '', ''); CREATE INDEX reg_time ON pmc_reg_users (reg_time); CREATE INDEX perms ON pmc_reg_users (perms); Index: mysql.sql =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/install/database/mysql.sql,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** mysql.sql 2001/04/21 15:16:22 1.5 --- mysql.sql 2001/05/24 15:15:59 1.6 *************** *** 59,63 **** KEY perms (perms) ); ! INSERT INTO pmc_reg_users VALUES('admin', '', '21232f297a57a5a743894a0e4a801fc3', '', '', '', '', '', 0, 'admin', '', '', '', ''); --- 59,63 ---- KEY perms (perms) ); ! INSERT INTO pmc_reg_users VALUES('admin', '', 'admin', '', '', '', '', '', 0, 'admin', '', '', '', ''); |
From: Lo?c C. <lo...@us...> - 2001-05-24 14:27:58
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/japanese In directory usw-pr-cvs1:/tmp/cvs-serv15245/chat/localization/japanese Modified Files: admin.loc Log Message: Fixed a parse error Index: admin.loc =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/japanese/admin.loc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** admin.loc 2001/05/05 17:22:37 1.3 --- admin.loc 2001/05/24 14:27:56 1.4 *************** *** 28,32 **** // Top frame ! define("A_MENU_0', '%s ¤Î´ÉÍý¥â¡¼¥É'); define('A_MENU_1', 'ÅÐÏ¿¤µ¤ì¤¿¥æ¡¼¥¶¡¼'); define('A_MENU_2', 'ÄÉÊü¤µ¤ì¤¿¥æ¡¼¥¶¡¼'); --- 28,32 ---- // Top frame ! define('A_MENU_0', '%s ¤Î´ÉÍý¥â¡¼¥É'); define('A_MENU_1', 'ÅÐÏ¿¤µ¤ì¤¿¥æ¡¼¥¶¡¼'); define('A_MENU_2', 'ÄÉÊü¤µ¤ì¤¿¥æ¡¼¥¶¡¼'); |
From: Lo?c C. <lo...@us...> - 2001-05-24 14:27:32
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv15178/chat Modified Files: profile_edit.php3 Log Message: PHPMYMAILER order were inversed & display message about new password the same way than in profile_reg.php3 Index: profile_edit.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/profile_edit.php3,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** profile_edit.php3 2001/05/23 21:41:46 1.11 --- profile_edit.php3 2001/05/24 14:27:29 1.12 *************** *** 192,196 **** include('./lib/mailer.lib.' . C_EXTENSION); } ! $mailHandler = new PHPMYMAILER(C_REG_SENDER, C_REG_EMAIL); $mailHandler->pmmSendEmail( $recipient, L_CHARSET, $subject, $body); --- 192,196 ---- include('./lib/mailer.lib.' . C_EXTENSION); } ! $mailHandler = new PHPMYMAILER(C_REG_EMAIL, C_REG_SENDER); $mailHandler->pmmSendEmail( $recipient, L_CHARSET, $subject, $body); *************** *** 311,315 **** </tr> <tr> ! <th colspan="2"><?php if (!$isRegDone) echo(L_REG_37); ?></th> </tr> <tr><td> </td></tr> --- 311,315 ---- </tr> <tr> ! <th colspan="2"><?php if (!$isRegDone) echo(L_REG_37); else if (C_EMAIL_PASWD) echo(L_EMAIL_VAL_DONE); ?></th> </tr> <tr><td> </td></tr> *************** *** 351,363 **** <?php if (!$isRegDone) echo('<span class="error">*</span>'); ?> </td> - </tr> - <?php - } - else - { - echo("\n"); - ?> - <tr> - <td align="center" valign="middle" colspan="2"><i><?php echo(L_EMAIL_VAL_DONE); ?></i></td> </tr> <?php --- 351,354 ---- |
From: Lo?c C. <lo...@us...> - 2001-05-24 14:26:35
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv14983/chat Modified Files: profile_remind.php3 profile_reg.php3 Log Message: PHPMYMAILER order were inversed Index: profile_remind.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/profile_remind.php3,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** profile_remind.php3 2001/05/16 20:54:32 1.1 --- profile_remind.php3 2001/05/24 14:26:32 1.2 *************** *** 132,136 **** include('./lib/mailer.lib.' . C_EXTENSION); } ! $mailHandler = new PHPMYMAILER(C_REG_SENDER, C_REG_EMAIL); $mailHandler->pmmSendEmail( $recipient, L_CHARSET, $subject, $body); --- 132,136 ---- include('./lib/mailer.lib.' . C_EXTENSION); } ! $mailHandler = new PHPMYMAILER(C_REG_EMAIL, C_REG_SENDER); $mailHandler->pmmSendEmail( $recipient, L_CHARSET, $subject, $body); Index: profile_reg.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/profile_reg.php3,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** profile_reg.php3 2001/05/22 20:40:34 1.13 --- profile_reg.php3 2001/05/24 14:26:32 1.14 *************** *** 192,196 **** if (!defined('_LIB_PHPMYMAILER_LOADED')) include('./lib/mailer.lib.' . C_EXTENSION); ! $mailHandler = new PHPMYMAILER(C_REG_SENDER, C_REG_EMAIL); $mailHandler->pmmSendEmail( $recipient, L_CHARSET, $subject, $body); --- 192,196 ---- if (!defined('_LIB_PHPMYMAILER_LOADED')) include('./lib/mailer.lib.' . C_EXTENSION); ! $mailHandler = new PHPMYMAILER(C_REG_EMAIL, C_REG_SENDER); $mailHandler->pmmSendEmail( $recipient, L_CHARSET, $subject, $body); |
From: Lo?c C. <lo...@us...> - 2001-05-23 21:41:49
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv12403/chat Modified Files: profile_edit.php3 Log Message: Changing of e-mail address cause a new password to be generated if C_REQUIRE_REG Index: profile_edit.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/profile_edit.php3,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** profile_edit.php3 2001/05/22 20:40:34 1.10 --- profile_edit.php3 2001/05/23 21:41:46 1.11 *************** *** 48,53 **** pmcGrabGlobals($toGrab); ! // Unslashes values of variables sent to this script ($authUsername is sent by ! // by the login script) if (!empty($nick)) $nick = pmcHandleMagicQuotes($nick, '1', '', 'del'); --- 48,52 ---- pmcGrabGlobals($toGrab); ! // Unslashes values of variables sent to this script if (!empty($nick)) $nick = pmcHandleMagicQuotes($nick, '1', '', 'del'); *************** *** 167,193 **** // Nick is already reserved if ($isReserved != 0) $error = L_ERR_USR_9; } } // end of the validation work // Udpates the profile if (!isset($error)) { $slashedPswd = pmcSlashSingleQuotes(str_replace('\\', '\\\\', $password)); ! $latin1 = (L_CHARSET == 'iso-8859-1') ? 1 : 0; ! $showEmail = (isset($showEmail) && $showEmail) ? 1 : 0; if (!isset($gender)) ! $gender = ''; // Gets the ip include('./lib/get_user_infos.lib.' . C_EXTENSION); ! $ip = pmcGetIp(); ! // Updates the profile $dbLink->query("UPDATE " . C_REG_TBL . " SET username = '$slashedNick', latin1 = '$latin1', password = '$slashedPswd', firstname='" . pmcSlashSingleQuotes($firstName) . "', lastname = '" . pmcSlashSingleQuotes($lastName) . "', country = '" . pmcSlashSingleQuotes($spokenLang) . "', website = '$webSite', email = '$email', showemail = $showEmail, reg_time = " . time() . ", ip = '$ip', gender = '$gender' WHERE username = '" . pmcSlashSingleQuotes($dbSessionVars['authUsername']) . "'"); if ($dbSessionVars['authPassword'] != $password) $dbSessionVars['authPassword'] = $password; ! $message = L_REG_17; ! $isRegDone = true; } } // end of the updating profile work --- 166,232 ---- // Nick is already reserved if ($isReserved != 0) + { $error = L_ERR_USR_9; + } } } // end of the validation work + + // If password are generated and sent by e-mail, do it if e-mail has + // changed + if (!isset($error) + && C_EMAIL_PASWD + && $dbSessionVars['prevEmail'] != $email) + { + include('./lib/gen_password.lib.' . C_EXTENSION); + $password = genPassword(); + $recipient = array($email => array($nick, L_CHARSET)); + $subject = '[' . APP_NAME . '] ' . L_EMAIL_VAL_1; + $body = L_SET_2 . ': ' . $nick . "\n"; + $body .= L_REG_7 . ': ' . $password . "\n\n"; + $body .= L_EMAIL_VAL_2 . "\n"; + $body .= C_CHAT_URL . "\n"; + + if (!defined('_LIB_PHPMYMAILER_LOADED')) + { + include('./lib/mailer.lib.' . C_EXTENSION); + } + $mailHandler = new PHPMYMAILER(C_REG_SENDER, C_REG_EMAIL); + $mailHandler->pmmSendEmail( $recipient, + L_CHARSET, $subject, $body); + if (!$mailHandler->pmmIsSent) + { + $error = sprintf(L_EMAIL_VAL_ERR, C_REG_EMAIL, C_REG_SENDER); + } + unset($mailHandler); + } // end of send new password by e-mail + // Udpates the profile if (!isset($error)) { $slashedPswd = pmcSlashSingleQuotes(str_replace('\\', '\\\\', $password)); ! $latin1 = (L_CHARSET == 'iso-8859-1') ? 1 : 0; ! $showEmail = (isset($showEmail) && $showEmail) ? 1 : 0; if (!isset($gender)) ! { ! $gender = ''; ! } // Gets the ip include('./lib/get_user_infos.lib.' . C_EXTENSION); ! $ip = pmcGetIp(); ! // Updates the profile and the banishment table if required $dbLink->query("UPDATE " . C_REG_TBL . " SET username = '$slashedNick', latin1 = '$latin1', password = '$slashedPswd', firstname='" . pmcSlashSingleQuotes($firstName) . "', lastname = '" . pmcSlashSingleQuotes($lastName) . "', country = '" . pmcSlashSingleQuotes($spokenLang) . "', website = '$webSite', email = '$email', showemail = $showEmail, reg_time = " . time() . ", ip = '$ip', gender = '$gender' WHERE username = '" . pmcSlashSingleQuotes($dbSessionVars['authUsername']) . "'"); + if ($nick != $dbSessionVars['authUsername']) + { + $dbLink->query("UPDATE " . C_BAN_TBL . " SET username = '$slashedNick', latin1 = '$latin1' WHERE username = '" . pmcSlashSingleQuotes($dbSessionVars['authUsername']) . "'"); + } if ($dbSessionVars['authPassword'] != $password) + { $dbSessionVars['authPassword'] = $password; ! } ! $message = L_REG_17; ! $isRegDone = true; } } // end of the updating profile work *************** *** 300,310 **** </td> </tr> <tr> <td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_7); ?> :</td> <td valign="top"> ! <input type="text" name="password" size="11" maxlength="16" value="<?php echo(htmlspecialchars($dbSessionVars['authPassword'])); ?>" /> <?php if (!$isRegDone) echo('<span class="error">*</span>'); ?> </td> </tr> <tr> <td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_30); ?> :</td> --- 339,368 ---- </td> </tr> + <?php + // Do not display the password if e-mail validation is required and the e-mail + // has changed + if (!(C_EMAIL_PASWD && $isRegDone)) + { + ?> <tr> <td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_7); ?> :</td> <td valign="top"> ! <input type="password" name="password" size="11" maxlength="16" value="<?php echo(htmlspecialchars($dbSessionVars['authPassword'])); ?>" /> <?php if (!$isRegDone) echo('<span class="error">*</span>'); ?> </td> </tr> + <?php + } + else + { + echo("\n"); + ?> + <tr> + <td align="center" valign="middle" colspan="2"><i><?php echo(L_EMAIL_VAL_DONE); ?></i></td> + </tr> + <?php + } + echo("\n"); + ?> <tr> <td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_30); ?> :</td> *************** *** 380,387 **** $dbSessionVars['nick'] = $nick; $dbSessionVars['password'] = $password; ! $toUnreg = array('conservative', 'authUsername', 'authPassword'); dbSessionUnregister($toUnreg); - dbSessionSave(); } $dbSessionDbLink->close(); ?> --- 438,449 ---- $dbSessionVars['nick'] = $nick; $dbSessionVars['password'] = $password; ! $toUnreg = array('conservative', 'authUsername', 'authPassword', 'prevEmail'); dbSessionUnregister($toUnreg); } + else + { + $dbSessionVars['prevEmail'] = $email; + } + dbSessionSave(); $dbSessionDbLink->close(); ?> |
From: Lo?c C. <lo...@us...> - 2001-05-23 21:40:34
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib In directory usw-pr-cvs1:/tmp/cvs-serv12109/chat/lib Modified Files: get_user_infos.lib.php3 Log Message: Misc. fixes Index: get_user_infos.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/get_user_infos.lib.php3,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** get_user_infos.lib.php3 2001/05/22 20:40:34 1.1 --- get_user_infos.lib.php3 2001/05/23 21:40:30 1.2 *************** *** 218,223 **** global $dbLink; ! // 1. The user is the administrator or already moderator for the room ! // he/she will enter in if ($regUserPerms == 'admin') { --- 218,222 ---- global $dbLink; ! // 1. The user is the administrator if ($regUserPerms == 'admin') { |
From: Lo?c C. <lo...@us...> - 2001-05-23 21:40:34
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs In directory usw-pr-cvs1:/tmp/cvs-serv12109/chat/lib/index_libs Modified Files: main_index.lib.php3 index_validation.lib.php3 Log Message: Misc. fixes Index: main_index.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs/main_index.lib.php3,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -r1.31 -r1.32 *** main_index.lib.php3 2001/05/22 20:40:34 1.31 --- main_index.lib.php3 2001/05/23 21:40:30 1.32 *************** *** 421,426 **** /** ! * Ensures the user can create the room he wants to, then defines the ! * permission level this user will be granted for this room * * Skipped if the frameset is reloaded. --- 421,425 ---- /** ! * Ensures the user can create the room he wants to * * Skipped if the frameset is reloaded. *************** *** 431,435 **** if ($error == '' && !isset($reloading) && $isCreateRoom) { ! $error = pmcValidateRoomCreation($regUserPerms, $regUserModeratedRooms); } // end of the validation of room creation --- 430,434 ---- if ($error == '' && !isset($reloading) && $isCreateRoom) { ! $error = pmcValidateRoomCreation(); } // end of the validation of room creation *************** *** 437,442 **** /** * Defines the right level the user will be granted for the room he/she ! * will enter in (skipped when the frameset is reloaded because of the NS4+ ! * resize bug). * * The 'pmcSlashSingleQuotes()' function is defined inside the --- 436,440 ---- /** * Defines the right level the user will be granted for the room he/she ! * will enter in. * * The 'pmcSlashSingleQuotes()' function is defined inside the *************** *** 449,453 **** --- 447,456 ---- $status = pmcRightLevel(); } + else + { + $status = $dbSessionVars['status']; + } + /** * Enters the chat *************** *** 600,625 **** else $layoutNick = ''; - - if (!empty($GLOBALS['enterDefaultRoomName'])) - $layoutRoom = $GLOBALS['enterDefaultRoomName']; - else if (!empty($GLOBALS['enterOtherRoomName'])) - $layoutRoom = $GLOBALS['enterOtherRoomName']; - else if (!empty($GLOBALS['createRoomName'])) - $layoutRoom = $GLOBALS['createRoomName']; - else if (dbSessionIsRegistered('currentRoom')) - $layoutRoom = $dbSessionVars['currentRoom']; - else if (isset($GLOBALS['cookieRoom'])) - $layoutRoom = urldecode($GLOBALS['cookieRoom']); - else - $layoutRoom = ''; if (!empty($GLOBALS['createRoomName']) && !empty($GLOBALS['roomType'])) ! $layoutRoomType = $GLOBALS['roomType']; ! else if (dbSessionIsRegistered('roomType')) ! $layoutRoomType = $dbSessionVars['roomType']; ! else if (isset($GLOBALS['cookieRoomType'])) ! $layoutRoomType = $GLOBALS['cookieRoomType']; else ! $layoutRoomType = ''; ?> <center> --- 603,642 ---- else $layoutNick = ''; + // Priority order for rooms: + // 1. 'posted' with + // to be created > 'other' rooms > default public rooms + // 2. grabbed from session data + // 3. gabbed from cookies if (!empty($GLOBALS['createRoomName']) && !empty($GLOBALS['roomType'])) ! { ! $layoutRoomType = $GLOBALS['roomType']; ! $layoutRoom = $GLOBALS['createRoomName']; ! } ! else if (!empty($GLOBALS['enterOtherRoomName'])) ! { ! $layoutRoomType = 1; ! $layoutRoom = $GLOBALS['enterOtherRoomName']; ! } ! else if (!empty($GLOBALS['enterDefaultRoomName'])) ! { ! $layoutRoomType = 1; ! $layoutRoom = $GLOBALS['enterDefaultRoomName']; ! } ! else if (dbSessionIsRegistered('currentRoom') && dbSessionIsRegistered('roomType')) ! { ! $layoutRoomType = $dbSessionVars['roomType']; ! $layoutRoom = $dbSessionVars['currentRoom']; ! } ! else if (isset($GLOBALS['cookieRoom']) && isset($GLOBALS['cookieRoomType'])) ! { ! $layoutRoomType = $GLOBALS['cookieRoomType']; ! $layoutRoom = urldecode($GLOBALS['cookieRoom']); ! } else ! { ! $layoutRoomType = 1; ! $layoutRoom = ''; ! } ?> <center> *************** *** 942,949 **** $dbSessionVars['msgNumber'] = C_MSG_NB; $dbSessionVars['refreshDelay'] = C_MSG_REFRESH; ! // Among the variables to delete, the 'conservative' and the ! // 'savedMessagesLimit' ones may have been set repectively by the 'profile' and ! // the 'save' commands ! $toUnregister = array('password', 'conservative', 'savedMessagesLimit'); dbSessionUnregister($toUnregister); dbSessionSave(); --- 959,964 ---- $dbSessionVars['msgNumber'] = C_MSG_NB; $dbSessionVars['refreshDelay'] = C_MSG_REFRESH; ! // Delete session variables thay may have been set by some other scripts ! $toUnregister = array('password', 'conservative', 'prevEmail', 'savedMessagesLimit'); dbSessionUnregister($toUnregister); dbSessionSave(); Index: index_validation.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs/index_validation.lib.php3,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** index_validation.lib.php3 2001/05/22 20:40:34 1.12 --- index_validation.lib.php3 2001/05/23 21:40:30 1.13 *************** *** 163,169 **** * the user will be granted inside this room * - * @param string permission level associated to the nick - * @param string list of the room moderated by the user - * * @return string error number * --- 163,166 ---- *************** *** 180,184 **** * @access public */ ! function pmcValidateRoomCreation(&$userPerms, &$userModeratedRooms) { global $isJsValidated; --- 177,181 ---- * @access public */ ! function pmcValidateRoomCreation() { global $isJsValidated; |
From: Lo?c C. <lo...@us...> - 2001-05-23 21:40:34
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv12109/chat Modified Files: handle_input.php3 Log Message: Misc. fixes Index: handle_input.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/handle_input.php3,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 |
From: Lo?c C. <lo...@us...> - 2001-05-22 21:15:36
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv6007/chat Modified Files: users_low.php3 users.php3 Log Message: Moving to the start page is no long required to change of room Index: users_low.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/users_low.php3,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** users_low.php3 2001/05/20 18:56:28 1.17 --- users_low.php3 2001/05/22 21:15:34 1.18 *************** *** 277,284 **** $usersCnt = 0; $id = md5($aRoomName); $usersList[] = '<p>'; $usersList[] = "\t" ! . '<a href="' . str_replace('%NEW ROOM%', urlencode($aRoomName), $joinUrl) . '" target="_parent">' . htmlspecialchars($aRoomName) . '</a>' . '<span class="small"><bdo dir="' . $textDirection . '"></bdo> ' . '(%NUM ROWS%)</span><br />'; --- 277,285 ---- $usersCnt = 0; $id = md5($aRoomName); + $jsClickLink = ' onclick="window.parent.pmcRunCmd(\'JOIN\', \'#' . pmcSlashSingleQuotes(pmcSpecialChars($aRoomName, 0), 1) . '\'); return false"'; $usersList[] = '<p>'; $usersList[] = "\t" ! . '<a href="' . str_replace('%NEW ROOM%', urlencode($aRoomName), $joinUrl) . '" target="_parent"' . $jsClickLink . '>' . htmlspecialchars($aRoomName) . '</a>' . '<span class="small"><bdo dir="' . $textDirection . '"></bdo> ' . '(%NUM ROWS%)</span><br />'; *************** *** 364,370 **** } $usersList[] = '<p>'; $usersList[] = "\t" ! . '<a href="' . str_replace('%NEW ROOM%', urlencode($tmpRoom), $joinUrl) . '" target="_parent">' . htmlspecialchars($tmpRoom) . '</a>' . '<span class="small"><bdo dir="' . $textDirection . '"></bdo>' . ' (0)</span>'; --- 365,373 ---- } + $jsClickLink = ' onclick="window.parent.pmcRunCmd(\'JOIN\', \'#' . pmcSlashSingleQuotes(pmcSpecialChars($tmpRoom, 0), 1) . '\'); return false"'; + $usersList[] = '<p>'; $usersList[] = "\t" ! . '<a href="' . str_replace('%NEW ROOM%', urlencode($tmpRoom), $joinUrl) . '" target="_parent"' . $jsClickLink . '>' . htmlspecialchars($tmpRoom) . '</a>' . '<span class="small"><bdo dir="' . $textDirection . '"></bdo>' . ' (0)</span>'; Index: users.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/users.php3,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** users.php3 2001/05/20 18:56:28 1.23 --- users.php3 2001/05/22 21:15:34 1.24 *************** *** 277,280 **** --- 277,281 ---- $usersCnt = 0; $id = md5($aRoomName); + $jsClickLink = ' onclick="window.parent.pmcRunCmd(\'JOIN\', \'#' . pmcSlashSingleQuotes(pmcSpecialChars($aRoomName, 0), 1) . '\'); return false"'; $usersList[] = '<div id="Parent' . $id . '" class="parent" style="margin-top: 10px; cursor: hand">'; *************** *** 282,286 **** . '<img name="imEx" id="imEx' . $id . '" src="images/closed.gif" width="9" height="9" border="0" alt="' . L_EXPCOL . '" /></a>' . ' ' ! . '<a href="' . str_replace('%NEW ROOM%', urlencode($aRoomName), $joinUrl) . '" target="_parent">' . htmlspecialchars($aRoomName) . '</a>' . '<span class="small"><bdo dir="' . $textDirection . '"></bdo> ' . '(%NUM ROWS%)</span>'; --- 283,287 ---- . '<img name="imEx" id="imEx' . $id . '" src="images/closed.gif" width="9" height="9" border="0" alt="' . L_EXPCOL . '" /></a>' . ' ' ! . '<a href="' . str_replace('%NEW ROOM%', urlencode($aRoomName), $joinUrl) . '" target="_parent"' . $jsClickLink . '>' . htmlspecialchars($aRoomName) . '</a>' . '<span class="small"><bdo dir="' . $textDirection . '"></bdo> ' . '(%NUM ROWS%)</span>'; *************** *** 370,376 **** } $usersList[] = '<div id="Parent' . $id . '" class="parent" style="margin-top: 10px; cursor: hand">'; $usersList[] = "\t" ! . '<a href="' . str_replace('%NEW ROOM%', urlencode($tmpRoom), $joinUrl) . '" target="_parent">' . htmlspecialchars($tmpRoom) . '</a>' . '<span class="small"><bdo dir="' . $textDirection . '"></bdo>' . ' (0)</span>'; --- 371,379 ---- } + $jsClickLink = ' onclick="window.parent.pmcRunCmd(\'JOIN\', \'#' . pmcSlashSingleQuotes(pmcSpecialChars($tmpRoom, 0), 1) . '\'); return false"'; + $usersList[] = '<div id="Parent' . $id . '" class="parent" style="margin-top: 10px; cursor: hand">'; $usersList[] = "\t" ! . '<a href="' . str_replace('%NEW ROOM%', urlencode($tmpRoom), $joinUrl) . '" target="_parent"' . $jsClickLink . '>' . htmlspecialchars($tmpRoom) . '</a>' . '<span class="small"><bdo dir="' . $textDirection . '"></bdo>' . ' (0)</span>'; |
From: Lo?c C. <lo...@us...> - 2001-05-22 20:45:29
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv31883/chat Modified Files: handle_input.php3 Log Message: Too many changes to detail... Index: handle_input.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/handle_input.php3,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** handle_input.php3 2001/05/17 19:28:14 1.25 --- handle_input.php3 2001/05/22 20:45:26 1.26 *************** *** 97,102 **** $currentRoomType = $dbSessionVars['roomType']; $slashedCurrentRoomName = pmcSlashSingleQuotes($dbSessionVars['currentRoom']); ! require('./lib/check_and_kick_user.lib.' . C_EXTENSION); pmcCheckAndKickUser(false); /** --- 97,104 ---- $currentRoomType = $dbSessionVars['roomType']; $slashedCurrentRoomName = pmcSlashSingleQuotes($dbSessionVars['currentRoom']); ! include('./lib/check_and_kick_user.lib.' . C_EXTENSION); pmcCheckAndKickUser(false); + dbSessionUnregister('noKickTest'); + /** |
From: Lo?c C. <lo...@us...> - 2001-05-22 20:42:36
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib In directory usw-pr-cvs1:/tmp/cvs-serv31322 Removed Files: get_ip.lib.php3 banish.lib.php3 Log Message: Merge into the 'get_user_infos.lib.php3' library --- get_ip.lib.php3 DELETED --- --- banish.lib.php3 DELETED --- |
From: Lo?c C. <lo...@us...> - 2001-05-22 20:40:37
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv30745/chat Modified Files: profile_reg.php3 profile_edit.php3 Log Message: Too many changes to detail... Index: profile_reg.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/profile_reg.php3,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** profile_reg.php3 2001/05/16 20:55:37 1.12 --- profile_reg.php3 2001/05/22 20:40:34 1.13 *************** *** 170,174 **** // Gets the ip ! include('./lib/get_ip.lib.' . C_EXTENSION); // Defines the password --- 170,175 ---- // Gets the ip ! include('./lib/get_user_infos.lib.' . C_EXTENSION); ! $ip = pmcGetIp(); // Defines the password Index: profile_edit.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/profile_edit.php3,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** profile_edit.php3 2001/05/16 20:55:37 1.9 --- profile_edit.php3 2001/05/22 20:40:34 1.10 *************** *** 181,185 **** // Gets the ip ! include('./lib/get_ip.lib.' . C_EXTENSION); // Updates the profile --- 181,186 ---- // Gets the ip ! include('./lib/get_user_infos.lib.' . C_EXTENSION); ! $ip = pmcGetIp(); // Updates the profile |
From: Lo?c C. <lo...@us...> - 2001-05-22 20:40:37
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib In directory usw-pr-cvs1:/tmp/cvs-serv30745/chat/lib Modified Files: check_and_kick_user.lib.php3 Added Files: get_user_infos.lib.php3 Log Message: Too many changes to detail... --- NEW FILE --- <?php // // +--------------------------------------------------------------------------+ // | phpMyChat version 0.15.0 | // +--------------------------------------------------------------------------+ // | Copyright (c) 2000-2001 The phpHeaven-team | // +--------------------------------------------------------------------------+ // | License: GNU/GPL - http://www.gnu.org/copyleft/gpl.html | // +--------------------------------------------------------------------------+ // | This library contains a set of functions used to get some informations | // | about an user: | // | - pmcGetIp() = get the ip of the user | // | - pmcCheckBanish() = ensure the user is not banished from the | // | room he/she wants to enter in | // | - pmcRightLevel() = get the right level of the user for the | // | room he/she will enter in | // | | // | This script 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 <te...@ph...> | // +--------------------------------------------------------------------------+ // // $Id: get_user_infos.lib.php3,v 1.1 2001/05/22 20:40:34 loic1 Exp $ // // Set of functions and variables used to get some user's informations. // /** * 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. * * @return string the ip of the user * * @access public */ function pmcGetIp() { $toGrab = array('REMOTE_ADDR', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED'); pmcGrabGlobals($toGrab); // The 'main' ip $simpleIp = isset($GLOBALS['REMOTE_ADDR']) ? $GLOBALS['REMOTE_ADDR'] : ''; // Check if the 'main' ip is a proxy one and, in this case, try to get the // true ip // Step 1 $trueIp = isset($GLOBALS['HTTP_X_FORWARDED_FOR']) ? $GLOBALS['HTTP_X_FORWARDED_FOR'] : ''; if ($trueIp == '' && isset($GLOBALS['HTTP_X_FORWARDED'])) $trueIp = $GLOBALS['HTTP_X_FORWARDED']; if ($trueIp == '' && isset($GLOBALS['HTTP_FORWARDED_FOR'])) $trueIp = $GLOBALS['HTTP_FORWARDED_FOR']; if ($trueIp == '' && isset($GLOBALS['HTTP_FORWARDED'])) $trueIp = $GLOBALS['HTTP_FORWARDED']; $isProxy = ($trueIp != '') ? 1 : 0; // Step 2 if (!$isProxy) { $toGrab = array('HTTP_VIA', 'HTTP_X_COMING_FROM', 'HTTP_COMING_FROM'); pmcGrabGlobals($toGrab); $trueIp = isset($GLOBALS['HTTP_VIA']) ? $GLOBALS['HTTP_VIA'] : ''; if ($trueIp == '' && isset($GLOBALS['HTTP_X_COMING_FROM'])) $trueIp = $GLOBALS['HTTP_X_COMING_FROM']; if ($trueIp == '' && isset($GLOBALS['HTTP_COMING_FROM'])) $trueIp = $GLOBALS['HTTP_COMING_FROM']; if ($trueIp != '') $isProxy = 2; } // Step 3 if ($trueIp == $simpleIp) { $isProxy = 0; } unset($toGrab); // Returns the true IP if it has been found, else the proxy IP prefixed // by the 'p' character switch ($isProxy) { case 0: // True IP without proxy return $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 return $regs[0]; } else { // Proxy IP return 'p' . $simpleIp; } break; case 2: // Proxy IP return 'p' . $simpleIp; } // end of switch } // end of the 'pmcIsInto()' function /** * Ensure an user is not banished from the room he/she wants to enter in * * The 'pmcHandleMagicQuotes()' and the 'pmcIsInto()' functions are defined * inside the 'chat/lib/common.lib.php3' library * * @return string the ip of the user * * @global string the slashed nick of the user * @global string the ip of this user * @global string the name of the room this user wants to enter in * @global object the database handler * * @access public */ function pmcCheckBanish() { global $slashedNick; global $ip; global $targetRoom; global $dbLink; // Initialize a variable and clean the banished users table $isBanished = false; $dbLink->query("DELETE FROM " . C_BAN_TBL . " WHERE ban_until < " . time()); // 1. Search by nick $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? $isBanished = ($banishedFromRooms == '*' || pmcIsInto($targetRoom, $banishedFromRooms) >= 0); // If the user is banished, update his/her ip 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 // 2. 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? $isBanished = ($banishedFromRooms == '*' || pmcIsInto($targetRoom, $banishedFromRooms) >= 0); // If the user is banished, add his/her nick to the banished users // table if necessary if ($isBanished) { $dbLink->query("INSERT INTO " . C_BAN_TBL . " (username, latin1, ip, rooms, ban_until) VALUES ('$slashedNick', " . $GLOBALS['latin1'] . ", '$ip', '" . pmcSlashSingleQuotes($banishedFromRooms) . "', '$banUntil')"); } } // end of the case where IP is banished from some rooms else { $dbLink->cleanResults(); } } // end of ip tests return $isBanished; } // end of the 'pmcCheckBanish()' function /** * Get the right level of the user for the room he/she will enter in * * The 'pmcIsInto()' function is defined inside the 'chat/lib/common.lib.php3' * library * * @return string the right level of the user * * @global boolean whether the user is a registered one or not * @global string the global right level of this user * @global string the list of rooms moderated by this user * @global string the slashed nick of the user * @global boolean whether the room has to be trully created or not * @global string the name of the room this user wants to enter in * @global string the slashed name of this room * @global object the database handler * * @access public */ function pmcRightLevel() { global $isRegUser; global $regUserPerms; global $regUserModeratedRooms; global $slashedNick; global $isCreateRoom; global $targetRoom; global $slashedTargetRoomName; global $dbLink; // 1. The user is the administrator or already moderator for the room // he/she will enter in if ($regUserPerms == 'admin') { return 'a'; } // 2. The user is already moderator for the room he/she will enter in else if ($regUserPerms == 'moderator' && pmcIsInto($targetRoom, $regUserModeratedRooms) >= 0) { return 'm'; } // 3. The room has to be created... if ($isCreateRoom) { // 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' $dbLink->query("SELECT COUNT(*) FROM " . C_MSG_TBL . " WHERE room = '$slashedTargetRoomName' AND username NOT LIKE 'SYS %' LIMIT 1"); list($isTrueMsg) = $dbLink->nextRecord(); $regUserPerms = ($isTrueMsg == 0) ? 'moderator' : 'user'; $dbLink->cleanResults(); if (!$isTrueMsg) { $dbLink->query("SELECT COUNT(*) FROM " . C_USR_TBL . " WHERE room = '$slashedTargetRoomName' AND username != '$slashedNick' LIMIT 1"); list($isAnybody) = $dbLink->nextRecord(); $regUserPerms = ($isAnybody == 0) ? 'moderator' : 'user'; $dbLink->cleanResults(); } // end of true new room // The user will be moderator for this room -> update tables if ($regUserPerms == 'moderator') { // 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); $arrayCnt = count($rooms); reset($rooms); for ($i = 0; $i < $arrayCnt; $i++) { if (strcasecmp($targetRoom, $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 = '$slashedTargetRoomName' AND username = '" . pmcSlashSingleQuotes($otherModerator) . "'"); } unset($rooms); } // Update the current user status for the room to be created $regUserModeratedRooms .= (empty($regUserModeratedRooms)) ? $targetRoom : ',' . $targetRoom; $dbLink->query("UPDATE " . C_REG_TBL . " SET perms = 'moderator', rooms = '" . pmcSlashSingleQuotes($regUserModeratedRooms) ."' WHERE username = '$slashedNick'"); return 'm'; } // end of updating tables else { return 'r'; } } // 4. Other cases else { return ($isRegUser) ? 'r' : 'u'; } } // end of the 'pmcRightLevel()' function ?> Index: check_and_kick_user.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/check_and_kick_user.lib.php3,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** check_and_kick_user.lib.php3 2001/04/30 19:43:27 1.14 --- check_and_kick_user.lib.php3 2001/05/22 20:40:34 1.15 *************** *** 117,121 **** { // Gets the IP address ! include('./lib/get_ip.lib.' . C_EXTENSION); $usrQuery = 'INSERT INTO ' . C_USR_TBL . ' ' . '(session_id, u_time, room, username, latin1, status, ip) ' --- 117,122 ---- { // Gets the IP address ! include('./lib/get_user_infos.lib.' . C_EXTENSION); ! $ip = pmcGetIp(); $usrQuery = 'INSERT INTO ' . C_USR_TBL . ' ' . '(session_id, u_time, room, username, latin1, status, ip) ' |
From: Lo?c C. <lo...@us...> - 2001-05-22 20:40:37
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs In directory usw-pr-cvs1:/tmp/cvs-serv30745/chat/lib/index_libs Modified Files: main_index.lib.php3 index_validation.lib.php3 do_enter_db_work.lib.php3 Log Message: Too many changes to detail... Index: main_index.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs/main_index.lib.php3,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** main_index.lib.php3 2001/05/16 20:54:32 1.30 --- main_index.lib.php3 2001/05/22 20:40:34 1.31 *************** *** 94,99 **** C_DB_USER, C_DB_PASS, C_SESS_TBL, ! C_SESS_DEL * 60, ! '' ); dbSessionStart(); --- 94,98 ---- C_DB_USER, C_DB_PASS, C_SESS_TBL, ! C_SESS_DEL * 60 ); dbSessionStart(); *************** *** 208,211 **** --- 207,211 ---- } // end of switch + // Display the message if (isset($messageKind)) { *************** *** 225,237 **** unset($exitedRoomType); } } // end of remove user and possibly put an exit notification /** ! * Prepares reloading (in case a 'join' command has just been submitted or the ! * user clicked on a room name at the message frame or he/she resizes the ! * Netscape 4+ window) */ ! // 'join' command or clicked room name case if (isset($newTargetRoom)) { --- 225,254 ---- unset($exitedRoomType); } + + // Kill the current session if the user has been kicked + if ($dbSessionVars['kicked']) + { + $retSessVar = $dbSessionVars; + dbSessionDestroy(); + dbSessionInit( C_DB_TYPE, + C_DB_HOST, C_DB_NAME, + C_DB_USER, C_DB_PASS, + C_SESS_TBL, + C_SESS_DEL * 60 + ); + dbSessionStart(); + $dbSessionVars['from'] = $retSessVar['from']; + $dbSessionVars['lang'] = $retSessVar['lang']; + $dbSessionVars['nick'] = $retSessVar['nick']; + unset($retSessVar); + } } // end of remove user and possibly put an exit notification /** ! * Prepares reloading (in case the user clicked on a room name at the message ! * frame or he/she resizes the Netscape 4+ window) */ ! // clicked room name case if (isset($newTargetRoom)) { *************** *** 239,244 **** $targetRoom = substr($newTargetRoom, 1); unset($newTargetRoom); ! if (empty($reloading)) ! $reloading = 'joinLink'; $jsVersion = $dbSessionVars['jsVersion']; } --- 256,260 ---- $targetRoom = substr($newTargetRoom, 1); unset($newTargetRoom); ! $reloading = 'joinLink'; $jsVersion = $dbSessionVars['jsVersion']; } *************** *** 271,291 **** } $isRegUser = false; ! $regUserPerms = 'user'; $regUserModeratedRooms = ''; $wasInRoom = ''; ! // If no room has been specified, defines the first room among the default ! // public ones as the room to enter in ! if (isset($submitType) && ! (C_VERSION == 0 || (empty($enterDefaultRoomName) && empty($enterOtherRoomName) && empty($createRoomName)))) ! $enterDefaultRoomName = $defaultChatRooms[0]; /** ! * Gets some more libraries that will be used to validate the settings * submitted */ if (C_NO_SWEAR == 1) include('./' . _CHAT_PATH . 'lib/swearing.lib.' . C_EXTENSION); include('./' . _CHAT_PATH . 'lib/index_libs/index_validation.lib.' . C_EXTENSION); --- 287,349 ---- } $isRegUser = false; ! $regUserPerms = 'noreg'; $regUserModeratedRooms = ''; $wasInRoom = ''; ! $isCreateRoom = false; /** ! * Define the room name and type to check if the starting form has been * submitted + * + * Priority order: room to create > other public room > default public room + */ + if (isset($submitType)) + { + // Room has to be created + if (!empty($createRoomName)) + { + $targetRoom = $createRoomName; + $isCreateRoom = true; + } + // Room is among other public ones + else if (!empty($enterOtherRoomName)) + { + $targetRoom = $enterOtherRoomName; + $roomType = 1; + } + // Room is among other public ones + else if (!empty($enterDefaultRoomName)) + { + $targetRoom = $enterDefaultRoomName; + $roomType = 1; + } + // If no room has been specified, defines the first room among the default + // public ones as the room to enter in + if (C_VERSION == 0 || empty($targetRoom)) + { + $targetRoom = $defaultChatRooms[0]; + $roomType = 1; + } + unset($createRoomName); + unset($enterOtherRoomName); + unset($enterDefaultRoomName); + } + + + /** + * Gets some more libraries that will be used to validate the settings + * submitted and get his/her ip + * + * The 'pmcGetIp()' function is defined inside the + * 'chat/lib/get_user_infos.lib.php3' library. */ if (C_NO_SWEAR == 1) + { include('./' . _CHAT_PATH . 'lib/swearing.lib.' . C_EXTENSION); + } include('./' . _CHAT_PATH . 'lib/index_libs/index_validation.lib.' . C_EXTENSION); + include('./' . _CHAT_PATH . 'lib/get_user_infos.lib.' . C_EXTENSION); + $ip = pmcGetIp(); *************** *** 303,308 **** * * This part of the script is skipped if the frameset is reloaded because ! * of the NS4+ resize bug, because the user has run the '/join' command or ! * because he has clicked on a room name at the 'users' frame. * In these cases, the nick and the password have already been validated. * --- 361,366 ---- * * This part of the script is skipped if the frameset is reloaded because ! * of the NS4+ resize bug or because the user has clicked on a room name at ! * the 'users' frame. * In these cases, the nick and the password have already been validated. * *************** *** 324,340 **** /** ! * Gets the permission level of the user and the list of the rooms he is ! * moderator for if this script is run following a '/join' command or a click ! * on a room name at the 'users' frame. * * The 'pmcHandleMagicQuotes()' function is defined inside the * 'chat/lib/common.lib.php3' library */ ! else if ($reloading == 'joinCmd' || $reloading == 'joinLink') { $dbLink->query("SELECT perms, rooms FROM " . C_REG_TBL . " WHERE username = '$slashedNick' LIMIT 1"); $isRegUser = (list($regUserPerms, $regUserModeratedRooms) = $dbLink->nextRecord()); if ($isRegUser) $regUserModeratedRooms = pmcHandleMagicQuotes($regUserModeratedRooms, '', 1, 'del'); $dbLink->cleanResults(); } // end of get permission level in reloading case --- 382,400 ---- /** ! * Gets the permission level of the user and the list of the rooms he/she ! * is moderator for from the database if this script is run following a ! * click on a room name at the 'users' frame. * * The 'pmcHandleMagicQuotes()' function is defined inside the * 'chat/lib/common.lib.php3' library */ ! else if ($reloading == 'joinLink') { $dbLink->query("SELECT perms, rooms FROM " . C_REG_TBL . " WHERE username = '$slashedNick' LIMIT 1"); $isRegUser = (list($regUserPerms, $regUserModeratedRooms) = $dbLink->nextRecord()); if ($isRegUser) + { $regUserModeratedRooms = pmcHandleMagicQuotes($regUserModeratedRooms, '', 1, 'del'); + } $dbLink->cleanResults(); } // end of get permission level in reloading case *************** *** 345,360 **** * * This part of the script is skipped if the frameset is reloaded because ! * of the NS4+ resize bug, because the user has run the '/join' command or ! * because he has clicked on a room name at the 'users' frame. ! * In these cases, banishement of the user has already been checked. */ if ($error == '' && (empty($reloading) || $reloading == 'joinLink')) { ! if (C_BANISH && $regUserPerms != 'admin') { ! include('./' . _CHAT_PATH . 'lib/banish.lib.' . C_EXTENSION); ! if ($isBanished) ! $error = L_ERR_USR_20; } } // end of the banishment test --- 405,419 ---- * * This part of the script is skipped if the frameset is reloaded because ! * of the NS4+ resize bug. ! * ! * The 'pmcCheckBanish()' function is defined inside the ! * 'chat/lib/get_user_infos.lib.php3' library. */ if ($error == '' && (empty($reloading) || $reloading == 'joinLink')) { ! if (C_BANISH && $regUserPerms != 'admin' && pmcCheckBanish()) { ! $error = L_ERR_USR_20; } } // end of the banishment test *************** *** 365,376 **** * permission level this user will be granted for this room * * The function 'pmcValidateRoomCreation()' is defined inside the ! * 'chat/lib/index_validation.lib.php3' library */ ! if ($error == '' && !empty($createRoomName)) { $error = pmcValidateRoomCreation($regUserPerms, $regUserModeratedRooms); } // end of the validation of room creation /** --- 424,452 ---- * permission level this user will be granted for this room * + * Skipped if the frameset is reloaded. + * * The function 'pmcValidateRoomCreation()' is defined inside the ! * 'chat/lib/index_validation.lib.php3' library. */ ! if ($error == '' && !isset($reloading) && $isCreateRoom) { $error = pmcValidateRoomCreation($regUserPerms, $regUserModeratedRooms); } // end of the validation of room creation + + /** + * Defines the right level the user will be granted for the room he/she + * will enter in (skipped when the frameset is reloaded because of the NS4+ + * resize bug). + * + * The 'pmcSlashSingleQuotes()' function is defined inside the + * 'chat/lib/common.lib.php3' library and the 'pmcRightLevel()' one inside + * the 'chat/lib/get_user_infos.lib.php3' library. + */ + $slashedTargetRoomName = pmcSlashSingleQuotes($targetRoom); + if (!isset($reloading) || $reloading != 'nsResize') + { + $status = pmcRightLevel(); + } /** Index: index_validation.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs/index_validation.lib.php3,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** index_validation.lib.php3 2001/05/21 19:21:32 1.11 --- index_validation.lib.php3 2001/05/22 20:40:34 1.12 *************** *** 70,74 **** if (!$isJsValidated && $nick == '') { ! $error1 = L_ERR_USR_2; } // Checks for invalid characters or empty nick --- 70,74 ---- if (!$isJsValidated && $nick == '') { ! $error1 = L_ERR_USR_2; } // Checks for invalid characters or empty nick *************** *** 76,80 **** (trim($nick) == '' || ereg('[\, ]', $nick))) { ! $error1 = L_ERR_USR_16; } // Checks for swear words in the nick --- 76,80 ---- (trim($nick) == '' || ereg('[\, ]', $nick))) { ! $error1 = L_ERR_USR_16; } // Checks for swear words in the nick *************** *** 82,86 **** { if (checkWords($nick, true)) ! $error1 = L_ERR_USR_18; } // end of the 1st stage (character validation inside the nick) --- 82,88 ---- { if (checkWords($nick, true)) ! { ! $error1 = L_ERR_USR_18; ! } } // end of the 1st stage (character validation inside the nick) *************** *** 94,99 **** if ($isLoggedIn) { ! $loggedInRoom = pmcHandleMagicQuotes($loggedInRoom, '', 1, 'del'); ! $requireReg = true; } } --- 96,101 ---- if ($isLoggedIn) { ! $loggedInRoom = pmcHandleMagicQuotes($loggedInRoom, '', 1, 'del'); ! $requireReg = true; } } *************** *** 105,109 **** { if ($password == '') ! $error1 = ($isLoggedIn) ? L_ERR_USR_1 : L_ERR_USR_14; } // end of the 3rd stage (a password has been submitted if required) --- 107,113 ---- { if ($password == '') ! { ! $error1 = ($isLoggedIn) ? L_ERR_USR_1 : L_ERR_USR_14; ! } } // end of the 3rd stage (a password has been submitted if required) *************** *** 168,171 **** --- 172,176 ---- * @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 boolean whether the room has to be trully created or not * @global string the name of the room to create * @global integer the type of the room to create *************** *** 181,343 **** global $slashedNick; global $isRegUser; ! global $createRoomName, $roomType; global $defaultChatRooms, $defaultPrivateRooms; ! $error2 = ''; ! $isNewRoom = true; ! // 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 (!$isJsValidated && ! (trim($createRoomName) == '' || ereg('[\,]', $createRoomName))) ! { ! $error2 = L_ERR_ROM_1; ! } ! // Checks for swear words in the room name ! else if (C_NO_SWEAR && checkWords($createRoomName, true)) { ! $error2 = L_ERR_ROM_2; } - // Ensures there is no existing room with the same name but a different - // type and if this condition is true get case sensitive name of room... else { ! $theSlashedRoomName = pmcSlashSingleQuotes($createRoomName); ! ! // ...among reserved name for private/public (default) rooms ! $searchIn = ($roomType == 1) ? $defaultPrivateRooms : $defaultChatRooms; ! if (pmcIsInto($createRoomName, $searchIn) >= 0) ! { ! $error2 = ($roomType == 0) ? L_ERR_ROM_3 : L_ERR_ROM_4; ! } ! else ! { ! $searchIn = ($roomType == 1) ? $defaultChatRooms : $defaultPrivateRooms; ! $roomExist = pmcIsInto($createRoomName, $searchIn); ! if ($roomExist >= 0) ! { ! $isNewRoom = false; ! if ($roomType == 1) ! { ! $GLOBALS['enterDefaultRoomName'] = $searchIn[$roomExist]; ! $createRoomName = ''; ! } ! else ! { ! $createRoomName = $searchIn[$roomExist]; ! } ! } ! } ! unset($searchIn); ! ! // ...among other rooms created by users ! if ($error2 == '' && $isNewRoom) { ! $dbLink->query("SELECT type, room FROM " . C_MSG_TBL . " WHERE room = '$theSlashedRoomName' LIMIT 1"); ! $roomExist = (list($trueType, $trueCaseName) = $dbLink->nextRecord()); ! $dbLink->cleanResults(); ! if ($roomExist) ! { ! if ($roomType != $trueType) ! $error2 = ($roomType == 0) ? L_ERR_ROM_3 : L_ERR_ROM_4; ! else ! $createRoomName = pmcHandleMagicQuotes($trueCaseName, '', 1, 'del'); ! } } } ! } ! // 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. ! // Skipped for administrator and if the room to "create" is among ! // default public ones. ! if ($error2 == '' && $isNewRoom && $userPerms != 'admin') ! { ! // 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' ! $dbLink->query("SELECT COUNT(*) FROM " . C_MSG_TBL . " WHERE room = '$theSlashedRoomName' 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 = '$theSlashedRoomName' 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 ! // (skipped for administrator and if the room to create is not a true new ! // one) ! if ($error2 == '' && $isNewRoom && $userPerms != 'admin') ! { ! // 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); ! $arrayCnt = count($rooms); ! reset($rooms); ! for ($i = 0; $i < $arrayCnt; $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 = '$theSlashedRoomName' 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) - { - $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; --- 186,253 ---- global $slashedNick; global $isRegUser; ! global $isCreateRoom; ! global $targetRoom, $roomType; global $defaultChatRooms, $defaultPrivateRooms; ! $error2 = ''; ! // User is not registered -> deny room creation ! if (!$isRegUser) { ! $error2 = L_ERR_USR_13; ! } ! // Checks for invalid characters or empty room name ! else if (!$isJsValidated ! && (trim($targetRoom) == '' || ereg('[\,]', $targetRoom))) ! { ! $error2 = L_ERR_ROM_1; ! } ! // Checks for swear words in the room name ! else if (C_NO_SWEAR && checkWords($targetRoom, true)) ! { ! $error2 = L_ERR_ROM_2; ! } ! // Ensures there is no existing room with the same name but a different ! // type and if this condition is true get case sensitive name of room... ! else ! { ! // ...among reserved name for private/public (default) rooms ! $searchIn = ($roomType == 1) ? $defaultPrivateRooms : $defaultChatRooms; ! if (pmcIsInto($targetRoom, $searchIn) >= 0) { ! $error2 = ($roomType == 0) ? L_ERR_ROM_3 : L_ERR_ROM_4; } else { ! $searchIn = ($roomType == 1) ? $defaultChatRooms : $defaultPrivateRooms; ! $roomExist = pmcIsInto($targetRoom, $searchIn); ! if ($roomExist >= 0) { ! $isCreateRoom = false; ! $targetRoom = $searchIn[$roomExist]; } } ! unset($searchIn); ! // ...among other rooms created by users ! if ($error2 == '' && $isCreateRoom) { ! $theSlashedRoomName = pmcSlashSingleQuotes($targetRoom); ! $dbLink->query("SELECT type, room FROM " . C_MSG_TBL . " WHERE room = '$theSlashedRoomName' LIMIT 1"); ! $roomExist = (list($trueType, $trueCaseName) = $dbLink->nextRecord()); $dbLink->cleanResults(); ! if ($roomExist) { ! if ($roomType != $trueType) { ! $error2 = ($roomType == 0) ? L_ERR_ROM_3 : L_ERR_ROM_4; } + else + { + $targetRoom = pmcHandleMagicQuotes($trueCaseName, '', 1, 'del'); + } } } } return $error2; Index: do_enter_db_work.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs/do_enter_db_work.lib.php3,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** do_enter_db_work.lib.php3 2001/05/16 20:55:37 1.16 --- do_enter_db_work.lib.php3 2001/05/22 20:40:34 1.17 *************** *** 31,50 **** /** - * 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 */ --- 31,34 ---- *************** *** 53,56 **** --- 37,41 ---- setcookie('cookieRoomType', $roomType, time() + 60*60*24*365); + /** * Gets some variables values from session data or cookies *************** *** 86,124 **** /** - * Gets the ip of the user - */ - if (empty($ip)) - include('./' . _CHAT_PATH .'lib/get_ip.lib.' . C_EXTENSION); - - - /** - * Defines the user status to be put in the users table (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 more variables including the welcome message. */ --- 71,74 ---- *************** *** 140,144 **** --- 90,96 ---- */ if ($isRegUser) + { $dbLink->query("UPDATE " . C_REG_TBL . " SET reg_time = $currentTime, ip = '$ip' WHERE username = '$slashedNick'"); + } *************** *** 149,153 **** --- 101,107 ---- // this "other" session if (!empty($previousId) && $dbSessionId != $previousId) + { $dbLink->query("DELETE FROM " . C_SESS_TBL . " WHERE session_id = '$previousId'"); + } *************** *** 168,190 **** else { ! $slashedRoomName = pmcSlashSingleQuotes($wasInRoom); ! $dbLink->query("SELECT type FROM " . C_MSG_TBL . " WHERE room = '$slashedRoomName' LIMIT 1"); ! list($type) = $dbLink->nextRecord(); $dbLink->cleanResults(); $aQuery = 'INSERT INTO ' . C_MSG_TBL . ' ' . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) ' . 'VALUES (' ! . "$roomType, '$slashedRoomName', 'SYS exit', '', $currentTime, NULL, '#666699', 'sprintf(L_EXIT_ROM, \'$nickForNotifications\')', 'sprintf(L_EXIT_ROM, \'$nickForNotifications\')'" . ')'; $dbLink->query($aQuery); - $slashedRoomName = pmcSlashSingleQuotes($targetRoom); $aQuery = 'INSERT INTO ' . C_MSG_TBL . ' ' . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) ' . 'VALUES (' ! . "$roomType, '$slashedRoomName', 'SYS enter', '', $currentTime, NULL, '#666699', 'sprintf(L_ENTER_ROM, \'$nickForNotifications\')', 'sprintf(L_ENTER_ROM, \'$nickForNotifications\')'" . ')'; $dbLink->query($aQuery); ! $dbLink->query("UPDATE " . C_USR_TBL . " SET session_id = '$dbSessionId', u_time = $currentTime, room = '$slashedRoomName', status = '$status', ip = '$ip' WHERE session_id = '$previousId'"); if (C_WELCOME) --- 122,143 ---- else { ! $slashedPrevRoomName = pmcSlashSingleQuotes($wasInRoom); ! $dbLink->query("SELECT type FROM " . C_MSG_TBL . " WHERE room = '$slashedPrevRoomName' LIMIT 1"); ! list($prevRoomType) = $dbLink->nextRecord(); $dbLink->cleanResults(); $aQuery = 'INSERT INTO ' . C_MSG_TBL . ' ' . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) ' . 'VALUES (' ! . "$prevRoomType, '$slashedPrevRoomName', 'SYS exit', '', $currentTime, NULL, '#666699', 'sprintf(L_EXIT_ROM, \'$nickForNotifications\')', 'sprintf(L_EXIT_ROM, \'$nickForNotifications\')'" . ')'; $dbLink->query($aQuery); $aQuery = 'INSERT INTO ' . C_MSG_TBL . ' ' . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) ' . 'VALUES (' ! . "$roomType, '$slashedTargetRoomName', 'SYS enter', '', $currentTime, NULL, '#666699', 'sprintf(L_ENTER_ROM, \'$nickForNotifications\')', 'sprintf(L_ENTER_ROM, \'$nickForNotifications\')'" . ')'; $dbLink->query($aQuery); ! $dbLink->query("UPDATE " . C_USR_TBL . " SET session_id = '$dbSessionId', u_time = $currentTime, room = '$slashedTargetRoomName', status = '$status', ip = '$ip' WHERE session_id = '$previousId'"); if (C_WELCOME) *************** *** 195,199 **** . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) ' . 'VALUES (' ! . "$roomType, '$slashedRoomName', 'SYS welcome', '', $currentTimePlus, '$slashedNick', '#666699', '$slashedWelcomeMsg', '$slashedWelcomeMsg'" . ')'; $dbLink->query($aQuery); --- 148,152 ---- . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) ' . 'VALUES (' ! . "$roomType, '$slashedTargetRoomName', 'SYS welcome', '', $currentTimePlus, '$slashedNick', '#666699', '$slashedWelcomeMsg', '$slashedWelcomeMsg'" . ')'; $dbLink->query($aQuery); *************** *** 207,212 **** else if (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 --- 160,164 ---- else if (isset($reloading) && $reloading == 'nsResize') { ! $dbLink->query("UPDATE " . C_USR_TBL . " SET u_time = $currentTime, ip = '$ip' WHERE session_id = '$dbSessionId'"); } // end of case where an is relogged because of NS4+ resize bug *************** *** 217,238 **** else { ! $slashedRoomName = pmcSlashSingleQuotes($targetRoom); ! if (isset($reloading) && $reloading == 'joinCmd') ! { ! $dbLink->query("UPDATE " . C_USR_TBL . " SET u_time = $currentTime, room = '$slashedRoomName', status = '$status', ip = '$ip' WHERE session_id = '$dbSessionId'"); ! } ! else ! { ! $aQuery = 'INSERT INTO ' . C_USR_TBL . ' ' ! . '(session_id, u_time, room, username, latin1, status, ip) ' ! . 'VALUES (' ! . "'$dbSessionId', $currentTime, '$slashedRoomName', '$slashedNick', $latin1, '$status', '$ip'" ! . ')'; ! $dbLink->query($aQuery); ! } $aQuery = 'INSERT INTO ' . C_MSG_TBL . ' ' . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) ' . 'VALUES (' ! . "$roomType, '$slashedRoomName', 'SYS enter', '', $currentTime, NULL, '#666699', 'sprintf(L_ENTER_ROM, \'$nickForNotifications\')', 'sprintf(L_ENTER_ROM, \'$nickForNotifications\')'" . ')'; $dbLink->query($aQuery); --- 169,183 ---- else { ! $aQuery = 'INSERT INTO ' . C_USR_TBL . ' ' ! . '(session_id, u_time, room, username, latin1, status, ip) ' ! . 'VALUES (' ! . "'$dbSessionId', $currentTime, '$slashedTargetRoomName', '$slashedNick', $latin1, '$status', '$ip'" ! . ')'; ! $dbLink->query($aQuery); ! $aQuery = 'INSERT INTO ' . C_MSG_TBL . ' ' . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) ' . 'VALUES (' ! . "$roomType, '$slashedTargetRoomName', 'SYS enter', '', $currentTime, NULL, '#666699', 'sprintf(L_ENTER_ROM, \'$nickForNotifications\')', 'sprintf(L_ENTER_ROM, \'$nickForNotifications\')'" . ')'; $dbLink->query($aQuery); *************** *** 245,249 **** . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) ' . 'VALUES (' ! . "$roomType, '$slashedRoomName', 'SYS welcome', '', $currentTimePlus, '$slashedNick', '#666699', '$slashedWelcomeMsg', '$slashedWelcomeMsg'" . ')'; $dbLink->query($aQuery); --- 190,194 ---- . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) ' . 'VALUES (' ! . "$roomType, '$slashedTargetRoomName', 'SYS welcome', '', $currentTimePlus, '$slashedNick', '#666699', '$slashedWelcomeMsg', '$slashedWelcomeMsg'" . ')'; $dbLink->query($aQuery); *************** *** 296,302 **** * Deletes invite messages sent to the user for the room he will enter in */ ! if (!isset($slashedRoomName)) ! $slashedRoomName = pmcSlashSingleQuotes($targetRoom); ! $dbLink->query("SELECT m_time FROM " . C_MSG_TBL . " WHERE username = 'SYS inviteTo' AND address = '$slashedNick' AND room = '$slashedRoomName'"); while (list($sentTime) = $dbLink->nextRecord()) { --- 241,245 ---- * 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 = '$slashedTargetRoomName'"); while (list($sentTime) = $dbLink->nextRecord()) { |
From: Lo?c C. <lo...@us...> - 2001-05-22 20:40:37
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands In directory usw-pr-cvs1:/tmp/cvs-serv30745/chat/lib/commands Modified Files: join.cmd.php3 Log Message: Too many changes to detail... Index: join.cmd.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands/join.cmd.php3,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** join.cmd.php3 2001/04/19 21:05:04 1.4 --- join.cmd.php3 2001/05/22 20:40:34 1.5 *************** *** 32,39 **** */ if (C_NO_SWEAR == 1) include('./lib/swearing.lib.' . C_EXTENSION); ! $targetRoomType = ($cmd[2] != '') ? $cmd[2] : 1; ! $targetRoom = $cmd[3]; ! $slashedTarget = pmcSlashSingleQuotes($cmd[3]); --- 32,41 ---- */ if (C_NO_SWEAR == 1) + { include('./lib/swearing.lib.' . C_EXTENSION); ! } ! $targetRoomType = ($cmd[2] != '') ? $cmd[2] : 1; ! $targetRoom = $cmd[3]; ! $slashedTargetRoomName = pmcSlashSingleQuotes($cmd[3]); *************** *** 47,54 **** if (C_VERSION == 1) { ! if (pmcIsInto($targetRoom, $defaultChatRooms) >= 0) ! $isCommand = true; ! else $error = L_ERR_USR_17; } --- 49,56 ---- if (C_VERSION == 1) { ! if (pmcIsInto($targetRoom, $defaultChatRooms) < 0) ! { $error = L_ERR_USR_17; + } } *************** *** 70,121 **** $error = L_ERR_ROM_2; } ! // Ensure there is no existing room with the same name but a different type ! // among reserved name for private/public (default) rooms else { $toCheck = ($targetRoomType == 1) ? $defaultPrivateRooms : $defaultChatRooms; if (pmcIsInto($targetRoom, $toCheck) >= 0) ! $error = ($targetRoomType == 0) ? L_ERR_ROM_3 : L_ERR_ROM_4; ! else ! $isCommand = true; unset($toCheck); } /** ! * If the target room has valid name and type, do the work * ! * The 'pmcIsInto()' function is defined in the 'chat/lib/common.lib.php3' ! * library */ ! if ($isCommand) { ! $found = false; ! // Get the case sensitive name of the target room ! // 1. Among default rooms ! $toCheck = ($targetRoomType == 1) ? $defaultChatRooms : $defaultPrivateRooms; ! $pos = pmcIsInto($targetRoom, $toCheck); if ($pos >= 0) { ! $targetRoom = $toCheck[$pos]; ! $found = true; } unset($toCheck); ! // 2. Among other existing rooms with the same type ! if (!$found) { ! $dbLink->query("SELECT type, room FROM " . C_MSG_TBL . " WHERE room = '$slashedTarget' LIMIT 1"); ! $roomExist = (list($trueTargetType, $trueTargetName) = $dbLink->nextRecord()); ! if ($roomExist && $targetRoomType == $trueTargetType) ! { ! $targetRoom = pmcHandleMagicQuotes($trueTargetName, '', 1, 'del'); ! $found = true; ! } ! $dbLink->cleanResults(); } ! // Room should be created ! // 1. ensure the user is registered if (!$found || $targetRoomType == 0) { --- 72,128 ---- $error = L_ERR_ROM_2; } ! // Ensure there is no existing room with the same name but a different type... else { + // ...neither among reserved name for private/public (default) rooms $toCheck = ($targetRoomType == 1) ? $defaultPrivateRooms : $defaultChatRooms; if (pmcIsInto($targetRoom, $toCheck) >= 0) ! { ! $error = ($targetRoomType == 0) ? L_ERR_ROM_3 : L_ERR_ROM_4; ! } unset($toCheck); + // ...neither among other rooms created by users + $dbLink->query("SELECT type, room FROM " . C_MSG_TBL . " WHERE room = '$slashedTargetRoomName' LIMIT 1"); + $roomExist = (list($trueTargetType, $trueTargetName) = $dbLink->nextRecord()); + if ($roomExist && $targetRoomType != $trueTargetType) + { + $error = ($targetRoomType == 0) ? L_ERR_ROM_3 : L_ERR_ROM_4; + } + $dbLink->cleanResults(); } /** ! * If the target room has valid name and type -> ensure the user is allowed to ! * enter in and prepare the work * ! * The 'pmcIsInto()' and the 'pmcHandleMagicQuotes()' functions are defined in ! * the 'chat/lib/common.lib.php3' library */ ! if (empty($error)) { ! $found = false; ! $isCreateRoom = false; ! // 1. Get the case sensitive name of the target room ! // 1.1 Among default rooms ! $toCheck = ($targetRoomType == 1) ? $defaultChatRooms : $defaultPrivateRooms; ! $pos = pmcIsInto($targetRoom, $toCheck); if ($pos >= 0) { ! $targetRoom = $toCheck[$pos]; ! $slashedTargetRoomName = pmcSlashSingleQuotes($targetRoom); ! $found = true; } unset($toCheck); ! // 1.2 Among other existing rooms with the same type ! if (!$found && $roomExist) { ! $targetRoom = pmcHandleMagicQuotes($trueTargetName, '', 1, 'del'); ! $slashedTargetRoomName = pmcSlashSingleQuotes($targetRoom); ! $found = true; } ! // 2. Room should be created, ensure the user is registered if (!$found || $targetRoomType == 0) { *************** *** 125,174 **** && $dbSessionVars['status'] != 'r') { ! $error = L_ERR_USR_13; ! $found = false; } ! } ! // 2. ensure there is no existing room with the same name but a different ! // type among rooms created by users ! if (!$found && $roomExist && empty($error)) ! { ! $error = ($targetRoomType == 0) ? L_ERR_ROM_3 : L_ERR_ROM_4; ! } ! else if (empty($error)) ! { ! $found = true; } ! // Ensure the user is not banished from the room he wants to enter in ! if ($found && C_BANISH && $dbSessionVars['status'] != 'a') { ! $enterOtherRoomName = $targetRoom; ! include('./lib/banish.lib.' . C_EXTENSION); ! if ($isBanished) { ! $found = false; ! $error = L_ERR_USR_20; } ! unset($enterOtherRoomName); } ! // If the room can't be created ! if (!$found) ! { ! $isCommand = false; ! } ! // Log into the new room ! else ! { ! $exitUrl = $dbSessionVars['from'] ! . '?' . dbSessionSID('GET') ! . $pmcQueryArgSeparator . 'exitMessage=1' ! . $pmcQueryArgSeparator . 'reloading=joinCmd' ! . $pmcQueryArgSeparator . 'newTargetRoom=' . $targetRoomType . urlencode($targetRoom); ! $dbLink->close(); ! include('./lib/move_to_start.lib.' . C_EXTENSION); ! exit(); } } ?> --- 132,245 ---- && $dbSessionVars['status'] != 'r') { ! $error = L_ERR_USR_13; ! $found = false; } ! else ! { ! $found = true; ! $isCreateRoom = true; ! } } ! // 3. Ensure the user is not banished from the room he wants to enter in ! if (empty($error) && C_BANISH && $dbSessionVars['status'] != 'a') { ! if (!function_exists('pmcCheckBanish')) { ! include('./lib/get_user_infos.lib.' . C_EXTENSION); } ! $ip = pmcGetIp(); ! if (pmcCheckBanish()) ! { ! $error = L_ERR_USR_20; ! } } ! // 4. Define the right level the user will be granted in the room he/she is ! // going to enter in ! if (empty($error)) ! { ! $regUserPerms = ($dbSessionVars['status'] == 'a') ? 'admin' : 'noreg'; ! $regUserModeratedRooms = ''; ! // Get data from the registered users table if required ! if ($regUserPerms != 'admin') ! { ! $dbLink->query("SELECT perms, rooms FROM " . C_REG_TBL . " WHERE username = '$slashedNick' LIMIT 1"); ! $isRegUser = (list($regUserPerms, $regUserModeratedRooms) = $dbLink->nextRecord()); ! if ($isRegUser) ! { ! $regUserModeratedRooms = pmcHandleMagicQuotes($regUserModeratedRooms, '', 1, 'del'); ! } ! $dbLink->cleanResults(); ! } ! if (!function_exists('pmcRightLevel')) ! { ! include('./lib/get_user_infos.lib.' . C_EXTENSION); ! } ! $status = pmcRightLevel(); } } + + + /** + * All validation tests have been successfully passed -> do the work + * + * The 'pmcIsInto()' function is defined in the 'chat/lib/common.lib.php3' + * library + */ + if (empty($error)) + { + $isCommand = true; + $currentTime = time(); + $nickForNotifications = pmcSlashSingleQuotes(pmcSpecialChars($slashedNick, $latin1), 2); + + // Update cookies + $cookieRoom = urlencode($targetRoom); + setcookie('cookieRoom', $cookieRoom, time() + 60*60*24*365); + setcookie('cookieRoomType', $targetRoomType, time() + 60*60*24*365); + + // Update tables + $queries[] = 'UPDATE ' . C_USR_TBL . ' ' + . "SET u_time = $currentTime , room = '$slashedTargetRoomName', status = '$status' " + . "WHERE session_id = '$dbSessionId'"; + $queries[] = 'INSERT INTO ' . C_MSG_TBL . ' ' + . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) ' + . 'VALUES ' + . "($currentRoomType, '$slashedCurrentRoomName', 'SYS exit', '', $currentTime, NULL, '#666699', 'sprintf(L_EXIT_ROM, \'$nickForNotifications\')', 'sprintf(L_EXIT_ROM, \'$nickForNotifications\')')"; + $queries[] = 'INSERT INTO ' . C_MSG_TBL . ' ' + . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) ' + . 'VALUES ' + . "($targetRoomType, '$slashedTargetRoomName', 'SYS enter', '', $currentTime, NULL, '#666699', 'sprintf(L_ENTER_ROM, \'$nickForNotifications\')', 'sprintf(L_ENTER_ROM, \'$nickForNotifications\')')"; + if (C_WELCOME) + { + // ensures the welcome msg is the last one + $currentTimePlus = $currentTime + 1; + // Insert a new welcome message in the messages table + include('./lib/welcome.lib.' . C_EXTENSION); + $slashedWelcomeMsg = pmcSlashSingleQuotes(WELCOME_MSG); + // Delete the old welcome messages sent to the current user + $queries[] = 'DELETE FROM ' . C_MSG_TBL . ' ' + . 'WHERE username = \'SYS welcome\' AND address = \'' . $slashedNick . '\''; + $queries[] = 'INSERT INTO ' . C_MSG_TBL . ' ' + . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) ' + . 'VALUES ' + . "($targetRoomType, '$slashedTargetRoomName', 'SYS welcome', '', $currentTimePlus, '$slashedNick', '#666699', '$slashedWelcomeMsg', '$slashedWelcomeMsg')"; + } + $queriesCnt = count($queries); + reset($queries); + for ($i = 0; $i < $queriesCnt; $i++) + { + $dbLink->query($queries[$i]); + } + + // Update session data and enforce a complete refresh of the + // 'users' and the 'messages' frames + $dbSessionVars['roomType'] = $targetRoomType; + $dbSessionVars['currentRoom'] = $targetRoom; + $dbSessionVars['status'] = $status; + $dbSessionVars['noKickTest'] = true; + $enforceFirstLoad = 1; + $doRefreshMessages = true; + } // end of 'do the work' ?> |
From: Lo?c C. <lo...@us...> - 2001-05-21 19:30:07
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/docs In directory usw-pr-cvs1:/tmp/cvs-serv24905/docs Modified Files: credits.txt Log Message: Updated german translation by Torsten Klein Index: credits.txt =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/docs/credits.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** credits.txt 2001/05/04 16:27:29 1.2 --- credits.txt 2001/05/21 19:30:04 1.3 *************** *** 53,59 **** French-Canadian : Guylhem Aznar <gu...@me...> Georgian : George Gongadze <web...@ge...> ! German : Bernard Piller <be...@bm...>, Silke Oettle <si...@be...>, ! Martin Sander <Mar...@to...>, Robert Schaller <ro...@sc...>, ! Wolfgang Schneider <sch...@bi...>, Michael Schoening <m.s...@ti...> Greek : Nikos Kyriakidis <nik...@ho...> Icelandic : Andri Óskarsson <an...@bo...> --- 53,60 ---- French-Canadian : Guylhem Aznar <gu...@me...> Georgian : George Gongadze <web...@ge...> ! German : Bernard Piller <be...@bm...>, Torsten Klein <tor...@be...>, ! Silke Oettle <si...@be...>, Martin Sander <Mar...@to...>, ! Robert Schaller <ro...@sc...>, Wolfgang Schneider <sch...@bi...>, ! Michael Schoening <m.s...@ti...> Greek : Nikos Kyriakidis <nik...@ho...> Icelandic : Andri Óskarsson <an...@bo...> |
From: Lo?c C. <lo...@us...> - 2001-05-21 19:30:06
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/german In directory usw-pr-cvs1:/tmp/cvs-serv24905/chat/localization/german Modified Files: chat.loc Log Message: Updated german translation by Torsten Klein Index: chat.loc =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/localization/german/chat.loc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** chat.loc 2001/05/16 20:52:56 1.8 --- chat.loc 2001/05/21 19:30:04 1.9 *************** *** 14,17 **** --- 14,18 ---- // | | // | Authors: Reinhard Hofmann <e96...@st...> | + // | Torsten Klein <tor...@be...> | // | Silke Oettle <si...@be...> | // | Bernard Piller <be...@bm...> | *************** *** 102,107 **** define('L_REG_46', 'männlich'); define('L_REG_47', 'weiblich'); ! define('L_REG_48', 'Password reminder'); ! define('L_REG_49', 'No user registered this nick!'); // e-mail validation stuff --- 103,108 ---- define('L_REG_46', 'männlich'); define('L_REG_47', 'weiblich'); ! define('L_REG_48', 'Passwort vergessen'); ! define('L_REG_49', 'Kein User hat diesen Nick registriert!'); // e-mail validation stuff *************** *** 155,159 **** define('L_BEEP', 'Piep/Kein Piep bei Benutzer-Eintritt'); define('L_PROFILE', 'Profil anzeigen'); ! define('L_NO_PROFILE', 'No profile'); // input frame --- 156,160 ---- define('L_BEEP', 'Piep/Kein Piep bei Benutzer-Eintritt'); define('L_PROFILE', 'Profil anzeigen'); ! define('L_NO_PROFILE', 'Kein Profil'); // input frame *************** *** 212,222 **** define('L_HELP_CMD_19', 'Erlaubt den Moderatoren/Administrator einen Benutzer für eine vom Administrator bestimmte Zeit aus dem Raum zu "verbannen".<br />Der Administrator kann auch Benutzer anderer Räume verbannen und die Einstellung "<b> * </b>" verwenden um Benutzer "für immer" aus dem gesamten Chat zu verbannen.'); define('L_HELP_CMD_20', 'Beschreiben, was du grade tust, ohne Dich selbst zu erwähnen.'); ! define('L_HELP_CMD_21', 'Enable/disable graphical smilies mode.'); // smilies popup define('L_SMIL_TIT', 'Smilies'); ! define('L_SMIL_MAX', 'The <b>maximum number</b> of graphical smilies per message is <b>%s</b>.'); ! define('L_SMIL_CLICK', 'You can click on a smiley to insert the related text code inside your message.'); ! define('L_SMIL_MINE', 'If you are a registered user and if the administrator had defined a personnal smiley for you, you may insert the later in your message with the code \' :mine: \'.'); // messages frame --- 213,223 ---- define('L_HELP_CMD_19', 'Erlaubt den Moderatoren/Administrator einen Benutzer für eine vom Administrator bestimmte Zeit aus dem Raum zu "verbannen".<br />Der Administrator kann auch Benutzer anderer Räume verbannen und die Einstellung "<b> * </b>" verwenden um Benutzer "für immer" aus dem gesamten Chat zu verbannen.'); define('L_HELP_CMD_20', 'Beschreiben, was du grade tust, ohne Dich selbst zu erwähnen.'); ! define('L_HELP_CMD_21', 'Einschalten/Ausschalten des grafischen Smilies Modus.'); // smilies popup define('L_SMIL_TIT', 'Smilies'); ! define('L_SMIL_MAX', 'Die <b>maximale Anzahl</b> von grafischen Smilies pro Nachricht ist <b>%s</b>.'); ! define('L_SMIL_CLICK', 'Du kannst auf ein Smilie klicken um den entsprechenden Textcode in Deine NAchricht einzufügen.'); ! define('L_SMIL_MINE', 'Wenn du registriert bist und der Administrator ein eigens Smilie für Dich definiert hat, kannst du dieses mit dem Code \' :mine: \' einfügen.'); // messages frame *************** *** 250,253 **** define('L_ENTER_ROM', '%s betritt den Raum'); define('L_EXIT_ROM', '%s verläßt den Raum'); ! define('L_WELCOME', 'Welcome to our chat. Please obey the net etiquette while chatting: <i>try to be pleasant and polite</i>.'); ?> --- 251,254 ---- define('L_ENTER_ROM', '%s betritt den Raum'); define('L_EXIT_ROM', '%s verläßt den Raum'); ! define('L_WELCOME', 'Willkommen in unseren Chat. Bitte führe die Net Etiquette beim chatten aus: <i>bleibe höflich und angenehm zu anderen</i>.'); ?> |
From: Lo?c C. <lo...@us...> - 2001-05-21 19:21:35
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs In directory usw-pr-cvs1:/tmp/cvs-serv22986/chat/lib/index_libs Modified Files: index_validation.lib.php3 Log Message: Fied bug #425803: C_REQUIRE_REGISTER not taken into account Index: index_validation.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs/index_validation.lib.php3,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** index_validation.lib.php3 2001/05/16 20:55:37 1.10 --- index_validation.lib.php3 2001/05/21 19:21:32 1.11 *************** *** 102,106 **** // 3. If registration is required but no password has been submitted // -> deny access ! if ($error1 == '' && $requireReg) { if ($password == '') --- 102,106 ---- // 3. If registration is required but no password has been submitted // -> deny access ! if ($error1 == '' && !$isJsValidated && $requireReg) { if ($password == '') *************** *** 117,131 **** if ($isRegNick) { ! $regUserPassword = pmcHandleMagicQuotes($regUserPassword, '', 1, 'del'); ! $regNickModeratedRooms = pmcHandleMagicQuotes($regNickModeratedRooms, '', 1, 'del'); } $dbLink->cleanResults(); ! // Skip the validation work when it has already be done before the ! // 'main_index.lib.php3' is ran ! if (!isset($GLOBALS['$exitMessage']) && $isRegNick) { // Reserved nick but no password submitted -> deny access ! if ($password == '') { $error1 = L_ERR_USR_3; --- 117,136 ---- if ($isRegNick) { ! $regUserPassword = pmcHandleMagicQuotes($regUserPassword, '', 1, 'del'); ! $regNickModeratedRooms = pmcHandleMagicQuotes($regNickModeratedRooms, '', 1, 'del'); } $dbLink->cleanResults(); ! // Nick isn't a registered one but registration is required ! if (!$isRegNick && $requireReg) { + $error1 = L_ERR_USR_14; + } + // Skip the validation of the password when it has already be done before + // the 'main_index.lib.php3' is ran + else if (!isset($GLOBALS['$exitMessage']) && $isRegNick) + { // Reserved nick but no password submitted -> deny access ! if (!$isJsValidated && $password == '') { $error1 = L_ERR_USR_3; |
From: Lo?c C. <lo...@us...> - 2001-05-20 18:56:31
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv19781/chat Modified Files: users_low.php3 users.php3 messages_low.php3 input.php3 exit.php3 Log Message: In case of 'hackers attack' move to the start page but for the parent window Index: users_low.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/users_low.php3,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** users_low.php3 2001/04/28 15:42:02 1.16 --- users_low.php3 2001/05/20 18:56:28 1.17 *************** *** 52,57 **** C_DB_USER, C_DB_PASS, C_SESS_TBL, ! C_SESS_DEL * 60, ! C_CHAT_URL ); dbSessionStart(); --- 52,56 ---- C_DB_USER, C_DB_PASS, C_SESS_TBL, ! C_SESS_DEL * 60 ); dbSessionStart(); *************** *** 59,62 **** --- 58,67 ---- $dbSessionDbLink->close(); unset($dbSessionDbLink); + // Hackers attack + if ($dbSessionIsNew) + { + include('./lib/move_to_start.lib.' . C_EXTENSION); + exit(); + } /** Index: users.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/users.php3,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** users.php3 2001/05/04 16:28:26 1.22 --- users.php3 2001/05/20 18:56:28 1.23 *************** *** 51,56 **** C_DB_USER, C_DB_PASS, C_SESS_TBL, ! C_SESS_DEL * 60, ! C_CHAT_URL ); dbSessionStart(); --- 51,55 ---- C_DB_USER, C_DB_PASS, C_SESS_TBL, ! C_SESS_DEL * 60 ); dbSessionStart(); *************** *** 58,61 **** --- 57,66 ---- $dbSessionDbLink->close(); unset($dbSessionDbLink); + // Hackers attack + if ($dbSessionIsNew) + { + include('./lib/move_to_start.lib.' . C_EXTENSION); + exit(); + } /** Index: messages_low.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/messages_low.php3,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** messages_low.php3 2001/04/24 09:07:51 1.16 --- messages_low.php3 2001/05/20 18:56:28 1.17 *************** *** 55,63 **** C_DB_USER, C_DB_PASS, C_SESS_TBL, ! C_SESS_DEL * 60, ! C_CHAT_URL ); dbSessionStart(); ! dbSessionUpdateLogTime(); /** --- 55,71 ---- C_DB_USER, C_DB_PASS, C_SESS_TBL, ! C_SESS_DEL * 60 ); dbSessionStart(); ! // Hackers attack ! if ($dbSessionIsNew) ! { ! include('./lib/move_to_start.lib.' . C_EXTENSION); ! exit(); ! } ! else ! { ! dbSessionUpdateLogTime(); ! } /** Index: input.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/input.php3,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -r1.34 -r1.35 *** input.php3 2001/05/07 21:15:00 1.34 --- input.php3 2001/05/20 18:56:28 1.35 *************** *** 66,73 **** C_DB_USER, C_DB_PASS, C_SESS_TBL, ! C_SESS_DEL * 60, ! C_CHAT_URL ); dbSessionStart(); /** --- 66,78 ---- C_DB_USER, C_DB_PASS, C_SESS_TBL, ! C_SESS_DEL * 60 ); dbSessionStart(); + // Hackers attack + if ($dbSessionIsNew) + { + include('./lib/move_to_start.lib.' . C_EXTENSION); + exit(); + } /** Index: exit.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/exit.php3,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** exit.php3 2001/05/10 11:45:37 1.15 --- exit.php3 2001/05/20 18:56:28 1.16 *************** *** 53,58 **** C_DB_USER, C_DB_PASS, C_SESS_TBL, ! C_SESS_DEL * 60, ! C_CHAT_URL ); dbSessionStart(); --- 53,57 ---- C_DB_USER, C_DB_PASS, C_SESS_TBL, ! C_SESS_DEL * 60 ); dbSessionStart(); *************** *** 60,63 **** --- 59,68 ---- $dbSessionDbLink->close(); unset($dbSessionDbLink); + // Hackers attack + if ($dbSessionIsNew) + { + include('./lib/move_to_start.lib.' . C_EXTENSION); + exit(); + } /** |
From: Lo?c C. <lo...@us...> - 2001-05-20 11:48:58
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv20190/chat Modified Files: admin.php3 Log Message: Improved the sorting feature Index: admin.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/admin.php3,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** admin.php3 2001/05/05 17:26:17 1.1 --- admin.php3 2001/05/20 11:48:55 1.2 *************** *** 135,150 **** { $dbSessionVars['adminSheet'] = $adminSheet; } ! if (isset($sortBy)) { ! $dbSessionVars['sortBy'] = $sortBy; ! } ! if (isset($sortOrder)) ! { ! $dbSessionVars['sortOrder'] = $sortOrder; ! } ! if (isset($offset)) ! { ! $dbSessionVars['offset'] = $offset; } // Load the frame when the $whichFrame var indicate one --- 135,156 ---- { $dbSessionVars['adminSheet'] = $adminSheet; + $dbSessionVars['sortBy'] = 'username'; + $dbSessionVars['sortOrder'] = 'ASC'; + $dbSessionVars['offset'] = 0; } ! else { ! if (isset($sortBy)) ! { ! $dbSessionVars['sortBy'] = $sortBy; ! } ! if (isset($sortOrder)) ! { ! $dbSessionVars['sortOrder'] = $sortOrder; ! } ! if (isset($offset)) ! { ! $dbSessionVars['offset'] = $offset; ! } } // Load the frame when the $whichFrame var indicate one |
From: Lo?c C. <lo...@us...> - 2001-05-20 11:48:58
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/admin In directory usw-pr-cvs1:/tmp/cvs-serv20190/chat/admin Modified Files: admin_body.php3 admin2.php3 admin1.php3 Log Message: Improved the sorting feature Index: admin_body.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/admin/admin_body.php3,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** admin_body.php3 2001/05/05 17:26:17 1.1 --- admin_body.php3 2001/05/20 11:48:55 1.2 *************** *** 49,52 **** --- 49,53 ---- { $adminBodySortUrl = $adminBodyUrl . $pmcQueryArgSeparator . 'sortBy='; + $defaultSortOrder = $pmcQueryArgSeparator . 'sortOrder=ASC'; $invertSortOrder = $pmcQueryArgSeparator . 'sortOrder=' . (($dbSessionVars['sortOrder'] == 'ASC') ? 'DESC' : 'ASC'); $adminBodyNavigUrl = $adminBodyUrl . $pmcQueryArgSeparator . 'offset='; Index: admin2.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/admin/admin2.php3,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** admin2.php3 2001/05/05 17:42:55 1.2 --- admin2.php3 2001/05/20 11:48:55 1.3 *************** *** 221,228 **** </td> <td valign="middle" align="<?php echo($cellAlign); ?>"> ! <a href="<?php echo($adminBodySortUrl . 'username'); if ($dbSessionVars['sortBy'] == 'username') echo($invertSortOrder); ?>"><?php echo(A_SHEET1_2); ?></a> </td> <td valign="middle" align="center"> ! <a href="<?php echo($adminBodySortUrl . 'ip'); if ($dbSessionVars['sortBy'] == 'ip') echo($invertSortOrder); ?>"><?php echo(A_SHEET2_2); ?></a> </td> <td valign="middle" align="center" class="tabTitle"> --- 221,228 ---- </td> <td valign="middle" align="<?php echo($cellAlign); ?>"> ! <a href="<?php echo($adminBodySortUrl . 'username' . (($dbSessionVars['sortBy'] == 'username') ? $invertSortOrder : $defaultSortOrder)); ?>"><?php echo(A_SHEET1_2); ?></a> </td> <td valign="middle" align="center"> ! <a href="<?php echo($adminBodySortUrl . 'ip' . (($dbSessionVars['sortBy'] == 'ip') ? $invertSortOrder : $defaultSortOrder)); ?>"><?php echo(A_SHEET2_2); ?></a> </td> <td valign="middle" align="center" class="tabTitle"> Index: admin1.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/admin/admin1.php3,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** admin1.php3 2001/05/05 17:26:17 1.1 --- admin1.php3 2001/05/20 11:48:55 1.2 *************** *** 405,418 **** </td> <td valign="middle" align="<?php echo($cellAlign); ?>"> ! <a href="<?php echo($adminBodySortUrl . 'username'); if ($dbSessionVars['sortBy'] == 'username') echo($invertSortOrder); ?>"><?php echo(A_SHEET1_2); ?></a> </td> <td valign="middle" align="center"> ! <a href="<?php echo($adminBodySortUrl . 'reg_time'); if ($dbSessionVars['sortBy'] == 'reg_time') echo($invertSortOrder); ?>"><?php echo(A_SHEET1_11); ?></a> </td> <td valign="middle" align="center"> ! <a href="<?php echo($adminBodySortUrl . 'ip'); if ($dbSessionVars['sortBy'] == 'ip') echo($invertSortOrder); ?>"><?php echo(A_SHEET2_2); ?></a> </td> <td valign="middle" align="center"> ! <a href="<?php echo($adminBodySortUrl . 'perms'); if ($dbSessionVars['sortBy'] == 'perms') echo($invertSortOrder); ?>"><?php echo(A_SHEET1_3); ?></a> </td> <td valign="middle" align="center" class="tabTitle"> --- 405,418 ---- </td> <td valign="middle" align="<?php echo($cellAlign); ?>"> ! <a href="<?php echo($adminBodySortUrl . 'username' . (($dbSessionVars['sortBy'] == 'username') ? $invertSortOrder : $defaultSortOrder)); ?>"><?php echo(A_SHEET1_2); ?></a> </td> <td valign="middle" align="center"> ! <a href="<?php echo($adminBodySortUrl . 'reg_time' . (($dbSessionVars['sortBy'] == 'reg_time') ? $invertSortOrder : $defaultSortOrder)); ?>"><?php echo(A_SHEET1_11); ?></a> </td> <td valign="middle" align="center"> ! <a href="<?php echo($adminBodySortUrl . 'ip' . (($dbSessionVars['sortBy'] == 'ip') ? $invertSortOrder : $defaultSortOrder)); ?>"><?php echo(A_SHEET2_2); ?></a> </td> <td valign="middle" align="center"> ! <a href="<?php echo($adminBodySortUrl . 'perms' . (($dbSessionVars['sortBy'] == 'perms') ? $invertSortOrder : $defaultSortOrder)); ?>"><?php echo(A_SHEET1_3); ?></a> </td> <td valign="middle" align="center" class="tabTitle"> |
From: Lo?c C. <lo...@us...> - 2001-05-17 19:28:55
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/config In directory usw-pr-cvs1:/tmp/cvs-serv32029/chat/config Modified Files: config.lib.php3 Log Message: Bad comment for the session table Index: config.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/config/config.lib.php3,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** config.lib.php3 2001/05/07 21:15:00 1.7 --- config.lib.php3 2001/05/17 19:28:52 1.8 *************** *** 36,44 **** define('C_DB_USER', 'username'); // Database user define('C_DB_PASS', 'password'); // Database user's password define('C_MSG_TBL', 'pmc_messages'); // Name of the table where messages are stored define('C_USR_TBL', 'pmc_users'); // Name of the table where user names are stored define('C_REG_TBL', 'pmc_reg_users'); // Name of the table where registered users are stored define('C_BAN_TBL', 'pmc_ban_users'); // Name of the table where banished users are stored - define('C_SESS_TBL', 'pmc_sessions'); // Name of the table where banished users are stored // Cleaning settings for messages and usernames --- 36,44 ---- define('C_DB_USER', 'username'); // Database user define('C_DB_PASS', 'password'); // Database user's password + define('C_SESS_TBL', 'pmc_sessions'); // Name of the table where session data are stored define('C_MSG_TBL', 'pmc_messages'); // Name of the table where messages are stored define('C_USR_TBL', 'pmc_users'); // Name of the table where user names are stored define('C_REG_TBL', 'pmc_reg_users'); // Name of the table where registered users are stored define('C_BAN_TBL', 'pmc_ban_users'); // Name of the table where banished users are stored // Cleaning settings for messages and usernames *************** *** 96,100 **** define('C_TMZ_OFFSET', 0); // Timezone offset in hour between the server time and your country define('C_MSG_ORDER', 0); // Default order : 0 = last on top, 1 = last on bottom ! define('C_MSG_NB', 20); // Default number of messages to display define('C_MSG_REFRESH', 10); // Default timeout between each update define('C_SHOW_TIMESTAMP', 1); // Show Timsestamp before messages ? : 0 = no, 1 = yes --- 96,100 ---- define('C_TMZ_OFFSET', 0); // Timezone offset in hour between the server time and your country define('C_MSG_ORDER', 0); // Default order : 0 = last on top, 1 = last on bottom ! define('C_MSG_NB', 17); // Default number of messages to display define('C_MSG_REFRESH', 10); // Default timeout between each update define('C_SHOW_TIMESTAMP', 1); // Show Timsestamp before messages ? : 0 = no, 1 = yes |
From: Lo?c C. <lo...@us...> - 2001-05-17 19:28:17
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs In directory usw-pr-cvs1:/tmp/cvs-serv31790/chat/lib/index_libs Modified Files: connect_status.lib.js Log Message: Optimize a bit js work Index: connect_status.lib.js =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs/connect_status.lib.js,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** connect_status.lib.js 2001/05/14 08:50:49 1.3 --- connect_status.lib.js 2001/05/17 19:28:14 1.4 *************** *** 65,70 **** jsLoaderFrame.document.execCommand('Stop'); } - if (jsIsConnecting) - clearTimeout(jsIsConnecting); // Do refresh the 'loader' frame --- 65,68 ---- *************** *** 84,108 **** clearTimeout(jsIsConnecting); jsConnect = numTry; - - var exitFrame = window.frames['exit']; - if (typeof(exitFrame.document) == 'undefined' - || !exitFrame.document) - return; - - jsImgConnect.src = (numTry < 3) ? jsImgConnectOn.src : jsImgConnectErr.src; ! if (jsIsDOM) ! { ! exitFrame.document.getElementById('imgConState').src = jsImgConnect.src; ! } ! else if (jsIsIE4) ! { ! exitFrame.document.all['imgConState'].src = jsImgConnect.src; } - else if (jsIsNS4) - { - exitFrame.document.images['imgConState'].src = jsImgConnect.src; - } if (numTry < 3) { --- 82,107 ---- clearTimeout(jsIsConnecting); jsConnect = numTry; ! // Modify the connection status icon at the 'exit' frame ! var exitFrame = window.frames['exit'].window; ! if (typeof(exitFrame.document) == 'object') ! { ! jsImgConnect.src = (numTry < 3) ? jsImgConnectOn.src : jsImgConnectErr.src; ! ! if (jsIsDOM) ! { ! exitFrame.document.getElementById('imgConState').src = jsImgConnect.src; ! } ! else if (jsIsIE4) ! { ! exitFrame.document.all['imgConState'].src = jsImgConnect.src; ! } ! else if (jsIsNS4) ! { ! exitFrame.document.images['imgConState'].src = jsImgConnect.src; ! } } + // Refresh the 'loader' frame or kill the timeout pointer if (numTry < 3) { *************** *** 113,118 **** else { - clearTimeout(jsIsConnecting); jsConnect = 0; } --- 112,118 ---- else { jsConnect = 0; + if (jsIsConnecting) + clearTimeout(jsIsConnecting); } *************** *** 128,132 **** function pmcConnectDone() { ! var exitFrame = window.frames['exit']; jsConnect = 0; --- 128,132 ---- function pmcConnectDone() { ! var exitFrame = window.frames['exit'].window; jsConnect = 0; *************** *** 134,151 **** clearTimeout(jsIsConnecting); ! if (jsIsDOM) ! { ! if (typeof(exitFrame.document.getElementById('imgConState')) != 'undefined') ! exitFrame.document.getElementById('imgConState').src = jsImgConnectOff.src; ! } ! else if (jsIsIE4) ! { ! if (typeof(exitFrame.document.all['imgConState']) != 'undefined') ! exitFrame.document.all['imgConState'].src = jsImgConnectOff.src; ! } ! else if (jsIsNS4) { ! if (typeof(exitFrame.document.images['imgConState']) != 'undefined') ! exitFrame.document.images['imgConState'].src = jsImgConnectOff.src; } --- 134,154 ---- clearTimeout(jsIsConnecting); ! if (typeof(exitFrame.document) == 'object') { ! if (jsIsDOM) ! { ! if (typeof(exitFrame.document.getElementById('imgConState')) != 'undefined') ! exitFrame.document.getElementById('imgConState').src = jsImgConnectOff.src; ! } ! else if (jsIsIE4) ! { ! if (typeof(exitFrame.document.all['imgConState']) != 'undefined') ! exitFrame.document.all['imgConState'].src = jsImgConnectOff.src; ! } ! else if (jsIsNS4) ! { ! if (typeof(exitFrame.document.images['imgConState']) != 'undefined') ! exitFrame.document.images['imgConState'].src = jsImgConnectOff.src; ! } } |
From: Lo?c C. <lo...@us...> - 2001-05-17 19:28:16
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat In directory usw-pr-cvs1:/tmp/cvs-serv31790/chat Modified Files: loader.php3 handle_input.php3 Log Message: Optimize a bit js work Index: loader.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/loader.php3,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** loader.php3 2001/05/10 11:47:22 1.19 --- loader.php3 2001/05/17 19:28:14 1.20 *************** *** 408,416 **** </head> ! <body onunload="if (typeof(window.parent.frames['exit']) != 'undefined' && typeof(window.parent.jsLeaveChat) != 'undefined' && !window.parent.jsLeaveChat && window.parent.jsConnect < 1) window.parent.pmcConnecting(1)"> <script type="text/javascript" language="javascript1.1"> <!-- ! if (typeof(window.parent.frames['exit']) != 'undefined' ! && typeof(window.parent.pmcConnectDone) != 'undefined') { window.parent.pmcConnectDone(); --- 408,415 ---- </head> ! <body onunload="if (typeof(window.parent.jsLeaveChat) != 'undefined' && !window.parent.jsLeaveChat && window.parent.jsConnect == 0) window.parent.pmcConnecting(1)"> <script type="text/javascript" language="javascript1.1"> <!-- ! if (typeof(window.parent.pmcConnectDone) != 'undefined') { window.parent.pmcConnectDone(); Index: handle_input.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/handle_input.php3,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** handle_input.php3 2001/05/10 11:47:22 1.24 --- handle_input.php3 2001/05/17 19:28:14 1.25 *************** *** 220,225 **** if (typeof(elements['submitType'].disabled) != 'undefined') elements['submitType'].disabled = false; ! } <?php /** --- 220,227 ---- if (typeof(elements['submitType'].disabled) != 'undefined') elements['submitType'].disabled = false; ! } // end of with (window.parent.frames['input']....) + with (window.parent) + { <?php /** *************** *** 229,233 **** { ?> ! // Refresh the messages frame if necessary <?php if ($enforceFirstLoad) --- 231,235 ---- { ?> ! // Refresh the messages frame if necessary <?php if ($enforceFirstLoad) *************** *** 235,249 **** 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.pmcConnecting(1); <?php } --- 237,251 ---- echo("\n"); ?> ! frames['messages'].window.document.close(); ! jsIsInitLoad = true; ! jsLastLoadedMsgTime = 0; ! jsLastCheckedUserTime = 0; ! jsConnect = 0; <?php } echo("\n"); ?> ! if (jsConnect == 0) ! pmcConnecting(1); <?php } *************** *** 259,265 **** echo("\n"); ?> ! // Display a JavaScript alert box with the error message if necessary ! window.parent.pmcSetMsgBoxFocus(); ! alert('<?php echo(pmcSlashSingleQuotes($error)); ?>'); <?php } --- 261,267 ---- echo("\n"); ?> ! // Display a JavaScript alert box with the error message if necessary ! pmcSetMsgBoxFocus(); ! alert('<?php echo(pmcSlashSingleQuotes($error)); ?>'); <?php } *************** *** 275,284 **** echo("\n"); ?> ! // Add the red colors when the user has just been promoted to moderator ! if (!window.parent.jsIsModerator) ! { ! window.parent.frames['input'].window.location.replace('<?php echo($inputUrl); ?>'); ! window.parent.jsIsModerator = 1; ! } <?php } --- 277,286 ---- echo("\n"); ?> ! // Add the red colors when the user has just been promoted to moderator ! if (!jsIsModerator) ! { ! frames['input'].window.location.replace('<?php echo($inputUrl); ?>'); ! jsIsModerator = 1; ! } <?php } *************** *** 287,300 **** 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('<?php echo($inputUrl); ?>'); ! window.parent.jsIsModerator = 0; ! } <?php } echo("\n"); ?> } // --> --- 289,303 ---- echo("\n"); ?> ! // Remove the red colors when the user has became a 'simple user' ! if (jsIsModerator) ! { ! frames['input'].window.location.replace('<?php echo($inputUrl); ?>'); ! jsIsModerator = 0; ! } <?php } echo("\n"); ?> + } // end of with (window.parent) } // --> |
From: Lo?c C. <lo...@us...> - 2001-05-16 20:56:27
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib In directory usw-pr-cvs1:/tmp/cvs-serv4783/chat/lib Modified Files: db_sessions.lib.php3 Log Message: Fix a bug when data contains backslashes Index: db_sessions.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/db_sessions.lib.php3,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** db_sessions.lib.php3 2001/04/20 21:17:09 1.11 --- db_sessions.lib.php3 2001/05/16 20:56:24 1.12 *************** *** 690,694 **** } ! $serialized = str_replace('\'', '\\\'', serialize($GLOBALS['dbSessionVars'])); // Ensure the session data do not exceed the allowed size --- 690,695 ---- } ! $serialized = serialize($GLOBALS['dbSessionVars']); ! $serialized = str_replace('\'', '\\\'', str_replace('\\', '\\\\', $serialized)); // Ensure the session data do not exceed the allowed size |