Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands
In directory usw-pr-cvs1:/tmp/cvs-serv15026/chat/lib/commands
Modified Files:
announce.cmd.php3 banish.cmd.php3 join.cmd.php3 kick.cmd.php3
promote.cmd.php3 whois.cmd.php3
Log Message:
Begin right levels improvement
Index: announce.cmd.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands/announce.cmd.php3,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** announce.cmd.php3 2001/06/10 14:57:48 1.10
--- announce.cmd.php3 2001/12/04 20:01:33 1.11
***************
*** 36,79 ****
/**
! * The current user is administrator -> insert the message in the 'messages'
! * table
*/
! if ($dbSessionVars['status'] == 10)
{
! // Format original message and set enhanced one (with graphical smilies)
! $originalMessage = formatMessage($cmd[1]);
! $enhancedMessage = $originalMessage;
! if (C_MAX_GSMILIES)
! {
! include('./lib/smilies.lib.' . C_EXTENSION);
! pmcCheckForSmilies($enhancedMessage);
! unset($smilies);
! }
!
! // Put the message in the 'messages' table
! $msgQuery = 'INSERT INTO ' . C_MSG_TBL . ' '
! . '(room, username, latin1, m_time, color, msg_original, msg_enhanced) '
! . 'VALUES ('
! . "'\\\*\\\', "
! . "'SYS announce', "
! . $latin1 . ', '
! . time() . ', '
! . '\'' . $color . '\', '
! . '\'' . pmcSlashSingleQuotes($originalMessage) . '\', '
! . '\'' . pmcSlashSingleQuotes($enhancedMessage) . '\''
! . ')';
! $dbLink->query($msgQuery);
!
! $isCommand = true;
! $doRefreshMessages = true;
}
! /**
! * The current user is not adminsitrator -> set an error message
! */
! else
! {
! $error = L_NO_ADMIN;
! }
?>
--- 36,67 ----
/**
! * Insert the message in the 'messages' table
*/
! // Format original message and set enhanced one (with graphical smilies)
! $originalMessage = formatMessage($cmd[1]);
! $enhancedMessage = $originalMessage;
! if (C_MAX_GSMILIES)
{
! include('./lib/smilies.lib.' . C_EXTENSION);
! pmcCheckForSmilies($enhancedMessage);
! unset($smilies);
}
! // Put the message in the 'messages' table
! $msgQuery = 'INSERT INTO ' . C_MSG_TBL . ' '
! . '(room, username, latin1, m_time, color, msg_original, msg_enhanced) '
! . 'VALUES ('
! . "'\\\*\\\', "
! . "'SYS announce', "
! . $latin1 . ', '
! . time() . ', '
! . '\'' . $color . '\', '
! . '\'' . pmcSlashSingleQuotes($originalMessage) . '\', '
! . '\'' . pmcSlashSingleQuotes($enhancedMessage) . '\''
! . ')';
! $dbLink->query($msgQuery);
!
! $isCommand = true;
! $doRefreshMessages = true;
?>
Index: banish.cmd.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands/banish.cmd.php3,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** banish.cmd.php3 2001/06/10 14:57:48 1.12
--- banish.cmd.php3 2001/12/04 20:01:34 1.13
***************
*** 44,55 ****
/**
- * Ensure the current user is allowed to use the 'banish' command
- */
- else if ($dbSessionVars['status'] < 5)
- {
- $error = L_NO_MODERATOR;
- }
-
- /**
* Ensure the current user is allowed to 'banish' the target user before doing
* the work
--- 44,47 ----
***************
*** 64,68 ****
// Define an additional condition for moderators so they can only banish an
// user from their current room
! $queryRoomPart = ($dbSessionVars['status'] == 5)
? 'room = \'' . $slashedCurrentRoomName . '\' AND '
: '';
--- 56,60 ----
// Define an additional condition for moderators so they can only banish an
// user from their current room
! $queryRoomPart = ($dbSessionVars['status'] < $rightLevels['cmd_banish_adv'])
? 'room = \'' . $slashedCurrentRoomName . '\' AND '
: '';
***************
*** 89,93 ****
{
$targetCurrentRoom = pmcHandleMagicQuotes($targetCurrentRoom, '', 1, 'del');
! if ($cmd[1] == '* ' && $dbSessionVars['status'] < 10)
{
$cmd[1] = '';
--- 81,85 ----
{
$targetCurrentRoom = pmcHandleMagicQuotes($targetCurrentRoom, '', 1, 'del');
! if ($cmd[1] == '* ' && $dbSessionVars['status'] < $rightLevels['cmd_banish_adv'])
{
$cmd[1] = '';
Index: join.cmd.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands/join.cmd.php3,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** join.cmd.php3 2001/11/29 22:00:56 1.13
--- join.cmd.php3 2001/12/04 20:01:34 1.14
***************
*** 151,155 ****
// 3. Ensure the user is not banished from the room he wants to enter in
! if (empty($error) && C_BANISH && $dbSessionVars['status'] < 10)
{
if (!function_exists('pmcCheckBanish'))
--- 151,155 ----
// 3. Ensure the user is not banished from the room he wants to enter in
! if (empty($error) && C_BANISH && $dbSessionVars['status'] < 7)
{
if (!function_exists('pmcCheckBanish'))
Index: kick.cmd.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands/kick.cmd.php3,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** kick.cmd.php3 2001/06/10 14:57:48 1.6
--- kick.cmd.php3 2001/12/04 20:01:34 1.7
***************
*** 44,56 ****
/**
- * Ensure the current user is allowed to use the 'kick' command
- */
- else if ($dbSessionVars['status'] < 5)
- {
- $error = L_NO_MODERATOR;
- }
-
-
- /**
* Ensure the current user is allowed to 'kick' the target user before doing
* the work
--- 44,47 ----
***************
*** 65,69 ****
// Define an additional condition for moderators so they can only kick an
// user from their current room
! $queryRoomPart = ($dbSessionVars['status'] == 5)
? 'room = \'' . $slashedCurrentRoomName . '\' AND '
: '';
--- 56,60 ----
// Define an additional condition for moderators so they can only kick an
// user from their current room
! $queryRoomPart = ($dbSessionVars['status'] < $rightLevels['cmd_kick_adv'])
? 'room = \'' . $slashedCurrentRoomName . '\' AND '
: '';
Index: promote.cmd.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands/promote.cmd.php3,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** promote.cmd.php3 2001/06/10 14:57:48 1.7
--- promote.cmd.php3 2001/12/04 20:01:34 1.8
***************
*** 45,57 ****
/**
- * Ensure the current user is allowed to use the 'promote' command
- */
- else if ($dbSessionVars['status'] < 5)
- {
- $error = L_NO_MODERATOR;
- }
-
-
- /**
* Ensure the target user can be promoted before doing the work
*
--- 45,48 ----
Index: whois.cmd.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands/whois.cmd.php3,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** whois.cmd.php3 2001/06/10 14:57:48 1.10
--- whois.cmd.php3 2001/12/04 20:01:34 1.11
***************
*** 60,64 ****
if (!$isProfile)
{
! if ($dbSessionVars['status'] == 10 || $dbSessionVars['nick'] == $cmd[1])
{
$dbLink->query("SELECT ip FROM " . C_USR_TBL . " WHERE username='" . $slashedTarget . "' LIMIT 1");
--- 60,65 ----
if (!$isProfile)
{
! if ($dbSessionVars['status'] >= $rightLevels['cmd_whois_ip']
! || $dbSessionVars['nick'] == $cmd[1])
{
$dbLink->query("SELECT ip FROM " . C_USR_TBL . " WHERE username='" . $slashedTarget . "' LIMIT 1");
|