From: Lo?c C. <lo...@us...> - 2001-05-23 21:40:34
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs In directory usw-pr-cvs1:/tmp/cvs-serv12109/chat/lib/index_libs Modified Files: main_index.lib.php3 index_validation.lib.php3 Log Message: Misc. fixes Index: main_index.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs/main_index.lib.php3,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -r1.31 -r1.32 *** main_index.lib.php3 2001/05/22 20:40:34 1.31 --- main_index.lib.php3 2001/05/23 21:40:30 1.32 *************** *** 421,426 **** /** ! * Ensures the user can create the room he wants to, then defines the ! * permission level this user will be granted for this room * * Skipped if the frameset is reloaded. --- 421,425 ---- /** ! * Ensures the user can create the room he wants to * * Skipped if the frameset is reloaded. *************** *** 431,435 **** if ($error == '' && !isset($reloading) && $isCreateRoom) { ! $error = pmcValidateRoomCreation($regUserPerms, $regUserModeratedRooms); } // end of the validation of room creation --- 430,434 ---- if ($error == '' && !isset($reloading) && $isCreateRoom) { ! $error = pmcValidateRoomCreation(); } // end of the validation of room creation *************** *** 437,442 **** /** * Defines the right level the user will be granted for the room he/she ! * will enter in (skipped when the frameset is reloaded because of the NS4+ ! * resize bug). * * The 'pmcSlashSingleQuotes()' function is defined inside the --- 436,440 ---- /** * Defines the right level the user will be granted for the room he/she ! * will enter in. * * The 'pmcSlashSingleQuotes()' function is defined inside the *************** *** 449,453 **** --- 447,456 ---- $status = pmcRightLevel(); } + else + { + $status = $dbSessionVars['status']; + } + /** * Enters the chat *************** *** 600,625 **** else $layoutNick = ''; - - if (!empty($GLOBALS['enterDefaultRoomName'])) - $layoutRoom = $GLOBALS['enterDefaultRoomName']; - else if (!empty($GLOBALS['enterOtherRoomName'])) - $layoutRoom = $GLOBALS['enterOtherRoomName']; - else if (!empty($GLOBALS['createRoomName'])) - $layoutRoom = $GLOBALS['createRoomName']; - else if (dbSessionIsRegistered('currentRoom')) - $layoutRoom = $dbSessionVars['currentRoom']; - else if (isset($GLOBALS['cookieRoom'])) - $layoutRoom = urldecode($GLOBALS['cookieRoom']); - else - $layoutRoom = ''; if (!empty($GLOBALS['createRoomName']) && !empty($GLOBALS['roomType'])) ! $layoutRoomType = $GLOBALS['roomType']; ! else if (dbSessionIsRegistered('roomType')) ! $layoutRoomType = $dbSessionVars['roomType']; ! else if (isset($GLOBALS['cookieRoomType'])) ! $layoutRoomType = $GLOBALS['cookieRoomType']; else ! $layoutRoomType = ''; ?> <center> --- 603,642 ---- else $layoutNick = ''; + // Priority order for rooms: + // 1. 'posted' with + // to be created > 'other' rooms > default public rooms + // 2. grabbed from session data + // 3. gabbed from cookies if (!empty($GLOBALS['createRoomName']) && !empty($GLOBALS['roomType'])) ! { ! $layoutRoomType = $GLOBALS['roomType']; ! $layoutRoom = $GLOBALS['createRoomName']; ! } ! else if (!empty($GLOBALS['enterOtherRoomName'])) ! { ! $layoutRoomType = 1; ! $layoutRoom = $GLOBALS['enterOtherRoomName']; ! } ! else if (!empty($GLOBALS['enterDefaultRoomName'])) ! { ! $layoutRoomType = 1; ! $layoutRoom = $GLOBALS['enterDefaultRoomName']; ! } ! else if (dbSessionIsRegistered('currentRoom') && dbSessionIsRegistered('roomType')) ! { ! $layoutRoomType = $dbSessionVars['roomType']; ! $layoutRoom = $dbSessionVars['currentRoom']; ! } ! else if (isset($GLOBALS['cookieRoom']) && isset($GLOBALS['cookieRoomType'])) ! { ! $layoutRoomType = $GLOBALS['cookieRoomType']; ! $layoutRoom = urldecode($GLOBALS['cookieRoom']); ! } else ! { ! $layoutRoomType = 1; ! $layoutRoom = ''; ! } ?> <center> *************** *** 942,949 **** $dbSessionVars['msgNumber'] = C_MSG_NB; $dbSessionVars['refreshDelay'] = C_MSG_REFRESH; ! // Among the variables to delete, the 'conservative' and the ! // 'savedMessagesLimit' ones may have been set repectively by the 'profile' and ! // the 'save' commands ! $toUnregister = array('password', 'conservative', 'savedMessagesLimit'); dbSessionUnregister($toUnregister); dbSessionSave(); --- 959,964 ---- $dbSessionVars['msgNumber'] = C_MSG_NB; $dbSessionVars['refreshDelay'] = C_MSG_REFRESH; ! // Delete session variables thay may have been set by some other scripts ! $toUnregister = array('password', 'conservative', 'prevEmail', 'savedMessagesLimit'); dbSessionUnregister($toUnregister); dbSessionSave(); Index: index_validation.lib.php3 =================================================================== RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/index_libs/index_validation.lib.php3,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** index_validation.lib.php3 2001/05/22 20:40:34 1.12 --- index_validation.lib.php3 2001/05/23 21:40:30 1.13 *************** *** 163,169 **** * the user will be granted inside this room * - * @param string permission level associated to the nick - * @param string list of the room moderated by the user - * * @return string error number * --- 163,166 ---- *************** *** 180,184 **** * @access public */ ! function pmcValidateRoomCreation(&$userPerms, &$userModeratedRooms) { global $isJsValidated; --- 177,181 ---- * @access public */ ! function pmcValidateRoomCreation() { global $isJsValidated; |