• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ phpBB, Simple Machines Forum (SMF), and Forum Software (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

phpbb3 users

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
4 posts • Page 1 of 1

Postby drevv » Tue Aug 11, 2009 4:41 pm

Hi,
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>
Last edited by drevv on Tue Aug 11, 2009 6:03 pm, edited 1 time in total.
drevv
Member
 
Posts: 11
Joined: Tue Aug 11, 2009 4:33 pm
Top

Postby drevv » Thu Aug 13, 2009 1:38 pm

I need to check (with php code) if the nickname already exists in the database, or this funcionality is already implemented somewhere?

Thanks!
drevv
Member
 
Posts: 11
Joined: Tue Aug 11, 2009 4:33 pm
Top

Postby jimmo » Wed Aug 18, 2010 9:15 pm

No, you'll need to add code to check the requested nick against the phpbb database "user" table if you're going to allow non-logged in users to chat and choose nicks.

For me, I decided only to allow logged in members to use the live chat (makes it easier to manage and moderate without random Joe's from across the net spamming the chat) but your needs may be different. Good luck!
jimmo
Member
 
Posts: 23
Joined: Wed Aug 18, 2010 3:51 pm
Top

Postby re*s.t.a.r.s.*2 » Wed Aug 18, 2010 10:50 pm

use frozen nick, and then put a ran() nick if user is not identified against your database, so nobody from net can use it, thats better than locking down the chat if user is not registered...
Last edited by re*s.t.a.r.s.*2 on Wed Aug 18, 2010 10:51 pm, edited 1 time in total.
Free Singles Chat Rooms No Registration Required
Text and Chat Singles no need to register or app required
Sala De Bate Papo Online Grátis E Sem Cadastro
re*s.t.a.r.s.*2
Support Team
 
Posts: 612
Joined: Wed Sep 24, 2008 4:04 pm
Location: los angeles CA
  • Website
Top


Post a reply
4 posts • Page 1 of 1

Return to phpBB, Simple Machines Forum (SMF), and Forum Software (v1.x)

Who is online

Users browsing this forum: No registered users and 5 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
cron
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub