ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilChatRoom Class Reference

Class ilChatUser. More...

+ Collaboration diagram for ilChatRoom:

Public Member Functions

 ilChatRoom ($a_id)
 Constructor public.
 getErrorMessage ()
 setRoomId ($a_id)
 getRoomId ()
 getObjId ()
 setOwnerId ($a_id)
 getOwnerId ()
 getName ()
 setTitle ($a_title)
 getTitle ()
 getGuests ()
 setUserId ($a_id)
 getUserId ()
 invite ($a_id)
 drop ($a_id)
 visited ($a_id)
 checkAccess ()
 isInvited ($a_id)
 isOwner ()
 appendMessageToDb ($message)
 getAllMessages ()
 deleteAllMessages ()
 updateLastVisit ()
 setKicked ($a_usr_id)
 setUnkicked ($a_usr_id)
 isKicked ($a_usr_id)
 getCountActiveUser ($chat_id, $room_id)
 _getCountActiveUsers ($chat_id, $room_id=0)
 getActiveUsers ()
 _isActive ($usr_id)
 getOnlineUsers ()
 validate ()
 deleteRooms ($a_ids)
 delete ($a_id, $a_owner=0)
 rename ()
 lookupRoomId ()
 add ()
 getInternalName ()
 getRooms ()
 getRoomsOfObject ()
 getAllRoomsOfObject ()
 getAllRooms ()
 checkWriteAccess ()
 __getCountLines ()
 __deleteFirstLine ()
 __addLine ($message)
 __read ()
 _unkick ($a_usr_id)

Data Fields

 $ilias
 $lng
 $error_msg
 $ref_id
 $owner_id
 $room_id
 $guests
 $title
 $user_id

Detailed Description

Class ilChatUser.

Author
Stefan Meyer
Version
Id:
class.ilChatRoom.php 18885 2009-02-06 10:14:06Z mjansen

Definition at line 32 of file class.ilChatRoom.php.

Member Function Documentation

ilChatRoom::__addLine (   $message)

Definition at line 709 of file class.ilChatRoom.php.

References $res, getObjId(), and getRoomId().

Referenced by appendMessageToDb().

{
global $ilDB;
$query = "INSERT INTO chat_room_messages ".
"VALUES('0',".$ilDB->quote($this->getObjId()).",".$ilDB->quote($this->getRoomId()).",".$ilDB->quote($message).",NOW())";
$res = $this->ilias->db->query($query);
$this->chat_record = new ilChatRecording($this->getObjId());
$this->chat_record->setRoomId($this->getRoomId());
if ($this->chat_record->isRecording())
{
$query = "INSERT INTO chat_record_data VALUES (
'0',
".$ilDB->quote($this->chat_record->getRecordId()).",
".$ilDB->quote($message).",
'" . time() . "')";
$res = $this->ilias->db->query($query);
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilChatRoom::__deleteFirstLine ( )

Definition at line 685 of file class.ilChatRoom.php.

References $res, DB_FETCHMODE_OBJECT, getObjId(), and getRoomId().

Referenced by appendMessageToDb().

{
global $ilDB;
$query = "SELECT entry_id, MIN(commit_timestamp) as last_comm FROM chat_room_messages ".
"WHERE chat_id = ".$ilDB->quote($this->getObjId()). " ".
"AND room_id = ".$ilDB->quote($this->getRoomId()). " ".
"GROUP BY null";
$res = $this->ilias->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$entry_id = $row->entry_id;
}
if($entry_id)
{
$query = "DELETE FROM chat_room_messages ".
"WHERE entry_id = ".$ilDB->quote($entry_id)."";
$res = $this->ilias->db->query($query);
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilChatRoom::__getCountLines ( )

Definition at line 669 of file class.ilChatRoom.php.

References $res, DB_FETCHMODE_OBJECT, getObjId(), and getRoomId().

Referenced by appendMessageToDb().

{
global $ilDB;
$query = "SELECT COUNT(entry_id) as number_lines FROM chat_room_messages ".
"WHERE chat_id = ".$ilDB->quote($this->getObjId())." ".
"AND room_id = ".$ilDB->quote($this->getRoomId())."";
$res = $this->ilias->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->number_lines;
}
return 0;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilChatRoom::__read ( )

Definition at line 735 of file class.ilChatRoom.php.

References $res, DB_FETCHMODE_OBJECT, getObjId(), getRoomId(), setOwnerId(), and setTitle().

Referenced by setRoomId().

{
global $ilDB;
$this->guests = array();
$query = "SELECT * FROM chat_rooms ".
"WHERE room_id = ".$ilDB->quote($this->getRoomId())."";
$res = $this->ilias->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->setTitle($row->title);
$this->setOwnerId($row->owner);
}
$query = "SELECT * FROM chat_invitations ".
"WHERE chat_id = ".$ilDB->quote($this->getObjId())." ";
"AND room_id = ".$ilDB->quote($this->getRoomId())."";
$res = $this->ilias->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->guests[] = $row->guest_id;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilChatRoom::_getCountActiveUsers (   $chat_id,
  $room_id = 0 
)

Definition at line 348 of file class.ilChatRoom.php.

References $res, and $room_id.

Referenced by ilObjChatListGUI\getProperties(), and ilObjChatGUI\viewObject().

{
global $ilDB;
$query = "SELECT * FROM chat_user ".
"WHERE chat_id = ".$ilDB->quote($chat_id)." ".
"AND room_id = ".$ilDB->quote($room_id)." ".
"AND last_conn_timestamp > ".time()." - 40";
$res = $ilDB->query($query);
return $res->numRows();
}

+ Here is the caller graph for this function:

ilChatRoom::_isActive (   $usr_id)

Definition at line 379 of file class.ilChatRoom.php.

References $res, and DB_FETCHMODE_OBJECT.

Referenced by ilUsersOnlineBlockGUI\__showActiveChatsOfUser().

{
global $ilDB;
$query = "SELECT * FROM chat_user ".
"WHERE room_id = 0 ".
"AND usr_id = ".$ilDB->quote((int) $usr_id)." ".
"AND last_conn_timestamp > ".time()." - 40";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->chat_id;
}
return false;
}

+ Here is the caller graph for this function:

ilChatRoom::_unkick (   $a_usr_id)

Definition at line 763 of file class.ilChatRoom.php.

Referenced by ilStartUpGUI\showLogin().

{
global $ilDB;
$ilDB->query("UPDATE chat_user SET kicked = 0 WHERE usr_id = ".$ilDB->quote($a_usr_id)."");
return true;
}

+ Here is the caller graph for this function:

ilChatRoom::add ( )

Definition at line 512 of file class.ilChatRoom.php.

References $res, getObjId(), getOwnerId(), and getTitle().

{
global $ilDB;
$query = "INSERT INTO chat_rooms ".
"SET title = ".$ilDB->quote($this->getTitle()).", ".
"chat_id = ".$ilDB->quote($this->getObjId()).", ".
"owner = ".$ilDB->quote($this->getOwnerId())."";
$res = $this->ilias->db->query($query);
return ($id = $this->ilias->db->getLastInsertId()) ? $id : false;
}

+ Here is the call graph for this function:

ilChatRoom::appendMessageToDb (   $message)

Definition at line 236 of file class.ilChatRoom.php.

References __addLine(), __deleteFirstLine(), and __getCountLines().

{
if($this->__getCountLines() >= MAX_LINES)
{
}
$this->__addLine($message);
return true;
}

+ Here is the call graph for this function:

ilChatRoom::checkAccess ( )

Definition at line 195 of file class.ilChatRoom.php.

References $_GET, getObjId(), getRoomId(), getUserId(), isInvited(), isOwner(), setRoomId(), and visited().

{
global $rbacsystem;
if ($this->getObjId() ||
$this->getRoomId())
{
if(!$this->isInvited($this->getUserId()) &&
!$this->isOwner() &&
!$rbacsystem->checkAccess('moderate', $_GET['ref_id']))
{
$this->setRoomId(0);
return false;
}
$this->visited($this->getUserId());
}
return true;
}

+ Here is the call graph for this function:

ilChatRoom::checkWriteAccess ( )

Definition at line 640 of file class.ilChatRoom.php.

References $_GET, getOwnerId(), getRoomId(), getUserId(), isInvited(), and isKicked().

{
global $rbacsystem;
if($rbacsystem->checkAccess('moderate', $_GET['ref_id']))
{
return true;
}
if($this->isKicked($this->getUserId()))
{
return false;
}
if(!$this->getRoomId())
{
return true;
}
if($this->getUserId() == $this->getOwnerId())
{
return true;
}
if($this->isInvited($this->getUserId()))
{
return true;
}
return false;
}

+ Here is the call graph for this function:

ilChatRoom::delete (   $a_id,
  $a_owner = 0 
)

Definition at line 429 of file class.ilChatRoom.php.

References $data, $res, DB_FETCHMODE_ASSOC, and ilDBx\isDbError().

{
// DELETE ROOM
global $ilDB;
$query = "DELETE FROM chat_rooms WHERE ".
"room_id = ".$ilDB->quote($a_id)."";
if ($a_owner > 0)
{
" AND owner = ".$ilDB->quote($a_owner)."";
}
$res = $this->ilias->db->query($query);
// DELETE INVITATIONS
$query = "DELETE FROM chat_invitations WHERE ".
"room_id = ".$ilDB->quote($a_id)."";
$res = $this->ilias->db->query($query);
// DELETE MESSAGES
$query = "DELETE FROM chat_room_messages WHERE ".
"room_id = ".$ilDB->quote($a_id)."";
$res = $this->ilias->db->query($query);
// DELETE USER_DATA
$query = "DELETE FROM chat_user WHERE ".
"room_id = ".$ilDB->quote($a_id)."";
if ($a_owner > 0)
{
" AND owner = ".$ilDB->quote($a_owner)."";
}
$res = $this->ilias->db->query($query);
// AND ALL RECORDINGS
$query = "SELECT record_id FROM chat_records WHERE
room_id = ".$ilDB->quote($a_id)."";
$res = $this->ilias->db->query($query);
if (ilDBx::isDbError($res)) die("ilObjChat::delete(): " . $res->getMessage() . "<br>SQL-Statement: ".$query);
if (($num = $res->numRows()) > 0)
{
for ($i = 0; $i < $num; $i++)
{
$this->ilias->db->query("DELETE FROM chat_record_data WHERE record_id = ".$ilDB->quote($data["record_id"])."");
}
}
$query = "DELETE FROM chat_records WHERE
room_id = ".$ilDB->quote($a_id)."";
$res = $this->ilias->db->query($query);
return true;
}

+ Here is the call graph for this function:

ilChatRoom::deleteAllMessages ( )

Definition at line 262 of file class.ilChatRoom.php.

References $res, getObjId(), and getRoomId().

{
global $ilDB;
$query = "DELETE FROM chat_room_messages ".
"WHERE chat_id = ".$ilDB->quote($this->getObjId())." ".
"AND room_id = ".$ilDB->quote($this->getRoomId())."";
$res = $this->ilias->db->query($query);
return true;
}

+ Here is the call graph for this function:

ilChatRoom::deleteRooms (   $a_ids)

Definition at line 416 of file class.ilChatRoom.php.

{
if(!is_array($a_ids))
{
$this->ilias->raiseError("ARRAY REQUIRED",$this->ilias->error_obj->FATAL);
}
foreach($a_ids as $id)
{
$this->delete($id);
}
return true;
}
ilChatRoom::drop (   $a_id)

Definition at line 171 of file class.ilChatRoom.php.

References $res, getObjId(), and getRoomId().

{
global $ilDB;
$query = "DELETE FROM chat_invitations ".
"WHERE chat_id = ".$ilDB->quote( $this->getObjId() )." ".
"AND room_id = ".$ilDB->quote( $this->getRoomId() )." ".
"AND guest_id = ".$ilDB->quote( $a_id )."";
$res = $this->ilias->db->query($query);
}

+ Here is the call graph for this function:

ilChatRoom::getActiveUsers ( )

Definition at line 362 of file class.ilChatRoom.php.

References $res, DB_FETCHMODE_OBJECT, and getObjId().

{
global $ilDB;
$query = "SELECT * FROM chat_user ".
"WHERE chat_id = ".$ilDB->quote($this->getObjId())." ".
"AND room_id = ".$ilDB->quote($this->room_id)." ".
"AND last_conn_timestamp > ".time()." - 40";
$res = $this->ilias->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$usr_ids[] = $row->usr_id;
}
return $usr_ids ? $usr_ids : array();
}

+ Here is the call graph for this function:

ilChatRoom::getAllMessages ( )

Definition at line 246 of file class.ilChatRoom.php.

References $data, $res, DB_FETCHMODE_OBJECT, getObjId(), and getRoomId().

{
global $ilDB;
$query = "SELECT message FROM chat_room_messages ".
"WHERE chat_id = ".$ilDB->quote($this->getObjId())." ".
"AND room_id = ".$ilDB->quote($this->getRoomId())." ".
"ORDER BY commit_timestamp ";
$res = $this->ilias->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$data[] = $row->message;
}
return is_array($data) ? implode("<br />",$data) : "";
}

+ Here is the call graph for this function:

ilChatRoom::getAllRooms ( )

Definition at line 600 of file class.ilChatRoom.php.

References ilUtil\_getObjectsByOperations(), and ilObjChat\_getPublicChatRefId().

{
global $ilObjDataCache,$ilUser,$rbacsystem;
$obj_ids = array();
$unique_chats = array();
if($rbacsystem->checkAccess('read',$pub_chat_id))
{
$obj_id = $ilObjDataCache->lookupObjId($pub_chat_id);
if(!in_array($obj_id,$obj_ids))
{
$unique_data['child'] = $pub_chat_id;
$unique_data['title'] = $ilObjDataCache->lookupTitle($obj_id);
$unique_data['obj_id'] = $obj_id;
$unique_data['ref_id'] = $pub_chat_id;
$unique_chats[] = $unique_data;
$obj_ids[] = $obj_id;
}
}
foreach(ilUtil::_getObjectsByOperations("chat","read",$ilUser->getId(),-1) as $chat_id)
{
$obj_id = $ilObjDataCache->lookupObjId($chat_id);
if(!in_array($obj_id,$obj_ids))
{
$unique_data['child'] = $chat_id;
$unique_data['title'] = $ilObjDataCache->lookupTitle($obj_id);
$unique_data['obj_id'] = $obj_id;
$unique_data['ref_id'] = $chat_id;
$unique_chats[] = $unique_data;
$obj_ids[] = $obj_id;
}
}
return $unique_chats ? $unique_chats : array();
}

+ Here is the call graph for this function:

ilChatRoom::getAllRoomsOfObject ( )

Definition at line 582 of file class.ilChatRoom.php.

References $data, $res, DB_FETCHMODE_OBJECT, and getObjId().

{
global $ilDB;
$query = "SELECT * FROM chat_rooms ".
"WHERE chat_id = ".$ilDB->quote($this->getObjId())."";
$res = $this->ilias->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$data[$row->room_id]["room_id"] = $row->room_id;
$data[$row->room_id]["owner"] = $row->owner;
$data[$row->room_id]["title"] = $row->title;
$data[$row->room_id]["owner"] = $row->owner;
}
return $data ? $data : array();
}

+ Here is the call graph for this function:

ilChatRoom::getCountActiveUser (   $chat_id,
  $room_id 
)

Definition at line 335 of file class.ilChatRoom.php.

References $res, and $room_id.

{
global $ilDB;
$query = "SELECT * FROM chat_user ".
"WHERE chat_id = ".$ilDB->quote($chat_id)." ".
"AND room_id = ".$ilDB->quote($room_id)." ".
"AND last_conn_timestamp > ".time()." - 40";
$res = $this->ilias->db->query($query);
return $res->numRows();
}
ilChatRoom::getErrorMessage ( )

Definition at line 68 of file class.ilChatRoom.php.

References $error_msg.

{
}
ilChatRoom::getGuests ( )

Definition at line 116 of file class.ilChatRoom.php.

{
return $this->guests ? $this->guests : array();
}
ilChatRoom::getInternalName ( )

Definition at line 527 of file class.ilChatRoom.php.

References getObjId(), and getRoomId().

{
if(!$this->getRoomId())
{
return $this->getObjId();
}
else
{
return $this->getObjId()."_".$this->getRoomId();
}
}

+ Here is the call graph for this function:

ilChatRoom::getName ( )

Definition at line 97 of file class.ilChatRoom.php.

References getObjId(), and getRoomId().

{
if(!$this->getRoomId())
{
return $this->getObjId();
}
else
{
// GET NAME OF PRIVATE CHATROOM
}
}

+ Here is the call graph for this function:

ilChatRoom::getOnlineUsers ( )

Definition at line 396 of file class.ilChatRoom.php.

References ilUtil\getUsersOnline().

{
// TODO: CHECK INVITABLE AND ALLOW MESSAGES
}

+ Here is the call graph for this function:

ilChatRoom::getOwnerId ( )

Definition at line 92 of file class.ilChatRoom.php.

References $owner_id.

Referenced by add(), checkWriteAccess(), isInvited(), isOwner(), lookupRoomId(), and validate().

{
}

+ Here is the caller graph for this function:

ilChatRoom::getRoomId ( )
ilChatRoom::getRooms ( )

Definition at line 539 of file class.ilChatRoom.php.

References $_GET, $data, $res, DB_FETCHMODE_OBJECT, and getUserId().

{
global $tree, $ilDB, $rbacsystem;
$query = "SELECT DISTINCT(cr.room_id) as room_id,owner,title,cr.chat_id as chat_id FROM chat_rooms AS cr NATURAL LEFT JOIN chat_invitations ".
"WHERE (owner = ".$ilDB->quote($this->getUserId()).") ".
"OR (guest_id = ".$ilDB->quote($this->getUserId()).")";
if($rbacsystem->checkAccess('moderate', $_GET['ref_id']))
{
$query .= " OR (1) ";
}
$res = $this->ilias->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$data[$row->room_id]["room_id"] = $row->room_id;
$data[$row->room_id]["chat_id"] = $row->chat_id;
$data[$row->room_id]["owner"] = $row->owner;
$data[$row->room_id]["title"] = $row->title;
}
return $data ? $data : array();
}

+ Here is the call graph for this function:

ilChatRoom::getRoomsOfObject ( )

Definition at line 563 of file class.ilChatRoom.php.

References $data, $res, DB_FETCHMODE_OBJECT, getObjId(), and getUserId().

{
global $ilDB;
$query = "SELECT * FROM chat_rooms ".
"WHERE chat_id = ".$ilDB->quote($this->getObjId())." ".
"AND owner = ".$ilDB->quote($this->getUserId())."";
$res = $this->ilias->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$data[$row->room_id]["room_id"] = $row->room_id;
$data[$row->room_id]["owner"] = $row->owner;
$data[$row->room_id]["title"] = $row->title;
$data[$row->room_id]["owner"] = $row->owner;
}
return $data ? $data : array();
}

+ Here is the call graph for this function:

ilChatRoom::getTitle ( )

Definition at line 112 of file class.ilChatRoom.php.

References $title.

Referenced by add(), lookupRoomId(), rename(), and validate().

{
return $this->title;
}

+ Here is the caller graph for this function:

ilChatRoom::getUserId ( )

Definition at line 124 of file class.ilChatRoom.php.

References $user_id.

Referenced by checkAccess(), checkWriteAccess(), getRooms(), getRoomsOfObject(), isOwner(), and updateLastVisit().

{
}

+ Here is the caller graph for this function:

ilChatRoom::ilChatRoom (   $a_id)

Constructor public.

Parameters
integerreference_id or object_id
booleantreat the id as reference_id (true) or object_id (false)

Definition at line 53 of file class.ilChatRoom.php.

References $_SESSION, $ilias, and $lng.

{
global $ilias,$lng,$ilUser;
define(MAX_LINES,1000);
$this->ilias =& $ilias;
$this->lng =& $lng;
$this->obj_id = $a_id;
$this->owner_id = $ilUser->getId();
$this->user_id = $_SESSION["AccountId"];
}
ilChatRoom::invite (   $a_id)

Definition at line 129 of file class.ilChatRoom.php.

References $data, $res, getObjId(), and getRoomId().

{
global $ilDB;
$statement = $ilDB->prepare('
SELECT * FROM chat_invitations
WHERE chat_id = ?
AND room_id = ?
AND guest_id = ?',
array('integer', 'integer', 'integer')
);
$data = array($this->getObjId(), $this->getRoomId(), $a_id);
$res = $ilDB->execute($statement, $data);
if($res->numRows() > 0)
{
$statement = $ilDB->prepareManip('
UPDATE chat_invitations
SET invitation_time = ?,
guest_informed = ?
WHERE chat_id = ?
AND room_id = ?
AND guest_id = ?',
array('integer', 'integer', 'integer', 'integer', 'integer')
);
$data = array(time(), 0, $this->getObjId(), $this->getRoomId(), $a_id);
$res = $ilDB->execute($statement, $data);
}
else
{
$statement = $ilDB->prepareManip(
'INSERT INTO chat_invitations (chat_id, room_id, guest_id, invitation_time) '.
'VALUES(?, ?, ?, ?)',
array('integer', 'integer', 'integer', 'integer')
);
$data = array($this->getObjId(), $this->getRoomId(), $a_id, time());
$res = $ilDB->execute($statement, $data);
}
}

+ Here is the call graph for this function:

ilChatRoom::isInvited (   $a_id)

Definition at line 215 of file class.ilChatRoom.php.

References $res, getObjId(), getOwnerId(), and getRoomId().

Referenced by checkAccess(), and checkWriteAccess().

{
global $ilDB;
$query = "SELECT * FROM chat_invitations AS ci JOIN chat_rooms AS ca ".
"WHERE ci.room_id = ca.room_id ".
"AND ci.chat_id = ".$ilDB->quote($this->getObjId())." ".
"AND ci.room_id = ".$ilDB->quote($this->getRoomId())." ".
"AND owner = ".$ilDB->quote($this->getOwnerId())." ".
"AND ci.guest_id = ".$ilDB->quote($a_id)."";
$res = $this->ilias->db->query($query);
return $res->numRows() ? true : false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilChatRoom::isKicked (   $a_usr_id)

Definition at line 321 of file class.ilChatRoom.php.

References $res, and getObjId().

Referenced by checkWriteAccess().

{
global $ilDB;
$query = "SELECT * FROM chat_user ".
"WHERE kicked = 1 ".
"AND usr_id = ".$ilDB->quote($a_usr_id)." ".
"AND chat_id = ".$ilDB->quote($this->getObjId())."";
$res = $this->ilias->db->query($query);
return $res->numRows() ? true : false;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilChatRoom::isOwner ( )

Definition at line 230 of file class.ilChatRoom.php.

References getOwnerId(), and getUserId().

Referenced by checkAccess().

{
return $this->getOwnerId() == $this->getUserId();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilChatRoom::lookupRoomId ( )

Definition at line 495 of file class.ilChatRoom.php.

References $res, DB_FETCHMODE_OBJECT, getObjId(), getOwnerId(), and getTitle().

{
global $ilDB;
$query = "SELECT * FROM chat_rooms ".
"WHERE title = ".$ilDB->quote($this->getTitle())." ".
"AND chat_id = ".$ilDB->quote($this->getObjId())." ".
"AND owner = ".$ilDB->quote($this->getOwnerId())."";
$res = $this->ilias->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->room_id;
}
return false;
}

+ Here is the call graph for this function:

ilChatRoom::rename ( )

Definition at line 482 of file class.ilChatRoom.php.

References $res, getRoomId(), and getTitle().

{
global $ilDB;
$query = "UPDATE chat_rooms ".
"SET title = ".$ilDB->quote($this->getTitle())." ".
"WHERE room_id = ".$ilDB->quote($this->getRoomId())."";
$res = $this->ilias->db->query($query);
return true;
}

+ Here is the call graph for this function:

ilChatRoom::setKicked (   $a_usr_id)

Definition at line 293 of file class.ilChatRoom.php.

References getObjId().

{
global $ilDB;
$query = "UPDATE chat_user SET kicked = '1' ".
"WHERE usr_id = ".$ilDB->quote($a_usr_id)." ".
"AND chat_id = ".$ilDB->quote($this->getObjId())." ".
"AND room_id = '0'";
$this->ilias->db->query($query);
return true;
}

+ Here is the call graph for this function:

ilChatRoom::setOwnerId (   $a_id)

Definition at line 88 of file class.ilChatRoom.php.

Referenced by __read().

{
$this->owner_id = $a_id;
}

+ Here is the caller graph for this function:

ilChatRoom::setRoomId (   $a_id)

Definition at line 73 of file class.ilChatRoom.php.

References __read().

Referenced by ilObjChatGUI\adminRoomsObject(), checkAccess(), and ilObjChatGUI\renameRoomObject().

{
$this->room_id = $a_id;
// READ DATA OF ROOM
$this->__read();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilChatRoom::setTitle (   $a_title)

Definition at line 108 of file class.ilChatRoom.php.

Referenced by __read(), ilObjChatGUI\addPrivateRoomObject(), and ilObjChatGUI\addRoomObject().

{
$this->title = $a_title;
}

+ Here is the caller graph for this function:

ilChatRoom::setUnkicked (   $a_usr_id)

Definition at line 307 of file class.ilChatRoom.php.

References getObjId().

{
global $ilDB;
$query = "UPDATE chat_user SET kicked = '0' ".
"WHERE usr_id = ".$ilDB->quote($a_usr_id)." ".
"AND chat_id = ".$ilDB->quote($this->getObjId())." ".
"AND room_id = '0'";
$this->ilias->db->query($query);
return true;
}

+ Here is the call graph for this function:

ilChatRoom::setUserId (   $a_id)

Definition at line 120 of file class.ilChatRoom.php.

{
$this->user_id = $a_id;
}
ilChatRoom::updateLastVisit ( )

Definition at line 275 of file class.ilChatRoom.php.

References $res, getObjId(), getRoomId(), and getUserId().

{
// CHECK IF OLD DATA EXISTS
global $ilDB;
$query = "DELETE FROM chat_user ".
"WHERE usr_id = ".$ilDB->quote($this->getUserId())."";
$res = $this->ilias->db->query($query);
$query = "INSERT INTO chat_user ".
"SET usr_id = ".$ilDB->quote($this->getUserId()).", ".
"room_id = ".$ilDB->quote($this->getRoomId()).", ".
"chat_id = ".$ilDB->quote($this->getObjId()).", ".
"last_conn_timestamp = '".time()."'";
$res = $this->ilias->db->query($query);
return true;
}

+ Here is the call graph for this function:

ilChatRoom::validate ( )

Definition at line 402 of file class.ilChatRoom.php.

References getOwnerId(), and getTitle().

{
$this->error_msg = "";
if(!$this->getTitle())
{
$this->error_msg .= $this->lng->txt("chat_title_missing");
}
if(!$this->getOwnerId())
{
$this->ilias->raiseError("MISSING OWNER ID",$this->ilias->error_obj->FATAL);
}
return $this->error_msg ? false : true;
}

+ Here is the call graph for this function:

ilChatRoom::visited (   $a_id)

Definition at line 183 of file class.ilChatRoom.php.

References $res, getObjId(), and getRoomId().

Referenced by checkAccess().

{
global $ilDB;
$query = "UPDATE chat_invitations SET guest_informed = 1 ".
"WHERE chat_id = ".$ilDB->quote( $this->getObjId() )." ".
"AND room_id = ".$ilDB->quote( $this->getRoomId() )." ".
"AND guest_id = ".$ilDB->quote( $a_id )."";
$res = $this->ilias->db->query($query);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilChatRoom::$error_msg

Definition at line 37 of file class.ilChatRoom.php.

Referenced by getErrorMessage().

ilChatRoom::$guests

Definition at line 42 of file class.ilChatRoom.php.

ilChatRoom::$ilias

Definition at line 34 of file class.ilChatRoom.php.

Referenced by ilChatRoom().

ilChatRoom::$lng

Definition at line 35 of file class.ilChatRoom.php.

Referenced by ilChatRoom().

ilChatRoom::$owner_id

Definition at line 40 of file class.ilChatRoom.php.

Referenced by getOwnerId().

ilChatRoom::$ref_id

Definition at line 39 of file class.ilChatRoom.php.

ilChatRoom::$room_id

Definition at line 41 of file class.ilChatRoom.php.

Referenced by _getCountActiveUsers(), getCountActiveUser(), and getRoomId().

ilChatRoom::$title

Definition at line 43 of file class.ilChatRoom.php.

Referenced by getTitle().

ilChatRoom::$user_id

Definition at line 45 of file class.ilChatRoom.php.

Referenced by getUserId().


The documentation for this class was generated from the following file: