Loki12, having looked at your file, you have made an error with step 4. The wrong piece of code has been replaced. I'm not really sure why, I've triple checked the instructions and they are correct. The code between
//Send room list to user and
//Send user list to user should look like this ;
PHP Code:
//Send room list to user
$rooms = array();
if(ChatServer::userInRole($this->userid, ROLE_CUSTOMER)) {
$this->roomid = $this->doCreateRoom("Support Room for {$user['login']}", true);
$stmt = new Statement("SELECT * FROM {$GLOBALS['fc_config']['db']['pref']}rooms WHERE id=?");
if(($rs = $stmt->process()) && ($rec = $rs->next($this->roomid))) {
$this->sendBack(new Message('adr', null, $rec['id'], $rec['name']));
$rooms[$rec['id']] = 0;
}
} else {
$stmt = new Statement("SELECT * FROM {$GLOBALS['fc_config']['db']['pref']}rooms WHERE ispublic IS NOT NULL AND ispermanent IS NOT NULL ORDER BY ispermanent");
if($rs = $stmt->process()) {
while($rec = $rs->next()) {
$this->sendBack(new Message('adr', null, $rec['id'], $rec['name']));
$rooms[$rec['id']] = 0;
}
}
$stmt = new Statement("SELECT * FROM {$GLOBALS['fc_config']['db']['pref']}rooms WHERE ispublic IS NOT NULL AND ispermanent IS NULL ORDER BY created");
if($rs = $stmt->process()) {
while($rec = $rs->next()) {
$this->sendBack(new Message('adr', null, $rec['id'], $rec['name']));
$rooms[$rec['id']] = 0;
}
}
// # Paul M # load permanant private rooms if Admin.
if(ChatServer::userInRole($this->userid, ROLE_ADMIN)) {
$stmt = new Statement("SELECT * FROM {$GLOBALS['fc_config']['db']['pref']}rooms WHERE ispublic IS NULL AND ispermanent IS NOT NULL ORDER BY created");
if($rs = $stmt->process()) {
while($rec = $rs->next()) {
$this->sendBack(new Message('adr', null, $rec['id'], $rec['name']));
$rooms[$rec['id']] = 0;
}
}
}
}
//Send user list to user
Anyone with room errors should check this carefully.