Fork me on GitHub

Webchat 0.6: Users from the same IP  Bottom

  • I already posted this very same question in Natural disasters forum (developers of the WebChat module), but I also post it here, if someone had the same problem, and solved.

    Is there a way that 2 different users from the same IP, enters the same chat room?

    If yes, which file or configuration I need to edit in order to do that.

    Thanks.

    Be happy. :P
  • check here

    --
    regards from germany
    ..::[Zikula Application Framework]::.. ..::[SEO-Blog]::.. ..::[CMS Sicherheit]::..
  • The solution in the link you provided, works wonderful!

    Thanks again.

    Be happy :P
  • Hi all

    Could you post the fix here please as i've just installed webchat and have the same problem but the site with the fix is down

    TIA

    Dean
  • Here is the solution:

    On the folder module NS-WebChat, find the index.php file, open with any PHP or text editor, and go directly to line 233, you will find this piece of code:

    Code

    $q = mysql_query("select u.name, u.uid, u.ip, r.name from ".$prefix."_chatuser as u left join ".$prefix."_chatroom as r on u.rid = r.rid where u.name='$username' or u.ip='$ip'");

    Change to this:

    Code

    $q = mysql_query("select u.name, u.uid, u.ip, r.name from ".$prefix."_chatuser as u left join ".$prefix."_chatroom as r on u.rid = r.rid where u.name='$username' ");


    And... voilá... your users will connect from the same IP

    Hope this helps.
  • Guys,

    This sounds just what I have been looking for, where can I see a demo and download it from?

    The site above is down :*(

    Thanks

    Mike ...
  • I seem to remember trying that fix in WebChat and it not working. Anyways, now that most people are using SPChat instead has anybody looked into fixing the problem for SPChat.

    Here is what I've found:

    include_once(_SPCHAT_INCLUDEPATH.'inc/chatwindow.inc.php');

    if (spchat_auth_is_kicked($username) === true)
    {
    $errmsg = sprintf(_YOUKICKED, $username, $ip);
    } else {

    $spchat_user_table = $pntable['spchat_user'];
    $spchat_user_column = &$pntable['spchat_user_column'];
    $spchat_room_table = $pntable['spchat_room'];
    $spchat_room_column = &$pntable['spchat_room_column'];
    $SQL = "SELECT $spchat_user_column[name],
    $spchat_user_column[uid],
    $spchat_user_column[ip],
    $spchat_room_column[name]
    FROM $spchat_user_table
    LEFT JOIN $spchat_room_table ON ($spchat_user_column[rid] = $spchat_room_column[rid])
    WHERE $spchat_user_column[uid]=$uid";

    $result = $dbconn->Execute($SQL);
    if(!$result->EOF) {
    $user_is_in_any_room = true;
    list($u_name, $u_id, $u_ip, $r_name) = $result->fields;
    } else {
    $user_is_in_any_room = false;
    }
    $result->Close();

    If you look at the line I have in bold, my hunch is that if we remove that it will work. I've found that often users from large ISP's seem to have the same IP address when they connect to chat. I haven't been able to test this yet, but I will follow up here when I get confirmation. If anybody else tries this and finds that it works please reply.
  • You forget to mention what PHP file needs to be edited.
  • phishhead5000


    If you look at the line I have in bold, my hunch is that if we remove that it will work.


    after all this time, that line is still in the code, and people are still having problems.
    did this fix solve the issue for you?
  • The incompatibility of SPChat (and I suppose Webchat) with all Mac browsers is a serious issue. Is this something that will eventually be fixed, or is it a fatal flaw?

This list is based on users active over the last 60 minutes.