|
From: Lo?c C. <lo...@us...> - 2001-06-01 20:44:43
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat
In directory usw-pr-cvs1:/tmp/cvs-serv30544/chat
Modified Files:
whois_popup.php3 users_popup_low.php3 users_popup.php3
users_low.php3 users.php3 smilies_popup.php3 save.php3
profile_reg.php3 profile_edit.php3 profile_del.php3
messages_low.php3 loader.php3 input.php3 handle_input.php3
Log Message:
Improved security again
Index: whois_popup.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/whois_popup.php3,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** whois_popup.php3 2001/05/30 08:07:12 1.15
--- whois_popup.php3 2001/06/01 20:44:39 1.16
***************
*** 138,142 ****
--- 138,144 ----
// informations (ip and e-mail)
if ($power == 'medium')
+ {
$power = 'weak';
+ }
break;
Index: users_popup_low.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/users_popup_low.php3,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** users_popup_low.php3 2001/04/24 21:05:49 1.14
--- users_popup_low.php3 2001/06/01 20:44:39 1.15
***************
*** 68,72 ****
--- 68,74 ----
if ( !dbSessionIsRegistered('lang')
|| (isset($lang) && $dbSessionVars['lang'] != $lang))
+ {
include('./localization/languages.lib.' . C_EXTENSION);
+ }
require('./localization/' . $dbSessionVars['lang'] . '/chat.loc');
$textDirection = (L_CHARSET == 'windows-1256') ? 'rtl' : 'ltr';
***************
*** 100,107 ****
--- 102,113 ----
// expire in one year
if (!isset($isBeep))
+ {
$isBeep = (isset($cookieBeep)) ? $cookieBeep : 1;
+ }
setcookie('cookieBeep', $isBeep, time() + 60 * 60 * 24 * 365);
if (!isset($lastCheck) || $isBeep == 0)
+ {
$lastCheck = time();
+ }
$doBeep = 0;
// Check for new users
***************
*** 118,122 ****
--- 124,130 ----
$doBeep = (list($newLastCheck) = $dbLink->nextRecord());
if ($doBeep)
+ {
$lastCheck = $newLastCheck;
+ }
$dbLink->cleanResults();
}
***************
*** 169,175 ****
--- 177,186 ----
*/
// 1. Get the list of rooms and users
+ $usersIn = array();
$dbLink->query("SELECT usr.room, usr.username, usr.latin1, usr.status FROM " . C_USR_TBL . " usr, " . C_MSG_TBL . " msg WHERE usr.room = msg.room AND " . $roomToCheck . " GROUP BY room, username");
while ($tmp = $dbLink->nextRecord())
+ {
$usersIn[] = $tmp;
+ }
$dbLink->cleanResults();
$dbLink->close();
***************
*** 178,185 ****
// 2. Build the users list
$usersList = array();
$usersTotalCnt = 0;
// Some users are chatting
! if (isset($usersIn))
{
$pointerPos = -1; // The pointer position inside the array
--- 189,198 ----
// 2. Build the users list
$usersList = array();
+ $childCnt = array();
$usersTotalCnt = 0;
+ $winTitle = '';
// Some users are chatting
! if (count($usersIn) > 0)
{
$pointerPos = -1; // The pointer position inside the array
***************
*** 187,191 ****
$handdledRoom = '';
$isFirstOther = true;
- $childCnt = array();
$usersInCnt = count($usersIn);
$roomsCnt = 0;
--- 200,203 ----
***************
*** 237,241 ****
if ($usersTotalCnt < 4)
{
! $winTitle = (isset($winTitle))
? $winTitle . ', ' . pmcSpecialChars($anUser, $latin1)
: pmcSpecialChars($anUser, $latin1);
--- 249,253 ----
if ($usersTotalCnt < 4)
{
! $winTitle = (!empty($winTitle))
? $winTitle . ', ' . pmcSpecialChars($anUser, $latin1)
: pmcSpecialChars($anUser, $latin1);
Index: users_popup.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/users_popup.php3,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** users_popup.php3 2001/05/04 09:26:43 1.17
--- users_popup.php3 2001/06/01 20:44:39 1.18
***************
*** 67,71 ****
--- 67,73 ----
if ( !dbSessionIsRegistered('lang')
|| (isset($lang) && $dbSessionVars['lang'] != $lang))
+ {
include('./localization/languages.lib.' . C_EXTENSION);
+ }
require('./localization/' . $dbSessionVars['lang'] . '/chat.loc');
$textDirection = (L_CHARSET == 'windows-1256') ? 'rtl' : 'ltr';
***************
*** 99,106 ****
--- 101,112 ----
// expire in one year
if (!isset($isBeep))
+ {
$isBeep = (isset($cookieBeep)) ? $cookieBeep : 1;
+ }
setcookie('cookieBeep', $isBeep, time() + 60 * 60 * 24 * 365);
if (!isset($lastCheck) || $isBeep == 0)
+ {
$lastCheck = time();
+ }
$doBeep = 0;
// Check for new users
***************
*** 117,121 ****
--- 123,129 ----
$doBeep = (list($newLastCheck) = $dbLink->nextRecord());
if ($doBeep)
+ {
$lastCheck = $newLastCheck;
+ }
$dbLink->cleanResults();
}
***************
*** 168,174 ****
--- 176,185 ----
*/
// 1. Get the list of rooms and users
+ $usersIn = array();
$dbLink->query("SELECT usr.room, usr.username, usr.latin1, usr.status FROM " . C_USR_TBL . " usr, " . C_MSG_TBL . " msg WHERE usr.room = msg.room AND " . $roomToCheck . " GROUP BY room, username");
while ($tmp = $dbLink->nextRecord())
+ {
$usersIn[] = $tmp;
+ }
$dbLink->cleanResults();
$dbLink->close();
***************
*** 177,184 ****
// 2. Build the users list
$usersList = array();
$usersTotalCnt = 0;
// Some users are chatting
! if (isset($usersIn))
{
$pointerPos = -1; // The pointer position inside the array
--- 188,198 ----
// 2. Build the users list
$usersList = array();
+ $childCnt = array();
$usersTotalCnt = 0;
+ $firstOtherRoom = '';
+ $winTitle = '';
// Some users are chatting
! if (count($usersIn) > 0)
{
$pointerPos = -1; // The pointer position inside the array
***************
*** 186,190 ****
$handdledRoom = '';
$isFirstOther = true;
- $childCnt = array();
$usersInCnt = count($usersIn);
$roomsCnt = 0;
--- 200,203 ----
***************
*** 241,245 ****
if ($usersTotalCnt < 4)
{
! $winTitle = (isset($winTitle))
? $winTitle . ', ' . pmcSpecialChars($anUser, $latin1)
: pmcSpecialChars($anUser, $latin1);
--- 254,258 ----
if ($usersTotalCnt < 4)
{
! $winTitle = (!empty($winTitle))
? $winTitle . ', ' . pmcSpecialChars($anUser, $latin1)
: pmcSpecialChars($anUser, $latin1);
***************
*** 337,344 ****
<script type="text/javascript" language="javascript1.2">
<!--
! jsRoomsCnt = <?php echo(isset($childCnt) ? count($childCnt) : 0); ?>;
<?php
! if (isset($childCnt) && count($childCnt) > 0)
{
?>
--- 350,357 ----
<script type="text/javascript" language="javascript1.2">
<!--
! jsRoomsCnt = <?php echo(count($childCnt)); ?>;
<?php
! if (count($childCnt) > 0)
{
?>
***************
*** 360,364 ****
{
<?php
! if (isset($firstOtherRoom))
{
?>
--- 373,377 ----
{
<?php
! if (!empty($firstOtherRoom))
{
?>
Index: users_low.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/users_low.php3,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** users_low.php3 2001/05/25 22:29:14 1.19
--- users_low.php3 2001/06/01 20:44:39 1.20
***************
*** 178,182 ****
. 'GROUP BY room, username';
}
! else if (C_DB_TYPE == 'pgsql') // Not yet validated
{
$usersQuery = 'SELECT usr.room, usr.username, usr.latin1, usr.status, reg.gender '
--- 178,182 ----
. 'GROUP BY room, username';
}
! else if (C_DB_TYPE == 'pgsql')
{
$usersQuery = 'SELECT usr.room, usr.username, usr.latin1, usr.status, reg.gender '
***************
*** 199,203 ****
--- 199,205 ----
$dbLink->query($usersQuery);
while ($tmp = $dbLink->nextRecord())
+ {
$usersIn[] = $tmp;
+ }
$dbLink->cleanResults();
$dbLink->close();
***************
*** 292,302 ****
--- 294,312 ----
// Put an icon when there is a profile for the user
if ($gender == 0)
+ {
$gender = 'undefined';
+ }
else if ($gender == 1)
+ {
$gender = 'boy';
+ }
else if ($gender == 2)
+ {
$gender = 'girl';
+ }
else
+ {
$gender = 'none';
+ }
if ($status != 'u' && $status != 'k' && $status != 'd' && $status != 'b')
{
***************
*** 357,361 ****
// Display this room name when it hadn't been displayed yet
if (strcasecmp($tmpRoom, $dbSessionVars['currentRoom']) != 0
! && (!isset($childCnt) || !isset($childCnt[$id])))
{
if ($firstDefault)
--- 367,371 ----
// Display this room name when it hadn't been displayed yet
if (strcasecmp($tmpRoom, $dbSessionVars['currentRoom']) != 0
! && !isset($childCnt[$id]))
{
if ($firstDefault)
Index: users.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/users.php3,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** users.php3 2001/05/25 22:29:14 1.25
--- users.php3 2001/06/01 20:44:39 1.26
***************
*** 177,181 ****
. 'GROUP BY room, username';
}
! else if (C_DB_TYPE == 'pgsql') // Not yet validated
{
$usersQuery = 'SELECT usr.room, usr.username, usr.latin1, usr.status, reg.gender '
--- 177,181 ----
. 'GROUP BY room, username';
}
! else if (C_DB_TYPE == 'pgsql')
{
$usersQuery = 'SELECT usr.room, usr.username, usr.latin1, usr.status, reg.gender '
***************
*** 198,202 ****
--- 198,204 ----
$dbLink->query($usersQuery);
while ($tmp = $dbLink->nextRecord())
+ {
$usersIn[] = $tmp;
+ }
$dbLink->cleanResults();
$dbLink->close();
***************
*** 213,216 ****
--- 215,219 ----
$retRow = 0; // A row where to put the number of users
$handdledRoom = '';
+ $firstOtherRoom = '';
$isCurrentRoom = true;
$isFirstOther = true;
***************
*** 296,306 ****
--- 299,317 ----
// Put an icon when there is a profile for the user
if ($gender == 0)
+ {
$gender = 'undefined';
+ }
else if ($gender == 1)
+ {
$gender = 'boy';
+ }
else if ($gender == 2)
+ {
$gender = 'girl';
+ }
else
+ {
$gender = 'none';
+ }
if ($status != 'u' && $status != 'k' && $status != 'd' && $status != 'b')
{
***************
*** 361,368 ****
// Display this room name when it hadn't been displayed yet
if (strcasecmp($tmpRoom, $dbSessionVars['currentRoom']) != 0
! && (!isset($childCnt) || !isset($childCnt[$id])))
{
! if (!isset($firstOtherRoom))
$firstOtherRoom = 'Parent' . $id;
if ($firstDefault)
{
--- 372,381 ----
// Display this room name when it hadn't been displayed yet
if (strcasecmp($tmpRoom, $dbSessionVars['currentRoom']) != 0
! && !isset($childCnt[$id]))
{
! if (empty($firstOtherRoom))
! {
$firstOtherRoom = 'Parent' . $id;
+ }
if ($firstDefault)
{
***************
*** 462,471 ****
<script type="text/javascript" language="javascript1.2">
<!--
! window.parent.jsRoomsCnt = <?php echo(isset($childCnt) ? count($childCnt) - 1 : 0); ?>;
window.parent.jsUsersFrame = window;
window.parent.jsExitFrame = window.parent.frames['exit'].window;
<?php
! if (isset($childCnt) && count($childCnt) > 0)
{
?>
--- 475,484 ----
<script type="text/javascript" language="javascript1.2">
<!--
! window.parent.jsRoomsCnt = <?php echo((count($childCnt) > 0) ? count($childCnt) - 1 : 0); ?>;
window.parent.jsUsersFrame = window;
window.parent.jsExitFrame = window.parent.frames['exit'].window;
<?php
! if (count($childCnt) > 0)
{
?>
***************
*** 493,497 ****
{
<?php
! if (isset($firstOtherRoom))
{
?>
--- 506,510 ----
{
<?php
! if (!empty($firstOtherRoom))
{
?>
Index: smilies_popup.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/smilies_popup.php3,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** smilies_popup.php3 2001/05/31 19:57:05 1.3
--- smilies_popup.php3 2001/06/01 20:44:40 1.4
***************
*** 176,180 ****
--- 176,182 ----
{
if ($i > 0)
+ {
echo("\t");
+ }
echo('<tr valign="bottom">' . "\n");
echo($smiliesCodes[$i]);
Index: save.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/save.php3,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** save.php3 2001/04/29 08:57:35 1.6
--- save.php3 2001/06/01 20:44:40 1.7
***************
*** 140,143 ****
--- 140,144 ----
else
{
+ $isDaySeparator = false;
reset($grabedMessages);
for ($k = 0; $k < $grabedMessagesCnt; $k++)
***************
*** 151,155 ****
// Separator between messages sent before today and other ones
! if (!isset($daySeparator)
&& date('j', $sentTime) != date('j', time()))
{
--- 152,156 ----
// Separator between messages sent before today and other ones
! if (!$isDaySeparator
&& date('j', $sentTime) != date('j', time()))
{
***************
*** 158,162 ****
: L_TODAY_DWN;
$newMessages[] = '<p class="msg"><span class="notify">--------- ' . $daySeparatorMsg . ' ---------</span></p>';
! $daySeparator = 1;
unset($daySeparatorMsg);
}
--- 159,163 ----
: L_TODAY_DWN;
$newMessages[] = '<p class="msg"><span class="notify">--------- ' . $daySeparatorMsg . ' ---------</span></p>';
! $isDaySeparator = true;
unset($daySeparatorMsg);
}
***************
*** 166,174 ****
--- 167,179 ----
// The timestamp of the message
if ($dbSessionVars['showTimestamp'] == 1)
+ {
$aMessage .= '<span class="time">' . date('H:i:s', $sentTime + C_TMZ_OFFSET * 60 * 60) . '</span> ';
+ }
// The message itself
$sender = pmcSpecialChars($sender, $senderLatin1);
if ($addressee != '')
+ {
$addressee = ']<bdo dir="' . $textDirection . '"></bdo>>[' . htmlspecialchars($addressee);
+ }
$aMessage .= '<b>[' . $sender . $addressee . ']<bdo dir="' . $textDirection .'"></bdo></b> '
. '<font color="' . $msgColor . '">' . $message . '</font>';
Index: profile_reg.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/profile_reg.php3,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** profile_reg.php3 2001/05/24 14:26:32 1.14
--- profile_reg.php3 2001/06/01 20:44:40 1.15
***************
*** 94,119 ****
/**
* Validates the submitted form then registers the profile
*/
- $isRegDone = false;
if (isset($submitType) && $submitType == L_REG_3)
{
if (C_NO_SWEAR)
! include('./lib/swearing.lib.' . C_EXTENSION);
// Validates the nick
if (!$isJsValidated && trim($nick) == '')
{
! $error = L_ERR_USR_5;
}
else if (!$isJsValidated && ereg('[\, ]', $nick))
{
! $error = L_ERR_USR_16;
}
else if (C_NO_SWEAR && checkWords($nick, true))
{
! $error = L_ERR_USR_18;
}
--- 94,130 ----
+ /**
+ * Defines some variables
+ */
+ $isMailFail = false;
+ $isMailSent = false;
+ $isRegDone = false;
+ $error = '';
+ $success = '';
+
+
/**
* Validates the submitted form then registers the profile
*/
if (isset($submitType) && $submitType == L_REG_3)
{
if (C_NO_SWEAR)
! {
! include('./lib/swearing.lib.' . C_EXTENSION);
! }
// Validates the nick
if (!$isJsValidated && trim($nick) == '')
{
! $error = L_ERR_USR_5;
}
else if (!$isJsValidated && ereg('[\, ]', $nick))
{
! $error = L_ERR_USR_16;
}
else if (C_NO_SWEAR && checkWords($nick, true))
{
! $error = L_ERR_USR_18;
}
***************
*** 121,125 ****
else if (!$isJsValidated && !C_EMAIL_PASWD && $password == '')
{
! $error = L_ERR_USR_6;
}
--- 132,136 ----
else if (!$isJsValidated && !C_EMAIL_PASWD && $password == '')
{
! $error = L_ERR_USR_6;
}
***************
*** 127,131 ****
else if (!$isJsValidated && (trim($firstName) == '' || trim($lastName) == ''))
{
! $error = L_ERR_USR_15;
}
--- 138,142 ----
else if (!$isJsValidated && (trim($firstName) == '' || trim($lastName) == ''))
{
! $error = L_ERR_USR_15;
}
***************
*** 133,147 ****
else if (!$isJsValidated && trim($email) == '')
{
! $error = L_ERR_USR_7;
}
else if (!$isJsValidated &&
!eregi('^([0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-wyz][a-z](fo|g|l|m|mes|o|op|pa|ro|seum|t|u|v|z)?)$', $email))
{
! $error = L_ERR_USR_8;
}
else if ((C_EMAIL_PASWD && @checkdnsrr('www.w3.org', 'ANY'))
&& !checkdnsrr(substr(strstr($email, '@'), 1), 'ANY'))
{
! $error = L_ERR_USR_8;
}
--- 144,158 ----
else if (!$isJsValidated && trim($email) == '')
{
! $error = L_ERR_USR_7;
}
else if (!$isJsValidated &&
!eregi('^([0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-wyz][a-z](fo|g|l|m|mes|o|op|pa|ro|seum|t|u|v|z)?)$', $email))
{
! $error = L_ERR_USR_8;
}
else if ((C_EMAIL_PASWD && @checkdnsrr('www.w3.org', 'ANY'))
&& !checkdnsrr(substr(strstr($email, '@'), 1), 'ANY'))
{
! $error = L_ERR_USR_8;
}
***************
*** 166,171 ****
$latin1 = (L_CHARSET == 'iso-8859-1') ? 1 : 0;
$showEmail = (isset($showEmail) && $showEmail) ? 1 : 0;
! if (!isset($gender))
! $gender = '';
// Gets the ip
--- 177,184 ----
$latin1 = (L_CHARSET == 'iso-8859-1') ? 1 : 0;
$showEmail = (isset($showEmail) && $showEmail) ? 1 : 0;
! if (empty($gender))
! {
! $gender = 0;
! }
// Gets the ip
***************
*** 191,200 ****
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);
if (!$mailHandler->pmmIsSent)
! $error = sprintf(L_EMAIL_VAL_ERR, C_REG_EMAIL, C_REG_SENDER);
unset($mailHandler);
}
--- 204,222 ----
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);
if (!$mailHandler->pmmIsSent)
! {
! $error = sprintf(L_EMAIL_VAL_ERR, C_REG_EMAIL, C_REG_SENDER);
! $isMailFail = true;
! }
! else
! {
! $isMailSent = true;
! }
unset($mailHandler);
}
***************
*** 208,215 ****
. '(username, latin1, password, firstname, lastname, country, website, email, showemail, perms, rooms, reg_time, ip, gender) '
. 'VALUES ('
! . "'$slashedNick', '$latin1', '$slashedPswd', '" . pmcSlashSingleQuotes($firstName) . "', '" . pmcSlashSingleQuotes($lastName) . "', '" . pmcSlashSingleQuotes($spokenLang) . "', '$webSite', '$email', $showEmail, 'user', '', " . time() . ", '$ip', '$gender'"
. ')';
$dbLink->query($regQuery);
! $message = L_REG_9;
$isRegDone = true;
--- 230,237 ----
. '(username, latin1, password, firstname, lastname, country, website, email, showemail, perms, rooms, reg_time, ip, gender) '
. 'VALUES ('
! . "'$slashedNick', '$latin1', '$slashedPswd', '" . pmcSlashSingleQuotes($firstName) . "', '" . pmcSlashSingleQuotes($lastName) . "', '" . pmcSlashSingleQuotes($spokenLang) . "', '$webSite', '$email', $showEmail, 'user', '', " . time() . ", '$ip', $gender"
. ')';
$dbLink->query($regQuery);
! $success = L_REG_9;
$isRegDone = true;
***************
*** 279,286 ****
<table border="0">
<tr>
! <th colspan="2" class="tabTitle"><?php echo(($isRegDone) ? $message : L_REG_6); ?></th>
</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>
--- 301,308 ----
<table border="0">
<tr>
! <th colspan="2" class="tabTitle"><?php echo(($isRegDone) ? $success : L_REG_6); ?></th>
</tr>
<tr>
! <th colspan="2"><?php if (!$isRegDone && !$isMailFail) echo(L_REG_37); else if ($isMailSent) echo(L_EMAIL_VAL_DONE); ?></th>
</tr>
<tr><td> </td></tr>
***************
*** 288,293 ****
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_SET_2); ?> :</td>
<td valign="top">
! <input type="text" name="nick" size="11" maxlength="10" value="<?php if (isset($nick)) echo(htmlspecialchars($nick)); ?>"<?php if ($isRegDone) echo(' readonly="readonly"'); ?> />
! <?php if (!$isRegDone) echo('<span class="error">*</span>'); ?>
</td>
</tr>
--- 310,315 ----
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_SET_2); ?> :</td>
<td valign="top">
! <input type="text" name="nick" size="11" maxlength="10" value="<?php if (isset($nick)) echo(htmlspecialchars($nick)); ?>"<?php if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> />
! <?php if (!$isRegDone && !$isMailFail) echo('<span class="error">*</span>'); ?>
</td>
</tr>
***************
*** 299,304 ****
<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 if (isset($password)) echo(htmlspecialchars($password)); ?>"<?php if ($isRegDone) echo(' readonly="readonly"'); ?> />
! <?php if (!$isRegDone) echo('<span class="error">*</span>'); ?>
</td>
</tr>
--- 321,326 ----
<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 if (isset($password)) echo(htmlspecialchars($password)); ?>"<?php if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> />
! <?php if (!$isRegDone && !$isMailFail) echo('<span class="error">*</span>'); ?>
</td>
</tr>
***************
*** 310,315 ****
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_30); ?> :</td>
<td valign="top">
! <input type="text" name="firstName" size="11" maxlength="64" value="<?php if (isset($firstName)) echo(htmlspecialchars($firstName)); ?>"<?php if ($isRegDone) echo(' readonly="readonly"'); ?> />
! <?php if (!$isRegDone) echo('<span class="error">*</span>'); ?>
</td>
</tr>
--- 332,337 ----
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_30); ?> :</td>
<td valign="top">
! <input type="text" name="firstName" size="11" maxlength="64" value="<?php if (isset($firstName)) echo(htmlspecialchars($firstName)); ?>"<?php if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> />
! <?php if (!$isRegDone && !$isMailFail) echo('<span class="error">*</span>'); ?>
</td>
</tr>
***************
*** 317,322 ****
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_31); ?> :</td>
<td valign="top">
! <input type="text" name="lastName" size="11" maxlength="64" value="<?php if (isset($lastName)) echo(htmlspecialchars($lastName)); ?>"<?php if ($isRegDone) echo(' readonly="readonly"'); ?> />
! <?php if (!$isRegDone) echo('<span class="error">*</span>'); ?>
</td>
</tr>
--- 339,344 ----
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_31); ?> :</td>
<td valign="top">
! <input type="text" name="lastName" size="11" maxlength="64" value="<?php if (isset($lastName)) echo(htmlspecialchars($lastName)); ?>"<?php if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> />
! <?php if (!$isRegDone && !$isMailFail) echo('<span class="error">*</span>'); ?>
</td>
</tr>
***************
*** 324,329 ****
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_45); ?> :</td>
<td valign="top">
! <input type="radio" name="gender" value="1"<?php if (isset($gender) && $gender == 1) echo(' checked="checked"'); if ($isRegDone) echo(' readonly="readonly"'); ?> /> <?php echo(L_REG_46); ?><br />
! <input type="radio" name="gender" value="2"<?php if (isset($gender) && $gender == 2) echo(' checked="checked"'); if ($isRegDone) echo(' readonly="readonly"'); ?> /> <?php echo(L_REG_47); ?>
</td>
</tr>
--- 346,351 ----
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_45); ?> :</td>
<td valign="top">
! <input type="radio" name="gender" value="1"<?php if (isset($gender) && $gender == 1) echo(' checked="checked"'); if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> /> <?php echo(L_REG_46); ?><br />
! <input type="radio" name="gender" value="2"<?php if (isset($gender) && $gender == 2) echo(' checked="checked"'); if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> /> <?php echo(L_REG_47); ?>
</td>
</tr>
***************
*** 331,335 ****
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_36); ?> :</td>
<td valign="top">
! <input type="text" name="spokenLang" size="11" maxlength="64" value="<?php if (isset($spokenLang)) echo(htmlspecialchars($spokenLang)); ?>"<?php if ($isRegDone) echo(' readonly="readonly"'); ?> />
</td>
</tr>
--- 353,357 ----
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_36); ?> :</td>
<td valign="top">
! <input type="text" name="spokenLang" size="11" maxlength="64" value="<?php if (isset($spokenLang)) echo(htmlspecialchars($spokenLang)); ?>"<?php if ($isRegDone|| $isMailFail) echo(' readonly="readonly"'); ?> />
</td>
</tr>
***************
*** 337,341 ****
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_32); ?> :</td>
<td valign="top">
! <input type="text" name="webSite" size="11" maxlength="64" value="<?php if (isset($webSite)) echo($webSite); ?>"<?php if ($isRegDone) echo(' readonly="readonly"'); ?> />
</td>
</tr>
--- 359,363 ----
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_32); ?> :</td>
<td valign="top">
! <input type="text" name="webSite" size="11" maxlength="64" value="<?php if (isset($webSite)) echo($webSite); ?>"<?php if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> />
</td>
</tr>
***************
*** 343,353 ****
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_8); ?> :</td>
<td valign="top">
! <input type="text" name="email" size="11" maxlength="64" value="<?php if (isset($email)) echo($email); ?>"<?php if ($isRegDone) echo(' readonly="readonly"'); ?> />
! <?php if (!$isRegDone) echo('<span class="error">*</span>'); ?>
</td>
</tr>
<tr>
<td colspan="2" align="center">
! <input type="checkbox" name="showEmail" value="1"<?php if (isset($showEmail) && $showEmail) echo(' checked="checked"'); ?><?php if ($isRegDone) echo(' readonly="readonly"'); ?> />
<?php echo(L_REG_33); ?>
</td>
--- 365,375 ----
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_8); ?> :</td>
<td valign="top">
! <input type="text" name="email" size="11" maxlength="64" value="<?php if (isset($email)) echo($email); ?>"<?php if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> />
! <?php if (!$isRegDone && !$isMailFail) echo('<span class="error">*</span>'); ?>
</td>
</tr>
<tr>
<td colspan="2" align="center">
! <input type="checkbox" name="showEmail" value="1"<?php if (isset($showEmail) && $showEmail) echo(' checked="checked"'); ?><?php if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> />
<?php echo(L_REG_33); ?>
</td>
***************
*** 356,360 ****
<br /><br />
<?php
! if (!$isRegDone)
{
?>
--- 378,382 ----
<br /><br />
<?php
! if (!$isRegDone && !$isMailFail)
{
?>
Index: profile_edit.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/profile_edit.php3,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** profile_edit.php3 2001/05/24 14:27:29 1.12
--- profile_edit.php3 2001/06/01 20:44:40 1.13
***************
*** 88,92 ****
--- 88,94 ----
*/
if (!(dbSessionIsRegistered('authUsername') && dbSessionIsRegistered('authPassword')))
+ {
include('./lib/login.lib.' . C_EXTENSION);
+ }
***************
*** 103,108 ****
* Defines some variables
*/
! $dbLink = new pmcDB;
! $isRegDone = false;
--- 105,114 ----
* Defines some variables
*/
! $dbLink = new pmcDB;
! $isMailFail = false;
! $isMailSent = false;
! $isRegDone = false;
! $error = '';
! $success = '';
***************
*** 114,131 ****
{
if (C_NO_SWEAR)
! include('./lib/swearing.lib.' . C_EXTENSION);
// Validates the nick
if (!$isJsValidated && trim($nick) == '')
{
! $error = L_ERR_USR_5;
}
else if (!$isJsValidated && ereg('[\, ]', $nick))
{
! $error = L_ERR_USR_16;
}
else if (C_NO_SWEAR && checkWords($nick, true))
{
! $error = L_ERR_USR_18;
}
--- 120,139 ----
{
if (C_NO_SWEAR)
! {
! include('./lib/swearing.lib.' . C_EXTENSION);
! }
// Validates the nick
if (!$isJsValidated && trim($nick) == '')
{
! $error = L_ERR_USR_5;
}
else if (!$isJsValidated && ereg('[\, ]', $nick))
{
! $error = L_ERR_USR_16;
}
else if (C_NO_SWEAR && checkWords($nick, true))
{
! $error = L_ERR_USR_18;
}
***************
*** 133,137 ****
else if (!$isJsValidated && $password == '')
{
! $error = L_ERR_USR_6;
}
--- 141,145 ----
else if (!$isJsValidated && $password == '')
{
! $error = L_ERR_USR_6;
}
***************
*** 139,143 ****
else if (!$isJsValidated && (trim($firstName) == '' || trim($lastName) == ''))
{
! $error = L_ERR_USR_15;
}
--- 147,151 ----
else if (!$isJsValidated && (trim($firstName) == '' || trim($lastName) == ''))
{
! $error = L_ERR_USR_15;
}
***************
*** 145,154 ****
else if (!$isJsValidated && trim($email) == '')
{
! $error = L_ERR_USR_7;
}
else if (!$isJsValidated &&
!eregi('^([0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-wyz][a-z](fo|g|l|m|mes|o|op|pa|ro|seum|t|u|v|z)?)$', $email))
{
! $error = L_ERR_USR_8;
}
--- 153,162 ----
else if (!$isJsValidated && trim($email) == '')
{
! $error = L_ERR_USR_7;
}
else if (!$isJsValidated &&
!eregi('^([0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-wyz][a-z](fo|g|l|m|mes|o|op|pa|ro|seum|t|u|v|z)?)$', $email))
{
! $error = L_ERR_USR_8;
}
***************
*** 175,179 ****
// 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)
--- 183,187 ----
// If password are generated and sent by e-mail, do it if e-mail has
// changed
! if (empty($error)
&& C_EMAIL_PASWD
&& $dbSessionVars['prevEmail'] != $email)
***************
*** 198,214 ****
{
$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 = '';
}
--- 206,227 ----
{
$error = sprintf(L_EMAIL_VAL_ERR, C_REG_EMAIL, C_REG_SENDER);
+ $isMailFail = true;
}
+ else
+ {
+ $isMailSent = true;
+ }
unset($mailHandler);
} // end of send new password by e-mail
// Udpates the profile
! if (empty($error))
{
$slashedPswd = pmcSlashSingleQuotes(str_replace('\\', '\\\\', $password));
$latin1 = (L_CHARSET == 'iso-8859-1') ? 1 : 0;
$showEmail = (isset($showEmail) && $showEmail) ? 1 : 0;
! if (empty($gender))
{
! $gender = 0;
}
***************
*** 218,222 ****
// 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'])
{
--- 231,235 ----
// 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'])
{
***************
*** 227,231 ****
$dbSessionVars['authPassword'] = $password;
}
! $message = L_REG_17;
$isRegDone = true;
}
--- 240,244 ----
$dbSessionVars['authPassword'] = $password;
}
! $success = L_REG_17;
$isRegDone = true;
}
***************
*** 308,315 ****
<table border="0">
<tr>
! <th colspan="2" class="tabTitle"><?php echo(($isRegDone) ? $message : L_REG_34); ?></th>
</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>
--- 321,328 ----
<table border="0">
<tr>
! <th colspan="2" class="tabTitle"><?php echo(($isRegDone) ? $success : L_REG_34); ?></th>
</tr>
<tr>
! <th colspan="2"><?php if (!$isRegDone && !$isMailFail) echo(L_REG_37); else if ($isSentMail) echo(L_EMAIL_VAL_DONE); ?></th>
</tr>
<tr><td> </td></tr>
***************
*** 330,337 ****
{
?>
! <input type="text" name="nick" size="11" maxlength="10" value="<?php echo(htmlspecialchars($nick)); ?>"<?php if ($isRegDone) echo(' readonly="readonly"'); ?> />
<?php
! if (!$isRegDone)
echo("\t\t\t" . '<span class="error">*</span>' . "\n");
}
echo("\n");
--- 343,352 ----
{
?>
! <input type="text" name="nick" size="11" maxlength="10" value="<?php echo(htmlspecialchars($nick)); ?>"<?php if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> />
<?php
! if (!$isRegDone && !$isMailFail)
! {
echo("\t\t\t" . '<span class="error">*</span>' . "\n");
+ }
}
echo("\n");
***************
*** 342,346 ****
// Do not display the password if e-mail validation is required and the e-mail
// has changed
! if (!(C_EMAIL_PASWD && $isRegDone))
{
?>
--- 357,361 ----
// Do not display the password if e-mail validation is required and the e-mail
// has changed
! if (!$isSentMail)
{
?>
***************
*** 349,353 ****
<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>
--- 364,368 ----
<td valign="top">
<input type="password" name="password" size="11" maxlength="16" value="<?php echo(htmlspecialchars($dbSessionVars['authPassword'])); ?>" />
! <?php if (!$isRegDone && !$isMailFail) echo('<span class="error">*</span>'); ?>
</td>
</tr>
***************
*** 359,364 ****
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_30); ?> :</td>
<td valign="top">
! <input type="text" name="firstName" size="11" maxlength="64" value="<?php echo(htmlspecialchars($firstName)); ?>"<?php if ($isRegDone) echo(' readonly="readonly"'); ?> />
! <?php if (!$isRegDone) echo('<span class="error">*</span>'); ?>
</td>
</tr>
--- 374,379 ----
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_30); ?> :</td>
<td valign="top">
! <input type="text" name="firstName" size="11" maxlength="64" value="<?php echo(htmlspecialchars($firstName)); ?>"<?php if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> />
! <?php if (!$isRegDone && !$isMailFail) echo('<span class="error">*</span>'); ?>
</td>
</tr>
***************
*** 366,371 ****
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_31); ?> :</td>
<td valign="top">
! <input type="text" name="lastName" size="11" maxlength="64" value="<?php echo(htmlspecialchars($lastName)); ?>"<?php if ($isRegDone) echo(' readonly="readonly"'); ?> />
! <?php if (!$isRegDone) echo('<span class="error">*</span>'); ?>
</td>
</tr>
--- 381,386 ----
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_31); ?> :</td>
<td valign="top">
! <input type="text" name="lastName" size="11" maxlength="64" value="<?php echo(htmlspecialchars($lastName)); ?>"<?php if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> />
! <?php if (!$isRegDone && !$isMailFail) echo('<span class="error">*</span>'); ?>
</td>
</tr>
***************
*** 373,378 ****
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_45); ?> :</td>
<td valign="top">
! <input type="radio" name="gender" value="1"<?php if (isset($gender) && $gender == 1) echo(' checked="checked"'); if ($isRegDone) echo(' readonly="readonly"'); ?> /> <?php echo(L_REG_46); ?><br />
! <input type="radio" name="gender" value="2"<?php if (isset($gender) && $gender == 2) echo(' checked="checked"'); if ($isRegDone) echo(' readonly="readonly"'); ?> /> <?php echo(L_REG_47); ?>
</td>
</tr>
--- 388,393 ----
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_45); ?> :</td>
<td valign="top">
! <input type="radio" name="gender" value="1"<?php if (isset($gender) && $gender == 1) echo(' checked="checked"'); if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> /> <?php echo(L_REG_46); ?><br />
! <input type="radio" name="gender" value="2"<?php if (isset($gender) && $gender == 2) echo(' checked="checked"'); if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> /> <?php echo(L_REG_47); ?>
</td>
</tr>
***************
*** 380,384 ****
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_36); ?> :</td>
<td valign="top">
! <input type="text" name="spokenLang" size="11" maxlength="64" value="<?php echo(htmlspecialchars($spokenLang)); ?>"<?php if ($isRegDone) echo(' readonly="readonly"'); ?> />
</td>
</tr>
--- 395,399 ----
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_36); ?> :</td>
<td valign="top">
! <input type="text" name="spokenLang" size="11" maxlength="64" value="<?php echo(htmlspecialchars($spokenLang)); ?>"<?php if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> />
</td>
</tr>
***************
*** 386,390 ****
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_32); ?> :</td>
<td valign="top">
! <input type="text" name="webSite" size="11" maxlength="64" value="<?php echo(htmlspecialchars($webSite)); ?>"<?php if ($isRegDone) echo(' readonly="readonly"'); ?> />
</td>
</tr>
--- 401,405 ----
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_32); ?> :</td>
<td valign="top">
! <input type="text" name="webSite" size="11" maxlength="64" value="<?php echo(htmlspecialchars($webSite)); ?>"<?php if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> />
</td>
</tr>
***************
*** 392,402 ****
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_8); ?> :</td>
<td valign="top">
! <input type="text" name="email" size="11" maxlength="64" value="<?php echo($email); ?>"<?php if ($isRegDone) echo(' readonly="readonly"'); ?> />
! <?php if (!$isRegDone) echo('<span class="error">*</span>'); ?>
</td>
</tr>
<tr>
<td colspan="2" align="center">
! <input type="checkbox" name="showEmail" value="1"<?php if (isset($showEmail) && $showEmail) echo(' checked="checked"'); if ($isRegDone) echo(' readonly="readonly"'); ?> />
<?php echo(L_REG_33); ?>
</td>
--- 407,417 ----
<td align="right" valign="top" nowrap="nowrap"><?php echo(L_REG_8); ?> :</td>
<td valign="top">
! <input type="text" name="email" size="11" maxlength="64" value="<?php echo($email); ?>"<?php if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> />
! <?php if (!$isRegDone && !$isMailFail) echo('<span class="error">*</span>'); ?>
</td>
</tr>
<tr>
<td colspan="2" align="center">
! <input type="checkbox" name="showEmail" value="1"<?php if (isset($showEmail) && $showEmail) echo(' checked="checked"'); if ($isRegDone || $isMailFail) echo(' readonly="readonly"'); ?> />
<?php echo(L_REG_33); ?>
</td>
***************
*** 405,409 ****
<br /><br />
<?php
! if (!$isRegDone)
{
?>
--- 420,424 ----
<br /><br />
<?php
! if (!$isRegDone && !$isMailFail)
{
?>
***************
*** 432,436 ****
dbSessionUnregister($toUnreg);
}
! else
{
$dbSessionVars['prevEmail'] = $email;
--- 447,451 ----
dbSessionUnregister($toUnreg);
}
! else if (!$isMailFail)
{
$dbSessionVars['prevEmail'] = $email;
Index: profile_del.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/profile_del.php3,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** profile_del.php3 2001/04/19 20:25:35 1.8
--- profile_del.php3 2001/06/01 20:44:40 1.9
***************
*** 85,90 ****
}
// If user is admininistrator, defines a message to avoid profile deletion
if ($dbSessionVars['delProfilePerms'] == 'admin')
! $message = L_ERR_USR_12;
--- 85,93 ----
}
// If user is admininistrator, defines a message to avoid profile deletion
+ $message = '';
if ($dbSessionVars['delProfilePerms'] == 'admin')
! {
! $message = L_ERR_USR_12;
! }
***************
*** 152,156 ****
<tr>
<td valign="top" align="center">
! <?php echo((isset($message))? $message : L_REG_19); echo("\n"); ?>
</td>
</tr>
--- 155,159 ----
<tr>
<td valign="top" align="center">
! <?php echo((!empty($message))? $message : L_REG_19); echo("\n"); ?>
</td>
</tr>
***************
*** 158,162 ****
<br /><br />
<?php
! if (!isset($message))
{
?>
--- 161,165 ----
<br /><br />
<?php
! if (empty($message))
{
?>
Index: messages_low.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/messages_low.php3,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** messages_low.php3 2001/05/20 18:56:28 1.17
--- messages_low.php3 2001/06/01 20:44:40 1.18
***************
*** 164,168 ****
else
{
! $today = date('j', time());
reset($grabedMessages);
for ($k = 0; $k < $grabedMessagesCnt; $k++)
--- 164,169 ----
else
{
! $today = date('j', time());
! $isDaySeparator = false;
reset($grabedMessages);
for ($k = 0; $k < $grabedMessagesCnt; $k++)
***************
*** 176,189 ****
// Skip the oldest message if the day seperator has been added
! if (isset($daySeparator) && $k == $grabedMessagesCnt - 1)
continue;
// Separator between messages sent before today and other ones
! if (!isset($daySeparator)
&& date('j', $sentTime) != $today)
{
$daySeparatorMsg = ($dbSessionVars['msgOrder'] == 0) ? L_TODAY_UP : L_TODAY_DWN;
$newMessages[] = '<p class="msg"><span class="notify">--------- ' . $daySeparatorMsg . ' ---------</span></p>';
! $daySeparator = 1;
unset($daySeparatorMsg);
}
--- 177,192 ----
// Skip the oldest message if the day seperator has been added
! if ($isDaySeparator && $k == $grabedMessagesCnt - 1)
! {
continue;
+ }
// Separator between messages sent before today and other ones
! if (!$isDaySeparator
&& date('j', $sentTime) != $today)
{
$daySeparatorMsg = ($dbSessionVars['msgOrder'] == 0) ? L_TODAY_UP : L_TODAY_DWN;
$newMessages[] = '<p class="msg"><span class="notify">--------- ' . $daySeparatorMsg . ' ---------</span></p>';
! $isDaySeparator = true;
unset($daySeparatorMsg);
}
***************
*** 193,197 ****
--- 196,202 ----
// The timestamp of the message
if ($dbSessionVars['showTimestamp'] == 1)
+ {
$aMessage .= '<span class="time">' . date('H:i:s', $sentTime + C_TMZ_OFFSET * 60 * 60) . '</span> ';
+ }
// 'Standard' messages
if (substr($sender,0,4) != 'SYS ')
***************
*** 201,205 ****
--- 206,212 ----
$sender = '<a href="#" onclick="window.parent.pmcUserClick(\'' . $slashedSender . '\', true); return false" class="sender">' . $simpleSender . '</a>';
if ($addressee != '')
+ {
$addressee = ']<bdo dir="' . $textDirection . '"></bdo>>[' . htmlspecialchars($addressee);
+ }
$aMessage .= '<b>[' . $sender . $addressee . ']<bdo dir="' . $textDirection .'"></bdo></b> '
. '<font color="' . $msgColor . '">' . $message . '</font>';
***************
*** 216,220 ****
--- 223,229 ----
{
if ($addressee != '')
+ {
$aMessage .= '<b>>[' . htmlspecialchars($addressee) . ']<bdo dir="' . $textDirection . '"></bdo></b> ';
+ }
if (strpos($message, 'printf('))
{
***************
*** 252,256 ****
--- 261,267 ----
<?php
if ($dbSessionVars['refreshDelay'] > 0)
+ {
echo('<meta http-equiv="Refresh" content="' . $dbSessionVars['refreshDelay'] . '; url=' . $refreshUrl . '" />' . "\n");
+ }
?>
<link rel="stylesheet" href="<?php echo($cssUrl); ?>" type="text/css" />
Index: loader.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/loader.php3,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** loader.php3 2001/05/17 19:28:14 1.20
--- loader.php3 2001/06/01 20:44:40 1.21
***************
*** 206,214 ****
{
if ($isInitLoad)
$newMessages[] = '<span class="notify">' . L_NO_MSG . '<\/span>';
}
else
{
! $today = date('j', time());
reset($grabedMessages);
for ($k = 0; $k < $grabedMessagesCnt; $k++)
--- 206,217 ----
{
if ($isInitLoad)
+ {
$newMessages[] = '<span class="notify">' . L_NO_MSG . '<\/span>';
+ }
}
else
{
! $today = date('j', time());
! $isDaySeparator = false;
reset($grabedMessages);
for ($k = 0; $k < $grabedMessagesCnt; $k++)
***************
*** 222,234 ****
// Skip the oldest message if the day seperator has been added
! if (isset($daySeparator) && $isInitLoad && $k == $grabedMessagesCnt - 1)
continue;
// Separator between messages sent before today and other ones
! if (!isset($daySeparator)
&& date('j', $sentTime) != $today)
{
$newMessages[] = '<p class="msg"><span class="notify">--------- ' . L_TODAY_DWN . ' ---------<\/span><\/p>';
! $daySeparator = 1;
}
--- 225,239 ----
// Skip the oldest message if the day seperator has been added
! if ($isDaySeparator && $isInitLoad && $k == $grabedMessagesCnt - 1)
! {
continue;
+ }
// Separator between messages sent before today and other ones
! if (!$isDaySeparator
&& date('j', $sentTime) != $today)
{
$newMessages[] = '<p class="msg"><span class="notify">--------- ' . L_TODAY_DWN . ' ---------<\/span><\/p>';
! $isDaySeparator = true;
}
***************
*** 237,241 ****
--- 242,248 ----
// The timestamp of the message
if ($dbSessionVars['showTimestamp'] == 1)
+ {
$aMessage .= '<span class="time">' . date('H:i:s', $sentTime + C_TMZ_OFFSET * 60 * 60) . '<\/span> ';
+ }
// 'Standard' messages
if (substr($sender,0,4) != 'SYS ')
***************
*** 245,249 ****
--- 252,258 ----
$sender = '<a href="#" onclick="window.parent.pmcUserClick(\'' . $slashedSender . '\', true); return false" class="sender">' . $simpleSender . '<\/a>';
if ($addressee != '')
+ {
$addressee = ']<bdo dir="' . $textDirection . '"><\/bdo>>[' . htmlspecialchars($addressee);
+ }
$aMessage .= '<b>[' . $sender . $addressee . ']<bdo dir="' . $textDirection .'"><\/bdo><\/b> '
. '<font color="' . $msgColor . '">' . $message . '<\/font>';
***************
*** 260,264 ****
--- 269,275 ----
{
if ($addressee != '')
+ {
$aMessage .= '<b>>[' . htmlspecialchars($addressee) . ']<bdo dir="' . $textDirection . '"><\/bdo><\/b> ';
+ }
if (strpos($message, 'printf('))
{
***************
*** 276,280 ****
--- 287,293 ----
$newMessages[] = $aMessage;
if ($sentTime > $lastMsgLoad)
+ {
$lastMsgLoad = $sentTime;
+ }
}
} // end of formatting new messages
***************
*** 300,304 ****
--- 313,319 ----
<?php
if ($dbSessionVars['refreshDelay'] > 0)
+ {
echo('<meta http-equiv="Refresh" content="' . $dbSessionVars['refreshDelay'] . '; url=' . $refreshUrl . '" />' . "\n");
+ }
?>
<script type="text/javascript" language="javascript">
Index: input.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/input.php3,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -r1.37 -r1.38
*** input.php3 2001/05/30 08:07:12 1.37
--- input.php3 2001/06/01 20:44:40 1.38
***************
*** 115,124 ****
// set default color to black
if (empty($color))
$color = (isset($cookieColor)) ? $cookieColor : '#000000';
// Red colors are reserved to the admin or a moderator for the current room
if (ereg('#(FF0000|fc3f40|fc4b34|fa582a|f66421|f27119|ec7e11|ec117f|f21971|f62164|fa2a58|fc344b)', $color)
&& ($dbSessionVars['status'] != 'a' && $dbSessionVars['status'] != 'm'))
! $color = '#000000';
// Cookie expires in one year
--- 115,128 ----
// set default color to black
if (empty($color))
+ {
$color = (isset($cookieColor)) ? $cookieColor : '#000000';
+ }
// Red colors are reserved to the admin or a moderator for the current room
if (ereg('#(FF0000|fc3f40|fc4b34|fa582a|f66421|f27119|ec7e11|ec117f|f21971|f62164|fa2a58|fc344b)', $color)
&& ($dbSessionVars['status'] != 'a' && $dbSessionVars['status'] != 'm'))
! {
! $color = '#000000';
! }
// Cookie expires in one year
***************
*** 134,137 ****
--- 138,145 ----
$isPopup = false;
$displayMessage = false;
+ $error = '';
+ $success = '';
+ $htmlPopupLink = '';
+ $jsToRun = '';
if (isset($message) && trim($message) != '')
{
***************
*** 147,151 ****
// Tests for 'true' messages
if ((!isset($prevMessage) || $message != str_replace('"', '"', $prevMessage))
! && !($isCommand || isset($error)))
{
// Format original message and set enhanced one (with graphical smilies)
--- 155,159 ----
// Tests for 'true' messages
if ((!isset($prevMessage) || $message != str_replace('"', '"', $prevMessage))
! && (!$isCommand && empty($error) && empty($success)))
{
// Format original message and set enhanced one (with graphical smilies)
***************
*** 214,218 ****
// - the submission before the last if the '/!' command was the last one;
// - the last submission itself else.
! if (!isset($message))
{
$newPrevMessage = '';
--- 222,226 ----
// - the submission before the last if the '/!' command was the last one;
// - the last submission itself else.
! if (empty($message))
{
$newPrevMessage = '';
***************
*** 231,235 ****
$msgValue = str_replace('"', '"', $prevMessage);
}
! else if (isset($error))
{
$msgValue = str_replace('"', '"', $message);
--- 239,243 ----
$msgValue = str_replace('"', '"', $prevMessage);
}
! else if (!empty($error))
{
$msgValue = str_replace('"', '"', $message);
***************
*** 281,285 ****
{
// Error message defined by a command
! if (isset($error))
{
$lowMessage = '<span class="error">'
--- 289,293 ----
{
// Error message defined by a command
! if (!empty($error))
{
$lowMessage = '<span class="error">'
***************
*** 288,292 ****
}
// Success message defined by a command
! else if (isset($success))
{
$lowMessage = '<span class="success">'
--- 296,300 ----
}
// Success message defined by a command
! else if (!empty($success))
{
$lowMessage = '<span class="success">'
***************
*** 295,299 ****
}
// Popup link
! else if (isset($htmlPopupLink))
{
$lowMessage = $htmlPopupLink;
--- 303,307 ----
}
// Popup link
! else if (!empty($htmlPopupLink))
{
$lowMessage = $htmlPopupLink;
***************
*** 387,391 ****
--- 395,401 ----
var colorCnt = window.parent.jsColorPicker.length;
for (k = 0; k < colorCnt; k++)
+ {
document.writeln(window.parent.jsColorPicker[k]);
+ }
window.parent.jsColorPicker = null;
// -->
***************
*** 486,492 ****
* 'chat/lib/common.lib.php3' library
*/
! if (isset($error) || isset($success))
{
! $alertMsg = (isset($error)) ? $error : $success;
?>
<script type="text/javascript" language="javascript">
--- 496,502 ----
* 'chat/lib/common.lib.php3' library
*/
! if (!empty($error) || !empty($success))
{
! $alertMsg = (!empty($error)) ? $error : $success;
?>
<script type="text/javascript" language="javascript">
***************
*** 504,508 ****
* Put JavaScript instructions that commands may have set
*/
! if (isset($jsToRun))
{
$jsToRunCnt = count($jsToRun);
--- 514,518 ----
* Put JavaScript instructions that commands may have set
*/
! if (is_array($jsToRun))
{
$jsToRunCnt = count($jsToRun);
Index: handle_input.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/handle_input.php3,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** handle_input.php3 2001/05/30 19:25:21 1.30
--- handle_input.php3 2001/06/01 20:44:40 1.31
***************
*** 111,120 ****
// set default color to black
if (empty($color))
$color = (isset($cookieColor)) ? $cookieColor : '#000000';
// Red colors are reserved to the admin or a moderator for the current room
if (ereg('#(FF0000|fc403f|fc4b34|fa582a|f66421|f27119|ec7e11|ec117f|f21971|f62164|fa2a58|fc344b)', $color)
&& ($dbSessionVars['status'] != 'a' && $dbSessionVars['status'] != 'm'))
! $color = '#000000';
// Cookie expires in one year
--- 111,124 ----
// set default color to black
if (empty($color))
+ {
$color = (isset($cookieColor)) ? $cookieColor : '#000000';
+ }
// Red colors are reserved to the admin or a moderator for the current room
if (ereg('#(FF0000|fc403f|fc4b34|fa582a|f66421|f27119|ec7e11|ec117f|f21971|f62164|fa2a58|fc344b)', $color)
&& ($dbSessionVars['status'] != 'a' && $dbSessionVars['status'] != 'm'))
! {
! $color = '#000000';
! }
// Cookie expires in one year
***************
*** 130,133 ****
--- 134,140 ----
$isPopup = false;
$displayMessage = false;
+ $error = '';
+ $success = '';
+ $jsToRun = '';
if (isset($message) && trim($message) != '')
{
***************
*** 143,147 ****
// Tests for 'true' messages
if ((!isset($prevMessage) || $message != $prevMessage)
! && !($isCommand || isset($error)))
{
// Format original message and set enhanced one (with graphical smilies)
--- 150,154 ----
// Tests for 'true' messages
if ((!isset($prevMessage) || $message != $prevMessage)
! && (!$isCommand && empty($error) && empty($success)))
{
// Format original message and set enhanced one (with graphical smilies)
***************
*** 200,204 ****
$msgValue = addslashes($prevMessage);
}
! else if (isset($error))
{
$msgValue = addslashes($message);
--- 207,211 ----
$msgValue = addslashes($prevMessage);
}
! else if (!empty($error))
{
$msgValue = addslashes($message);
***************
*** 228,232 ****
{
elements['sent'].value = '0';
! elements['prevMessage'].value = '<?php echo(isset($message) ? addslashes($message) : ''); ?>';
elements['msgTo'].value = '';
elements['message'].value = '<?php echo($msgValue); ?>';
--- 235,239 ----
{
elements['sent'].value = '0';
! elements['prevMessage'].value = '<?php echo(!empty($message) ? addslashes($message) : ''); ?>';
elements['msgTo'].value = '';
elements['message'].value = '<?php echo($msgValue); ?>';
***************
*** 273,279 ****
* 'chat/lib/common.lib.php3' script
*/
! if (isset($error) || isset($success))
{
! $alertMsg = (isset($error)) ? $error : $success;
echo("\n");
?>
--- 280,286 ----
* 'chat/lib/common.lib.php3' script
*/
! if (!empty($error) || !empty($success))
{
! $alertMsg = (!empty($error)) ? $error : $success;
echo("\n");
?>
***************
*** 327,331 ****
* Display JavaScript instructions that commands may have set
*/
! if (isset($jsToRun))
{
$jsToRunCnt = count($jsToRun);
--- 334,338 ----
* Display JavaScript instructions that commands may have set
*/
! if (is_array($jsToRun))
{
$jsToRunCnt = count($jsToRun);
|