- Code: Select all
<?php
$params = null;
define("IN_PHPBB", true);
$phpbb_root_path = "../forum/";
$phpEx = substr(strrchr(__FILE__, "."), 1);
include($phpbb_root_path . "common." . $phpEx);
$user->session_begin();
$auth->acl($user->data);
$user->setup("viewforum");
if ($user->data[username] == "Anonymous") header("Location: http://xxx.xxx.xxx/FORUMDIR/ucp.php?mode=login&redirect=CHATDIR");
require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params["serverid"] = md5(__FILE__);
$params["time_offset"] = 60*60*1;
$params["title"] = "TITLE";
$params["theme"] = "msn";
$params["refresh_delay"] = 500;
$params["height"] = "320px";
$params["channels"] = array("ROOM1");
if ($user->data["group_id"] == 5) //admin
{
$params["isadmin"] = true;
$params["channels"] = array("ROOM1", "ROOM2");
}
if ($user->data["group_id"] == 7) //custom group
{
$params["isadmin"] = false;
$params["channels"] = array("ROOM2");
$params["frozen_channels"] = array("ROOM2");
}
if ($user->data["group_id"] == 2) //registered
{
$params["isadmin"] = false;
$params["channels"] = array("ROOM1");
$params["frozen_channels"] = array("ROOM1");
}
$params["nick"] = $user->data[username];
$params["frozen_nick"] = true;
$chat = new phpFreeChat($params);
?>
Thats a first to start proper integration ...
But now the problem:
When I login on my customgrouped user then relog to a normal user, it trows up a popup that I cant join the second channel ... as ofcourse the channels are locked for a registered user.
Now what do I change to make this work? I dont want any of the registered users able to see ROOM2 and visaversa.
It works after closing the browser and restarting it, but how do I clear it properly at script execute?