in my chat (version 1.2), already integrated with phpbb, when an user is not logged in or is a guest he can choose a nickname for the chat.
But if the user chooses a nick that is equal to the username of a registered phpbb user, the nick is allowed.
How can I protect those nicks?
Thanks!
If useful, this is my chat.php page (cutted where there isn't php code):
- Code: Select all
<?php
define('IN_PHPBB', true);
$phpbb_root_path = dirname(__FILE__).'/forum/'; // See phpbb_root_path documentation
$phpEx = substr(strrchr(__FILE__, '.'), 1); // Set the File extension for page-wide usage.
include($phpbb_root_path . 'common.' . $phpEx); // include the common.php file, this is important, especially for database connects.
require_once dirname(__FILE__)."/chat/src/phpfreechat.class.php";
$params = array();
$params["title"]="Chat";
$params["max_msg"]=21;
$params["clock"]=true;
$params["frozen_nick"]=true;
$params["serverid"]=md5("roomname");
$params["theme"]="blune";
$params["language"]="it_IT";
$params["channels"] = array("My Room Name");
$params["timeout"] = 60000;
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');
get_username_string ;
$oog = $user->data [username];
if ($oog == "Anonymous") {
} else {
$params["nick"] = iconv("ISO-8859-1", "UTF-8", $oog);
// Check group_id matchs the "Administrators" group into phpbb_groups table
if ($user->data['group_id'] == 5) {
$params["isadmin"] = true;
}
}
$chat = new phpFreeChat( $params );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
[HTML CUT]
<?php $chat->printJavascript(); ?>
<?php $chat->printStyle(); ?>
</head>
<body>
[HTML CUT]
<?php $chat->printChat(); ?>
</body>
</html>