5require_once
"./Services/Object/classes/class.ilObject.php";
24 public function __construct($a_id = 0, $a_call_by_reference =
true)
27 $this->
ilObject($a_id, $a_call_by_reference);
38 $userInfo =
new stdClass();
48 return $settings->get(
'public_room_ref', 0);
54 $rset =
$ilDB->query(
'SELECT object_id FROM chatroom_settings WHERE room_type=' .
$ilDB->quote(
'default' ,
'text'));
56 return $row[
'object_id'];
69 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
71 'il_chat_moderator_'.$this->
getRefId(),
72 "Moderator of chat obj_no.".$this->
getId(),
79 public function cloneObject($a_target_id,$a_copy_id = 0,$a_omit_tree =
false) {
81 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
84 $newObj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
88 $objId = $newObj->getId();
92 $original_settings = $original_room->getSettings();
95 $original_settings[
'object_id'] = $objId;
97 $room->saveSettings($original_settings);
100 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
101 $rbac_log_roles = $rbacreview->getParentRoleIds( $newObj->getRefId(),
false );
111 public function delete()
119 'DELETE FROM chatroom_users WHERE chatroom_users.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
121 array($this->
getId())
125 'DELETE FROM chatroom_history WHERE chatroom_history.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
127 array($this->
getId())
131 'DELETE FROM chatroom_bans WHERE chatroom_bans.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
133 array($this->
getId())
137 'DELETE FROM chatroom_sessions WHERE chatroom_sessions.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
139 array($this->
getId())
143 DELETE FROM chatroom_proomaccess
144 WHERE chatroom_proomaccess.proom_id IN (
145 SELECT chatroom_prooms.proom_id
146 FROM chatroom_prooms WHERE chatroom_prooms.parent_id IN (
147 SELECT chatroom_settings.room_id
148 FROM chatroom_settings
149 WHERE chatroom_settings.object_id = %s
153 array($this->
getId())
157 DELETE FROM chatroom_psessions
158 WHERE chatroom_psessions.proom_id IN (
159 SELECT chatroom_prooms.proom_id
160 FROM chatroom_prooms WHERE chatroom_prooms.parent_id IN (
161 SELECT chatroom_settings.room_id
162 FROM chatroom_settings
163 WHERE chatroom_settings.object_id = %s
167 array($this->
getId())
171 'DELETE FROM chatroom_prooms WHERE chatroom_prooms.parent_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
173 array($this->
getId())
178 'DELETE FROM chatroom_settings WHERE object_id = %s',
180 array($this->
getId())
183 return parent::delete();
getUserId()
Returns Ilias User ID.
getUsername()
Returns username from Object or SESSION.
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.
getPersonalInformation(ilChatroomUser $user)
Prepares and returns $userInfo using given $user object.
__construct($a_id=0, $a_call_by_reference=true)
Constructor.
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Clone object permissions, put in tree ...
initDefaultRoles()
@global type $rbacadmin @global type $rbacreview @global ilDB $ilDB
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
Class ilObject Basic functions for all objects.
ilObject($a_id=0, $a_reference=true)
Constructor @access public.
getRefId()
get reference id @access public
getId()
get object id @access public
static add($a_action, $a_ref_id, array $a_diff, $a_source_ref_id=false)
static gatherFaPa($a_ref_id, array $a_role_ids, $a_add_action=false)