From: Lo?c C. <lo...@us...> - 2001-05-05 17:26:19
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/admin In directory usw-pr-cvs1:/tmp/cvs-serv25748/chat/admin Added Files: admin_top.php3 admin_body.php3 admin4.php3 admin3.php3 admin2.php3 admin1.php3 Log Message: First draft of the administration sheets --- 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 script displays the menu for the administration sheets at the top | // | of the administration webpage. | // | | // | It is called by the 'chat/admin.php3' script. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <te...@ph...> | // +--------------------------------------------------------------------------+ // // $Id: admin_top.php3,v 1.1 2001/05/05 17:26:17 loic1 Exp $ // // Menu for the administration work for phpMyChat. // /** * Displays the webpage * * Uses the 'pmcUrlForStyleSheet()' function defined inside the * 'chat/lib/common.lib.php3' script */ // The url for the style sheet $cssUrl = pmcUrlForStyleSheet('admin', A_CHARSET, (defined('A_FONT_NAME')) ? A_FONT_NAME : '', A_FONT_SIZE); // The url base for thumbnails links $thumbUrl = $dbSessionVars['adminFrom'] . '?' . dbSessionSID('GET') . $pmcQueryArgSeparator . 'adminSheet='; // Close the db session handler $dbSessionDbLink->close(); unset($dbSessionDbLink); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html dir="<?php echo((A_CHARSET == 'windows-1256') ? 'rtl' : 'ltr'); ?>"> <head> <title><?php echo(APP_NAME); ?></title> <link rel="stylesheet" href="<?php echo($cssUrl); ?>" type="text/css" /> </head> <body> <table align="right" border="0" cellpadding="3" cellspacing="0" class="menu"> <tr> <td align="left" valign="bottom" nowrap="nowrap" class="menuTitle"> <img src="images/sel_color.gif" width="5" alt="" /><?php echo(sprintf(A_MENU_0, APP_NAME) . "\n"); ?> </td> <td align="left" valign="bottom" width="1500" class="menuTitle"> <img src="images/sel_color.gif" width="5" alt="" /> </td> <td align="center" nowrap="nowrap" class="thumbIndex"> <a href="<?php echo($thumbUrl); ?>1" target="_parent"<?php if ($dbSessionVars['adminSheet'] == 1) echo(' class="selected"'); ?>><?php echo(A_MENU_1); ?></a> </td> <td width="1"><img src="images/sel_color.gif" width="1" alt="" /></td> <td align="center" nowrap="nowrap" class="thumbIndex"> <a href="<?php echo($thumbUrl); ?>2" target="_parent"<?php if ($dbSessionVars['adminSheet'] == 2) echo(' class="selected"'); ?>><?php echo(A_MENU_2); ?></a> </td> <td width="1"><img src="images/sel_color.gif" width="1" alt="" /></td> <td align="center" nowrap="nowrap" class="thumbIndex"> <a href="<?php echo($thumbUrl); ?>3" target="_parent"<?php if ($dbSessionVars['adminSheet'] == 3) echo(' class="selected"'); ?>><?php echo(A_MENU_3); ?></a> </td> <?php // Display the thumbnail for the mail work? if (C_MAIL_FUNCTION) { echo("\n"); ?> <td width="1"><img src="images/sel_color.gif" width="1" alt="" /></td> <td align="center" nowrap="nowrap" class="thumbIndex"> <a href="<?php echo($thumbUrl); ?>4" target="_parent"<?php if ($dbSessionVars['adminSheet'] == 4) echo(' class="selected"'); ?>><?php echo(A_MENU_4); ?></a> </td> <?php } echo("\n"); ?> <td width="2"> <img src="images/sel_color.gif" width="2" alt="" /> </td> </tr> </table> </body> </html> <?php ?> --- 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 script displays the common part of the administration body, | // | whatever is the sheet to be displayed. | // | Here are defined some common variables, then the sheet corresponding | // | to what the administrator wants to do is included. | // | | // | It is called by the 'chat/admin.php3' script. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <te...@ph...> | // +--------------------------------------------------------------------------+ // // $Id: admin_body.php3,v 1.1 2001/05/05 17:26:17 loic1 Exp $ // // Common part of the administration body for phpMyChat. // /** * Ensure this script is called by the admin frameset (fix a security hole) */ if (!isset($dbSessionVars) || empty($dbSessionVars['authUsername'])) { exit(); } /** * Defines some variables */ // Target URLs for links and forms $adminBodyUrl = $dbSessionVars['adminFrom'] . '?' . dbSessionSID('GET') . $pmcQueryArgSeparator . 'whichFrame=body'; // Sorting and navigation links (for the 1st and the 2nd sheets) if ($dbSessionVars['adminSheet'] < 3) { $adminBodySortUrl = $adminBodyUrl . $pmcQueryArgSeparator . 'sortBy='; $invertSortOrder = $pmcQueryArgSeparator . 'sortOrder=' . (($dbSessionVars['sortOrder'] == 'ASC') ? 'DESC' : 'ASC'); $adminBodyNavigUrl = $adminBodyUrl . $pmcQueryArgSeparator . 'offset='; } // Horizontal alignement for cells topic and gifs names for the navigation bar if (A_CHARSET == 'windows-1256') // Arabic { $cellAlign = 'right'; $invertCellAlign = 'left'; $navBeginImg = 'end.gif'; $navDownImg = 'up.gif'; $navEndImg = 'begin.gif'; $navUpImg = 'down.gif'; } else { $cellAlign = 'left'; $invertCellAlign = 'right'; $navBeginImg = 'begin.gif'; $navDownImg = 'down.gif'; $navEndImg = 'end.gif'; $navUpImg = 'up.gif'; } // Instantiates a new DB object $dbLink = new pmcDB; /** * Optimizes tables when the script is ran for the first time */ if (dbSessionIsRegistered('adminDoOptimize')) { $dbLink->optimize(C_MSG_TBL); $dbLink->optimize(C_USR_TBL); $dbLink->optimize(C_REG_TBL); $dbLink->optimize(C_BAN_TBL); } /** * Displays the webpage * * Uses the 'pmcUrlForStyleSheet()' function defined inside the * 'chat/lib/common.lib.php3' script */ $cssUrl = pmcUrlForStyleSheet('admin', A_CHARSET, (defined('A_FONT_NAME')) ? A_FONT_NAME : '', A_FONT_SIZE); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html dir="<?php echo((A_CHARSET == 'windows-1256') ? 'rtl' : 'ltr'); ?>"> <head> <title><?php echo(APP_NAME); ?></title> <link rel="stylesheet" href="<?php echo($cssUrl); ?>" type="text/css" /> </head> <body> <center> <?php require('./admin/admin' . $dbSessionVars['adminSheet'] . '.' . C_EXTENSION); ?> </center> </body> </html> <?php // Save session data and kill the db session handler associated to sessions dbSessionSave(); $dbSessionDbLink->close(); unset($dbSessionDbLink); // Kills the opened DB instance (skipped because of Apache) // $dbLink->close(); ?> --- 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 is used when the administrator wants to send e-mails to some of the | // | registered users. | // | | // | It is called by the 'chat/admin_body.php3' script and requires the | // | 'chat/lib/admin_libs/admin_mail.lib.php3' library to have been | // | completed. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <te...@ph...> | // +--------------------------------------------------------------------------+ // // $Id: admin4.php3,v 1.1 2001/05/05 17:26:17 loic1 Exp $ // // Administration sheet to send e-mails to some of the registered users of // phpMyChat. // /** * The administrator has required an action to be done * * Uses the 'pmcHandleMagicQuotes()' function defined in the * 'chat/lib/common.lib.php3' library */ if (!empty($submitType)) { // Sends the e-mails when an user has been selected at least and subject // and message fields have been filled if (count($sendTo) > 0 && trim($subject) != '' && trim($message) != '') { $subject = pmcHandleMagicQuotes($subject, 1, '', 'del'); $message = pmcHandleMagicQuotes($message, 1, '', 'del'); if (!defined('_LIB_PHPMYMAILER_LOADED')) include('./lib/mailer.lib.' . C_EXTENSION); $mailHandler = new PHPMYMAILER(C_ADM_EMAIL, C_ADM_SENDER); $failedSending = array(); $sendToCnt = count($sendTo); reset($sendTo); for ($j = 0; $j < $sendToCnt; $j++) { $mailTo = $sendTo[$j]; // Get e-mail and nick of each of the selected users $splitted = explode(' ', $mailTo); $splitted[1] = pmcHandleMagicQuotes($splitted[1], 1, '', 'del'); $recipient[$splitted[0]] = array($splitted[1], ''); // Send the e-mail $mailHandler->pmmSendEmail( $recipient, A_CHARSET, $subject, $message, '', $priority); if (!$mailHandler->pmmIsSent) $failedSending[$splitted[1]] = $splitted[0]; unset($recipient); } $warning = (count($failedSending)) ? A_SHEET4_8 : A_SHEET4_7; $warningStyle = (count($failedSending)) ? 'error' : 'success'; unset($mailHandler); } else { $warning = A_SHEET4_9; $warningStyle = 'error'; } unset($sendTo); } /** * Displays the mailing sheet * * Uses the 'pmcHandleMagicQuotes()' and 'pmcSpecialChars()' functions that * are defined inside the 'chat/lib/common.lib.php3' script. */ ?> <p class="title"><?php echo(A_SHEET4_1); ?></p> <?php if (!empty($warning)) echo('<p class="' . $warningStyle . '">' . $warning . '</p><br />'. "\n"); ?> <table class="table"> <?php // Display an error message if the required settings aren't completed inside // the 'chat/config/config.php3' file if (C_ADM_SENDER == '' || C_ADM_EMAIL == '') { ?> <tr> <td align="center" class="error"><?php echo(A_SHEET4_0); ?></td> </tr> <?php } // end of the case where some required settings haven't been completed else { // Ensure at least one registered user exists (except the administrator) // before displaying the mail form $dbLink->query("SELECT COUNT(*) FROM " . C_REG_TBL . " WHERE perms != 'admin' LIMIT 1"); list($regUsersCnt) = $dbLink->nextRecord(); $dbLink->cleanResults(); if ($regUsersCnt != 0) { ?> <!-- Mail form --> <tr> <td align="center"> <form action="<?php echo($adminBodyUrl); ?>" method="post" autocomplete="off" name="adminMailForm"> <table border="0" cellspacing="5" width="100%"> <tr> <!-- Addressees list --> <td valign="top"> <table border="0" width="100%"> <tr> <td align="center"><?php echo(A_SHEET4_2); ?></td> </tr> <tr> <td align="center"> <select name="sendTo[]" multiple="multiple" size="15"> <?php echo("\n"); $dbLink->query("SELECT username, latin1, email FROM " . C_REG_TBL . " WHERE perms != 'admin' ORDER BY username"); while (list($username, $latin1, $email) = $dbLink->nextRecord()) { $username = pmcHandleMagicQuotes($username, '', '1', 'del'); $email = pmcHandleMagicQuotes($email, '', '1', 'del'); echo("\t\t\t\t\t\t\t\t"); echo('<option value="' . $email . ' ' . htmlspecialchars($username) . '">' . pmcSpecialChars($username, $latin1) . '</option>'); echo("\n"); } $dbLink->cleanResults(); ?> </select> </td> </tr> <tr><td> </td></tr> <tr> <td align="center"> <input type="button" value="<?php echo(A_SHEET4_3); ?>" onclick="for (var i = 0; i < document.forms['adminMailForm'].elements['sendTo[]'].options.length; i++) {document.forms['adminMailForm'].elements['sendTo[]'].options[i].selected=true;}" /> </td> </tr> </table> </td> <td> </td> <!-- Subject and message --> <td> <table border="0" width="100%"> <tr> <td valign="center" align="<?php echo($cellAlign); ?>"><?php echo(A_SHEET4_4); ?></td> <td valign="center" align="<?php echo($cellAlign); ?>"> <input type="text" name="subject" size="30" value="<?php echo('[' . APP_NAME . '] '); ?>" /> </td> <td valign="center" align="<?php echo($cellAlign); ?>"> <?php echo(A_SHEET4_10); ?> <select name="priority"> <option value="4"><?php echo(A_SHEET4_11); ?> </option> <option value="3" selected="selected"><?php echo(A_SHEET4_12); ?> </option> <option value="1"><?php echo(A_SHEET4_13); ?> </option> </select> </td> </tr> <tr> <td valign="top" align="<?php echo($cellAlign); ?>"><?php echo(A_SHEET4_5); ?></td> <td valign="middle" align="center" colspan="2"> <textarea name="message" cols="70" rows="14"></textarea> </td> </tr> <tr><td> </td></tr> <tr> <td> </td> <td valign="middle" align="<?php echo($invertCellAlign); ?>"> <input type="submit" name="submitType" value="<?php echo(A_SHEET4_6); ?>" /> </td> </tr> </table> </td> </tr> </table> </form> </td> </tr> <?php } // end of the case where some registered users exist else { ?> <tr> <td align="center" class="error"><?php echo(A_SHEET1_8); ?></td> </tr> <?php } } // end of the case where some required vars have been completed echo("\n"); ?> </table> <?php /** * Display the mail errors */ if (isset($failedSending) && count($failedSending)) { ?> <!-- Mail errors --> <p></p> <hr /> <p class="error"><a name="mailErrors"></a><font size="+1"><?php echo(A_SHEET4_14); ?></font></p> <table border="0" cellpadding="3" class="table"> <tr class="tabTitle"> <td valign="middle" align="center" class="tabTitle"> <?php echo(A_SHEET1_2); ?> </td> <td valign="middle" align="center" class="tabTitle"> <?php echo(A_SHEET4_15); ?> </td> </tr> <?php ksort($failedSending); // sort the array by nicks reset($failedSending); while(list($failedNick, $failedEmail) = each($failedSending)) { echo("\n"); ?> <tr> <td valign="middle" align="<?php echo($cellAlign); ?>"> <?php echo($failedNick . "\n"); ?> </td> <td valign="middle" align="<?php echo($cellAlign); ?>"> <?php echo($failedEmail . "\n"); ?> </td> </tr> <?php } echo("\n"); ?> </table> <?php } echo("\n"); ?> --- 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 script displays the list of existing rooms and allows to clean the | // | 'messages' table from some of them. | // | A function is defined inside: | // | - cleanRoom() = do clean the messages table from a room | // | | // | This script is called by the 'chat/admin_body.php3' script. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <te...@ph...> | // +--------------------------------------------------------------------------+ // // $Id: admin3.php3,v 1.1 2001/05/05 17:26:17 loic1 Exp $ // // Administration sheet to clean the existing rooms of phpMyChat. // /** * Cleans the messages table from a room * * @global string the room name * @global object the DB object to use * @global string the list of default public chat rooms * @global string the list of default private chat rooms * * @access private */ function cleanRoom() { global $room; global $dbLink; global $defaultChatRooms; global $defaultPrivateRooms; $room = pmcSlashSingleQuotes(pmcHandleMagicQuotes($room, 1, '', 'del')); // Kicks users that are chatting inside the room to be cleaned $dbLink->query("UPDATE " . C_USR_TBL . " SET status = 'd' WHERE room = '$room'"); $isAnybodyIn = 1; $delayTill = time() + 20; // let the time to users to be 'kicked' (max=20 sec) while ($isAnybodyIn != 0 && time() < $delayTill) { $dbLink->query("SELECT COUNT(*) FROM " . C_USR_TBL . " WHERE room = '$room'"); list($isAnybodyIn) = $dbLink->nextRecord(); $dbLink->cleanResults(); if ($isAnybodyIn == 0) sleep(2); } // Removes permissions for that room when it's not a default one (defined // in 'chat/config/config.lib.php3') if (pmcIsInto($room, $defaultChatRooms) == -1 || pmcIsInto($room, $defaultPrivateRooms) == -1) { $dbLink->query("SELECT username, rooms FROM " . C_REG_TBL . " WHERE perms = 'moderator'"); while (list($moderatorUsername, $moderatedRooms) = $dbLink->nextRecord()) { $moderatorUsername = pmcHandleMagicQuotes($moderatorUsername, '', 1, 'del'); $moderatorUsername = pmcSlashSingleQuotes($moderatorUsername); $moderatedRooms = pmcHandleMagicQuotes($moderatedRooms, '', 1, 'del'); $moderatedRooms = pmcSlashSingleQuotes($moderatedRooms); $changed = false; $rooms = explode(',', $moderatedRooms); $roomsCnt = count($rooms); reset($rooms); for ($j = 0; $j < $roomsCnt; $j++) { if (strcasecmp($room, $rooms[$j]) == 0) { $rooms[$j] = ''; $changed = true; break; } } if ($changed) { $moderatedRooms = implode(',', $rooms); $moderatedRooms = ereg_replace('^,|,$', '', $moderatedRooms); $moderatedRooms = str_replace(',,', ',', $moderatedRooms); $dbLink->query("UPDATE " . C_REG_TBL . " SET rooms = '$moderatedRooms' WHERE username = '$moderatorUsername'"); } unset($rooms); } $dbLink->cleanResults(); } // Clean the room; $dbLink->query("DELETE FROM " . C_USR_TBL . " WHERE room = '$room'"); $dbLink->query("DELETE FROM " . C_MSG_TBL . " WHERE room = '$room'"); }// end ot the function 'cleanRoom()' /** * The admin has required some rooms to be cleaned */ if (!empty($submitType)) { $delRoomsCnt = count($delRooms); reset($delRooms); for ($i = 0; $i < $delRoomsCnt; $i++) { $room = trim($delRooms[$i]); cleanRoom(); } // Optimize the messages table when a MySQL DB is used $dbLink->optimize(C_MSG_TBL); unset($delRooms); } // end of the case where the admin has required some rooms to be cleaned /** * Displays the sheet for cleaning rooms */ ?> <p class="title"><?php echo(A_SHEET3_1); ?></p> <table border="0" cellpadding="3" class="table"> <?php // Ensure at least one room can be cleaned before displaying the form to do this $dbLink->query("SELECT COUNT(*) FROM " . C_MSG_TBL . " LIMIT 1"); list($roomsCnt) = $dbLink->nextRecord(); $dbLink->cleanResults(); if ($roomsCnt != 0) { echo("\n"); ?> <!-- Form to clean rooms --> <tr> <td align="center"> <form action="<?php echo($adminBodyUrl); ?>" method="post" autocomplete="off" name="adminForm3"> <table border="0" width="100%"> <tr> <td valign="middle" align="center"> <font size="-1"><?php echo(A_SHEET3_2); ?></font> </td> </tr> <tr> <td align="center"> <select name="delRooms[]" multiple="multiple" size="6"> <?php echo("\n"); $dbLink->query("SELECT DISTINCT room FROM " . C_MSG_TBL . " ORDER BY room"); while (list($room) = $dbLink->nextRecord()) { if (trim($room) == '') continue; $room = pmcHandleMagicQuotes($room, '', 1, 'del'); echo("\t\t\t\t\t\t"); echo('<option value="' . htmlspecialchars($room) . '"'); echo('> ' . $room . ' </option>'); echo("\n"); } $dbLink->cleanResults(); ?> </select> </td> </tr> </table> <p> <input type="submit" name="submitType" value="<?php echo(A_SHEET3_3); ?>" /> </p> </form> </td> </tr> <?php } // end of the case where some rooms exist else { echo("\n"); ?> <tr> <td align="center" class="error"><?php echo(A_SHEET3_4); ?></td> </tr> <?php } echo("\n"); ?> </table> <?php ?> --- 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 script displays the list of banished users and allows to act on it | // | (ie remove or modify banishment properties for a profile. | // | Two functions are defined inside: | // | - delBanishment() = do remove all banishments for an user | // | - modifyBanishment() = do modify the banishment properties for an user | // | | // | This script is called by the 'chat/admin_body.php3' script. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <te...@ph...> | // +--------------------------------------------------------------------------+ // // $Id: admin2.php3,v 1.1 2001/05/05 17:26:17 loic1 Exp $ // // Administration sheet for users banished from phpMyChat. // /** * Removes all banishments for an user * * @global string the nick of the user to remove * @global object the DB object to use * * @access private */ function delBanishment() { global $username; global $dbLink; $slashedUsername = pmcSlashSingleQuotes($username); $dbLink->query("DELETE FROM " . C_BAN_TBL . " WHERE username = '$slashedUsername'"); } // end of the 'delBanishment()' function /** * Modifies the list of banished rooms of the ending date of banishment for * an user * * @global string the nick of the user to remove * @global object the DB object to use * @global string the new banishment expire date * @global string the new list of room the user will be banished from * * @access private */ function modifyBanishment() { global $username; global $dbLink; global $newBanishedUntil; global $newBanishedRooms; // Modify banishment properties for an user $untilQuery = ($newBanishedUntil == 'forever') ? ', ban_until = 2147483647' : ''; $slashedUsername = pmcSlashSingleQuotes($username); $dbLink->query("UPDATE " . C_BAN_TBL . " SET rooms = '" . pmcSlashSingleQuotes($newBanishedRooms) . "'$untilQuery WHERE username = '$slashedUsername'"); // Banish the user if he's currently chatting if ($newBanishedRooms == '*') // The user is banished from all rooms { $dbLink->query("UPDATE " . C_USR_TBL . " SET status = 'b' WHERE username = '$slashedUsername'"); } else // Check is the user is chatting inside a room he's now banished from { $dbLink->query("SELECT room FROM " . C_USR_TBL . " WHERE username = '$slashedUsername' LIMIT 1"); $isChatting = (list($targetRoom) = $dbLink->nextRecord()); if ($isChatting) // User is chatting { $targetRoom = pmcHandleMagicQuotes($targetRoom, '', '1', 'del'); $dbLink->cleanResults(); if (pmcIsInto($targetRoom, $newBanishedRooms) >= 0) // User is chatting in a room he's now banished from -> kick him $dbLink->query("UPDATE " . C_USR_TBL . " SET status = 'b' WHERE username = '$slashedUsername'"); } else { $dbLink->cleanResults(); } } } // end of the function 'modifyBanishment()' /** * The admin has required an action to be done * * The 'pmcSlashSingleQuotes()' and 'pmcHandleMagicQuotes()' functions are * defined inside the 'chat/lib/common.lib.php3' library * * @see delBanishment(), modifyBanishment() */ if (!empty($submitType)) { // Some banishments have to been removed ? $deleteMode = (pmcSlashSingleQuotes($submitType) == A_SHEET2_7) ? 1 : 0; // Get the list of the concerned registered users $modifOffset = ($dbSessionVars['offset'] - 5 > 0) ? $dbSessionVars['offset'] - 5 : 0; if (C_DB_TYPE == 'mysql') { $queryLimits = ' LIMIT ' . $modifOffset . ',20'; } else if (C_DB_TYPE == 'pgsql') { $queryLimits = ' LIMIT 20 OFFSET ' . $modifOffset; } else { $queryLimits = ''; } $dbLink->query("SELECT username FROM " . C_BAN_TBL . " ORDER BY " . $dbSessionVars['sortBy'] . " " . $dbSessionVars['sortOrder'] . $queryLimits); $banUsers = array(); while (list($username) = $dbLink->nextRecord()) { $banUsers[] = pmcHandleMagicQuotes($username, '', 1, 'del'); } $dbLink->cleanResults(); for (reset($banUsers); $username = current($banUsers); next($banUsers)) { $encodedUsername = urlencode($username); $varName = 'user_' . $encodedUsername; if (!isset($$varName)) continue; // Current user wasn't in the list displayed // Removes some banishments if ($deleteMode) { $varName = 'delete_' . $encodedUsername; if (isset($$varName)) delBanishment(); } // end of the case where some banishements have to been removed // Modify properties of banishment for the user else { $varName = 'rooms_' . $encodedUsername; $newBanishedRooms = pmcHandleMagicQuotes($$varName, 1, '', 'del'); $varName = 'until_' . $encodedUsername; $newBanishedUntil = $$varName; $varName = 'old_rooms_' . $encodedUsername; $oldBanishedRooms = pmcHandleMagicQuotes($$varName, 1, '', 'del'); $varName = 'old_until_' . $encodedUsername; $oldBanishedUntil = $$varName; if ($newBanishedRooms == $oldBanishedRooms && $newBanishedUntil == $oldBanishedUntil) continue; // No changes for this user modifyBanishment(); } // end of the case where banishment properties have to be modified } unset($banUsers); // Optimizes the registered users table when a MySQL DB is used $dbLink->optimize(C_BAN_TBL); } // end of the case where the admin has required an action to be done /** * Cleans the banished users table (time for banishment expires or no * room specified for banishment) */ $toCheck = 'rooms = \'\''; if (!isset($submitType)) $toCheck = 'ban_until < ' . time() . ' OR ' . $toCheck; $dbLink->query("DELETE FROM " . C_BAN_TBL . " WHERE $toCheck"); /** * Displays the banished users sheet */ ?> <p class="title"><?php echo(A_SHEET2_1); ?></p> <table border="0" cellpadding="3" class="table"> <?php // Ensure at least one banished user exist $dbLink->query("SELECT COUNT(*) FROM " . C_BAN_TBL . " LIMIT 1"); list($banUsersCnt) = $dbLink->nextRecord(); $dbLink->cleanResults(); if ($banUsersCnt != 0) { echo("\n"); ?> <!-- Banished users form --> <tr> <td align="center"> <form action="<?php echo($adminBodyUrl); ?>" method="post" autocomplete="off" name="adminForm2"> <table border="0" cellpadding="5" cellspacing="1" width="100%"> <tr class="tabTitle"> <td valign="middle" align="center"> </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"> <?php echo(A_SHEET2_3); ?> * </td> <td valign="middle" align="center" class="tabTitle"> <?php echo(A_SHEET2_4 . "\n"); ?> </td> </tr> <?php // Defines wich banished users profiles have to been displayed $lastPageOffset = floor(($banUsersCnt - 1) / 10) * 10; if ($dbSessionVars['offset'] > $lastPageOffset) $dbSessionVars['offset'] = $lastPageOffset; if (C_DB_TYPE == 'mysql') { $queryLimits = ' LIMIT ' . $dbSessionVars['offset'] . ',10'; } else if (C_DB_TYPE == 'pgsql') { $queryLimits = ' LIMIT 10 OFFSET ' . $dbSessionVars['offset']; } else { $queryLimits = ''; } // Gets these profiles $dbLink->query("SELECT username, latin1, ip, rooms, ban_until FROM " . C_BAN_TBL . " ORDER BY " . $dbSessionVars['sortBy'] . " " . $dbSessionVars['sortOrder'] . $queryLimits); while (list($username, $latin1, $ip, $rooms, $banUntil) = $dbLink->nextRecord()) { $username = pmcHandleMagicQuotes($username, '', 1, 'del'); $rooms = pmcHandleMagicQuotes($rooms, '', 1, 'del'); echo("\n"); ?> <tr> <td valign="middle" align="center"> <input type="hidden" name="user_<?php echo(urlencode($username)); ?>" value="1" /> <input type="checkbox" name="delete_<?php echo(urlencode($username)); ?>" value="1" /> </td> <td valign="middle" align="<?php echo($cellAlign); ?>"> <?php echo(pmcSpecialChars($username, $latin1) . "\n"); ?> </td> <td valign="middle" align="center"> <?php echo($ip . "\n"); ?> </td> <td valign="middle" align="center"> <input type="text" name="rooms_<?php echo(urlencode($username)); ?>" value="<?php echo(htmlspecialchars($rooms)); ?>" size="40" /> <input type="hidden" name="old_rooms_<?php echo(urlencode($username)); ?>" value="<?php echo(htmlspecialchars($rooms)); ?>" /> </td> <td valign="middle" align="center"> <select name="until_<?php echo(urlencode($username)); ?>"> <?php // banished users for more than one year -> forever $forever = time() + (60 * 60 * 24 * 365); echo("\n"); if ($banUntil > $forever) { ?> <option value="forever" selected="selected"><?php echo(A_SHEET2_5); ?></option> <?php } else { ?> <option value="date" selected="selected"><?php echo(date('M j, Y - h:i a', $banUntil + C_TMZ_OFFSET * 60 * 60)); ?></option> <option value="forever"><?php echo(A_SHEET2_5); ?></option> <?php } echo("\n"); ?> </select> <input type="hidden" name="old_until_<?php echo(urlencode($username)); ?>" value="<?php echo(($banUntil > $forever) ? 'forever' : 'date')?>" /> </td> </tr> <? }; $dbLink->cleanResults(); echo("\n"); ?> <tr> <td valign="middle" align="center" colspan="5"> <font size="-1">* <?php echo(A_SHEET2_6); ?></font> </td> </tr> <tr><td> </td></tr> <tr> <td valign="middle" align="center" colspan="4"> <input type="submit" name="submitType" value="<?php echo(A_SHEET2_7); ?>" /> </td> <td valign="middle" align="center"> <input type="submit" name="submitType" value="<?php echo(A_SHEET1_7); ?>" /> </td> </tr> </table> </form> <!-- Navigation cells at the footer --> <?php include('./lib/admin_libs/navigation.lib.' . C_EXTENSION); pmcPagesNav($banUsersCnt); ?> </td> </tr> <?php } // end of the case where some banished users exist else { echo("\n"); ?> <tr> <td align="center" class="error"><?php echo(A_SHEET2_8); ?></td> </tr> <?php } // end of the case where there is no banished users echo("\n"); ?> </table> <?php ?> --- 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 script displays the list of registered users and allows to act on | // | it (ie delete a profile, banish or change permissions for an user). | // | Three functions are defined inside: | // | - banProfile() = do banish some users | // | - delProfile() = do delete some profiles | // | - modifyPerms() = do modify the permission levels of some users | // | | // | This script is called by the 'chat/admin_body.php3' script. | // +--------------------------------------------------------------------------+ // | From the phpMyChat project: | // | http://www.phpheaven.net/projects/phpMyChat/ | // | | // | Authors: the phpHeaven-team <te...@ph...> | // +--------------------------------------------------------------------------+ // // $Id: admin1.php3,v 1.1 2001/05/05 17:26:17 loic1 Exp $ // // Administration sheet for registered users of phpMyChat. // /** * Ensure this script is called by the admin frameset (fix a security hole) */ if (!isset($dbSessionVars) || empty($dbSessionVars['authUsername'])) { exit(); } /** * Deletes a profile after a message has been sent to the user if he * is currently chatting * * @global string the nick of the user to remove * @global object the pmcDB instance to use * * @access private */ function delProfile() { global $username; global $dbLink; // The 'pmcSlashSingleQuotes()' function is defined in the // 'chat/lib/common.lib.php3' library $slashedUsername = pmcSlashSingleQuotes($username); $dbLink->query("DELETE FROM " . C_REG_TBL . " WHERE username = '$slashedUsername'"); $dbLink->query("SELECT room FROM " . C_USR_TBL . " WHERE username = '$slashedUsername' LIMIT 1"); $isChatting = (list($room) = $dbLink->nextRecord()); // Sends a message to the user if he is currently chatting if ($isChatting) { $room = pmcHandleMagicQuotes($room, '', '1', 'del'); $dbLink->cleanResults(); // Gets the type of the room (public/private) where the message has to be sent $slashedTargetRoom = pmcSlashSingleQuotes($room); $dbLink->query("SELECT type FROM " . C_MSG_TBL . " WHERE room = '$slashedTargetRoom' LIMIT 1"); list($targetRoomType) = $dbLink->nextRecord(); $dbLink->cleanResults(); $dbLink->query("UPDATE " . C_USR_TBL . " SET status = 'u' WHERE username = '$slashedUsername'"); $aQuery = 'INSERT INTO ' . C_MSG_TBL . ' ' . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) ' . 'VALUES (' . "$targetRoomType, '$slashedTargetRoom', 'SYS delreg', '', " . time() . ", '$slashedUsername', '#666699', 'sprintf(L_ADM_2)', 'sprintf(L_ADM_2)'" . ')'; $dbLink->query($aQuery); } } // end of the 'delProfile()' function /** * Banishes an user * * @global string the nick of the user to banish * @global object the DB object to use * * @access private */ function banProfile() { global $username; global $dbLink; // The 'pmcSlashSingleQuotes()' function is defined in the // 'chat/lib/common.lib.php3' library $slashedUsername = pmcSlashSingleQuotes($username); // Gets some additional values from the registered users table $dbLink->query("SELECT latin1, ip FROM " . C_REG_TBL . " WHERE username = '$slashedUsername' LIMIT 1"); list($latin1, $ip) = $dbLink->nextRecord(); $dbLink->cleanResults(); // Ensure the user isn't already banished before doing the work $dbLink->query("SELECT count(*) FROM " . C_BAN_TBL . " WHERE username = '$slashedUsername' LIMIT 1"); list($isBanished) = $dbLink->nextRecord(); $dbLink->cleanResults(); if ($isBanished == 0) { $banUntil = time() + round(C_BANISH * 60 * 60 * 24); if ($banUntil > 2147483647) $banUntil = 2147483647; $dbLink->query("INSERT INTO " . C_BAN_TBL . " (username, latin1, ip, rooms, ban_until) VALUES ('$slashedUsername', $latin1, '$ip', '**to define**', $banUntil)"); } } // end of the 'banProfile()' function /** * Modifies perms for a registered user and send him a message if he * is currently chatting * * @global string the nick of the user to remove * @global object the DB object to use * @global string the new permission level of the user * @global string the new list of moderated rooms by this user * @global string the old list of moderated rooms by this user * * @access private */ function modifyPerms() { global $username; global $dbLink; global $oldPermLevel; global $newPermLevel; global $newModeratedRooms; global $oldModeratedRooms; // The 'pmcSlashSingleQuotes()' function is defined in the // 'chat/lib/common.lib.php3' library $slashedUsername = pmcSlashSingleQuotes($username); // Updates perms level $dbLink->query("UPDATE " . C_REG_TBL . " SET perms = '$newPermLevel', rooms = '" . pmcSlashSingleQuotes($newModeratedRooms) . "' WHERE username = '$slashedUsername'"); // Checks if the user should be sent a message $dbLink->query("SELECT room FROM " . C_USR_TBL . " WHERE username = '$slashedUsername' LIMIT 1"); $isChatting = (list($room) = $dbLink->nextRecord()); // When user is chatting, checks if he is chatting in a room for which his // permission level have changed if ($isChatting) { $room = pmcHandleMagicQuotes($room, '', 1, 'del'); $dbLink->cleanResults(); // Find the changes in the moderated rooms list if ($oldPermLevel != $newPermLevel) { $diffModeratedRooms = ($newPermLevel == 'user') ? $oldModeratedRooms : $newModeratedRooms; $diffModeratedRooms = ereg_replace('^,|,$', '', $diffModeratedRooms); $diffModeratedRooms = str_replace(',,', ',', $diffModeratedRooms); } else { $oldRooms = explode(',', $oldModeratedRooms); $oldRoomsCnt = count($oldRooms); $newRooms = explode(',', $newModeratedRooms); $newRoomsCnt = count($newRooms); $diffRooms = array(); reset($oldRooms); for ($j = 0; $j < $oldRoomsCnt; $j++) { $roomToCheck = $oldRooms[$j]; if (trim($roomToCheck) != '' && pmcIsInto($roomToCheck, $newModeratedRooms) < 0) { $diffRooms[] = $roomToCheck; } } reset($newRooms); for ($j = 0; $j < $newRoomsCnt; $j++) { $roomToCheck = $newRooms[$j]; if (trim($roomToCheck) != '' && pmcIsInto($roomToCheck, $oldModeratedRooms) < 0) { $diffRooms[] = $roomToCheck; } } unset($oldRooms); unset($newRooms); if (count($diffRooms) > 0) { $diffModeratedRooms = implode(',', $diffRooms); $diffModeratedRooms = ereg_replace('^,|,$', '', $diffModeratedRooms); $diffModeratedRooms = str_replace(',,', ',', $diffModeratedRooms); } unset($diffRooms); } if (pmcIsInto($room, $diffModeratedRooms) < 0) // No message to send { $isChatting = false; } } // end of the case where user is currently chatting else { $dbLink->cleanResults(); } // end of checking modifs in the moderated rooms list // Sends a message to the user if he is chatting into one of the 'diff' rooms if ($isChatting) { // user becomes moderator for the room he chats into if ($newPermLevel == 'moderator' && pmcIsInto($room, $newModeratedRooms) >= 0) { $status = 'm'; $message = 'sprintf(L_MODERATOR, \\\'' . pmcSlashSingleQuotes(htmlspecialchars($username), 3) . '\\\')'; } // user becomes user for the room he chats into else { $status = 'r'; $message = 'sprintf(L_ADM_1, \\\'' . pmcSlashSingleQuotes(htmlspecialchars($username), 3) . '\\\')'; } // Udpates the user status for the room he is chatting into $dbLink->query("UPDATE " . C_USR_TBL . " SET status = '$status' WHERE username = '$slashedUsername'"); // Gets the type of the room $slashedTargetRoom = pmcSlashSingleQuotes($room); $dbLink->query("SELECT type FROM " . C_MSG_TBL . " WHERE room = '$slashedTargetRoom' LIMIT 1"); list($targetRoomType) = $dbLink->nextRecord(); $dbLink->cleanResults(); // Inserts the message into the messages table $aQuery = 'INSERT INTO ' . C_MSG_TBL . ' ' . '(type, room, username, latin1, m_time, address, color, msg_original, msg_enhanced) ' . 'VALUES (' . "$targetRoomType, '$slashedTargetRoom', 'SYS promote', '', " . time() . ", NULL, '#666699', '$message', '$message'" . ')'; $dbLink->query($aQuery); } } // end of the 'modifyPerms()' function /** * The administrator has required an action to be done * * The 'pmcSlashSingleQuotes()' and 'pmcHandleMagicQuotes()' functions are * defined inside the 'chat/lib/common.lib.php3' library * * @see delProfile(), banProfile(), modifyPerms() */ if (!empty($submitType)) { // A registered user has to be deleted or banished? $deleteMode = (pmcSlashSingleQuotes($submitType) == A_SHEET1_6) ? 1 : 0; $banishMode = (pmcSlashSingleQuotes($submitType) == A_SHEET1_9) ? 1 : 0; // Get the list of the concerned registered users $modifOffset = ($dbSessionVars['offset'] - 5 > 0) ? $dbSessionVars['offset'] - 5 : 0; if (C_DB_TYPE == 'mysql') { $queryLimits = ' LIMIT ' . $modifOffset . ',20'; } else if (C_DB_TYPE == 'pgsql') { $queryLimits = ' LIMIT 20 OFFSET ' . $modifOffset; } else { $queryLimits = ''; } $dbLink->query("SELECT username FROM " . C_REG_TBL . " WHERE perms != 'admin' ORDER BY " . $dbSessionVars['sortBy'] . " " . $dbSessionVars['sortOrder'] . $queryLimits); $regUsers = array(); while (list($username) = $dbLink->nextRecord()) { $regUsers[] = pmcHandleMagicQuotes($username, '', 1, 'del'); } $dbLink->cleanResults(); $regUsersCnt = count($regUsers); reset($regUsers); for ($i = 0; $i < $regUsersCnt; $i++) { $username = $regUsers[$i]; $encodedUsername = urlencode($username); $varName = 'user_' . $encodedUsername; if (!isset($$varName)) // Current user wasn't in the list displayed continue; // Some profiles have to be deleted if ($deleteMode) { $varName = 'selected_' . $encodedUsername; if (isset($$varName)) delProfile(); // Optimize the registered users table when a MySQL DB is used $dbLink->optimize(C_REG_TBL); } // end of the case where some profiles have to been deleted // Some users have to be banished else if ($banishMode) { $varName = 'selected_' . $encodedUsername; if (isset($$varName)) { banProfile(); $warning = A_SHEET1_10; } } // end of the case where some users have to been banished // Some permission levels have to changed else { $varName = 'perms_' . $encodedUsername; $newPermLevel = $$varName; $varName = 'rooms_' . $encodedUsername; $newModeratedRooms = pmcHandleMagicQuotes($$varName, 1, '', 'del'); $varName = 'old_perms_' . $encodedUsername; $oldPermLevel = $$varName; $varName = 'old_rooms_' . $encodedUsername; $oldModeratedRooms = pmcHandleMagicQuotes($$varName, 1, '', 'del'); if ($newPermLevel == $oldPermLevel && $newModeratedRooms == $oldModeratedRooms) continue; // No changes for this user modifyPerms(); } // end of the case where some permission levels have to been modified } unset($regUsers); } // end of the case where the admin has required an action to be done /** * Cleans the registered users table */ // Removes profiles of users that have not been chatting for a time > C_REG_DEL if (!isset($submitType) && C_REG_DEL != 0) $dbLink->query("DELETE FROM " . C_REG_TBL . " WHERE reg_time < " . (time() - C_REG_DEL * 60 * 60 * 24) . " AND perms != 'admin'"); // Removes moderator status when there is no room associated to $dbLink->query("UPDATE " . C_REG_TBL . " SET perms = 'user' WHERE perms = 'moderator' AND rooms = ''"); /** * Displays the registered users sheet */ ?> <script type="text/javascript" language="javascript"> <!-- // Ensures a list of moderated rooms is associated to a 'moderator' status // obj1 is the select box for permission levels // obj2 is the text box containing the list of moderated rooms function pmcResetPerms(user) { var obj1 = window.document.forms['adminForm1'].elements['perms_' + user]; var obj2 = window.document.forms['adminForm1'].elements['rooms_' + user]; var i = (obj2.value == '') ? 0 : 1; obj1.options[i].selected = true; } // end of the 'pmcResetPerms()' function // --> </script> <p class="title"><?php echo(A_SHEET1_1); ?></p> <?php // Displays the warning message if it is defined (an user has been banished) if (!empty($warning)) echo('<p class="success">' . "\n\t" . $warning . "\n" . '</p><br />' . "\n"); ?> <table border="0" cellpadding="3" class="table"> <?php // Ensures at least one registered user exists (except the administrator) // before displaying the sheet $dbLink->query("SELECT COUNT(*) FROM " . C_REG_TBL . " WHERE perms != 'admin' LIMIT 1"); list($regUsersCnt) = $dbLink->nextRecord(); $dbLink->cleanResults(); if ($regUsersCnt != 0) { echo("\n"); ?> <!-- Registered users form --> <tr> <td align="center"> <form action="<?php echo($adminBodyUrl); ?>" method="post" autocomplete="off" name="adminForm1"> <table border="0" cellpadding="5" cellspacing="1" width="100%"> <tr class="tabTitle"> <td valign="middle" align="center"> </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"> <?php echo(A_SHEET1_4); ?> * </td> </tr> <?php // Defines wich profiles have to been displayed $lastPageOffset = floor(($regUsersCnt - 1) / 10) * 10; if ($dbSessionVars['offset'] > $lastPageOffset) $dbSessionVars['offset'] = $lastPageOffset; if (C_DB_TYPE == 'mysql') { $queryLimits = ' LIMIT ' . $dbSessionVars['offset'] . ',10'; } else if (C_DB_TYPE == 'pgsql') { $queryLimits = ' LIMIT 10 OFFSET ' . $dbSessionVars['offset']; } else { $queryLimits = ''; } // Gets these profiles $dbLink->query("SELECT username, latin1, perms, rooms, reg_time, ip FROM " . C_REG_TBL . " WHERE perms != 'admin' ORDER BY " . $dbSessionVars['sortBy'] . " " . $dbSessionVars['sortOrder'] . $queryLimits); while (list($username, $latin1, $perms, $rooms, $lastLog, $ip) = $dbLink->nextRecord()) { $username = pmcHandleMagicQuotes($username, '', 1, 'del'); $rooms = pmcHandleMagicQuotes($rooms, '', 1, 'del'); echo("\n"); ?> <tr> <td valign="middle" align="center"> <input type="hidden" name="user_<?php echo(urlencode($username)); ?>" value="1" /> <input type="checkbox" name="selected_<?php echo(urlencode($username)); ?>" value="1" /> </td> <td valign="middle" align="<?php echo($cellAlign); ?>"> <?php echo(pmcSpecialChars($username, $latin1) . "\n"); ?> </td> <td valign="middle" align="<?php echo($cellAlign); ?>"> <?php echo(date('M j, Y - h:i a', $lastLog + C_TMZ_OFFSET * 60 * 60) . "\n"); ?> </td> <td valign="middle" align="center"> <?php echo($ip . "\n"); ?> </td> <td valign="middle" align="center"> <select name="perms_<?php echo(urlencode($username)); ?>"> <option value="user"<?php if ($perms == 'user') echo(' selected="selected"'); ?>><?php echo(A_USER); ?></option> <option value="moderator"<?php if ($perms == 'moderator') echo(' selected="selected"'); ?>><?php echo(A_MODER); ?></option> </select> <input type="hidden" name="old_perms_<?php echo(urlencode($username)); ?>" value="<?php echo($perms); ?>" /> </td> <td valign="middle" align="center"> <input type="text" name="rooms_<?php echo(urlencode($username)); ?>" value="<?php echo(htmlspecialchars($rooms)); ?>" size="40" onchange="pmcResetPerms('<?php echo(urlencode($username)); ?>');" /> <input type="hidden" name="old_rooms_<?php echo(urlencode($username)); ?>" value="<?php echo(htmlspecialchars($rooms)); ?>" /> </td> </tr> <?php } // end of the work to display profiles $dbLink->cleanResults(); echo("\n"); ?> <tr> <td valign="middle" align="center" colspan="6"> <font size="-1">* <?php echo(A_SHEET1_5); ?></font> </td> </tr> <tr><td> </td></tr> <tr> <td valign="middle" align="center" colspan="5"> <input type="submit" name="submitType" value="<?php echo(A_SHEET1_6); ?>" /> <br /><br /> <input type="submit" name="submitType" value="<?php echo(A_SHEET1_9); ?>" /> </td> <td valign="middle" align="center"> <input type="submit" name="submitType" value="<?php echo(A_SHEET1_7); ?>" /> </td> </tr> </table> </form> <!-- Navigation cells at the footer --> <?php include('./lib/admin_libs/navigation.lib.' . C_EXTENSION); pmcPagesNav($regUsersCnt); ?> </td> </tr> <?php } // end of the case where some registered users exist else { echo("\n"); ?> <tr> <td align="center" class="error"><?php echo(A_SHEET1_8); ?></td> </tr> <?php } // end of the case where there is no registered users echo("\n"); ?> </table> <?php ?> |