4require_once
"./Services/Object/classes/class.ilObject.php";
17 public function __construct($a_id = 0, $a_call_by_reference =
true)
20 parent::__construct($a_id, $a_call_by_reference);
26 return $settings->get(
'public_room_ref', 0);
33 $rset =
$ilDB->query(
'SELECT object_id FROM chatroom_settings WHERE room_type=' .
$ilDB->quote(
'default',
'text'));
36 return $row[
'object_id'];
48 $userInfo =
new stdClass();
60 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
73 'il_chat_moderator_' . $this->
getRefId(),
74 "Moderator of chat obj_no." . $this->
getId(),
83 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree =
false)
90 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
93 $newObj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
95 $objId = $newObj->getId();
97 $original_settings = $original_room->getSettings();
100 $original_settings[
'object_id'] = $objId;
102 $room->saveSettings($original_settings);
104 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
105 $rbac_log_roles = $rbacreview->getParentRoleIds($newObj->getRefId(),
false);
109 require_once
'Modules/Chatroom/classes/class.ilChatroomServerConnector.php';
110 require_once
'Modules/Chatroom/classes/class.ilChatroomServerSettings.php';
111 require_once
'Modules/Chatroom/classes/class.ilChatroomAdmin.php';
113 $settings = ilChatroomAdmin::getDefaultConfiguration()->getServerSettings();
116 $connector->sendCreatePrivateRoom($room->getRoomId(), 0, $newObj->getOwner(), $newObj->getTitle());
124 public function delete()
132 'DELETE FROM chatroom_users WHERE chatroom_users.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
134 array($this->
getId())
138 'DELETE FROM chatroom_history WHERE chatroom_history.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
140 array($this->
getId())
144 'DELETE FROM chatroom_bans WHERE chatroom_bans.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
146 array($this->
getId())
150 'DELETE FROM chatroom_sessions WHERE chatroom_sessions.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
152 array($this->
getId())
156 DELETE FROM chatroom_proomaccess
157 WHERE chatroom_proomaccess.proom_id IN (
158 SELECT chatroom_prooms.proom_id
159 FROM chatroom_prooms WHERE chatroom_prooms.parent_id IN (
160 SELECT chatroom_settings.room_id
161 FROM chatroom_settings
162 WHERE chatroom_settings.object_id = %s
166 array($this->
getId())
170 DELETE FROM chatroom_psessions
171 WHERE chatroom_psessions.proom_id IN (
172 SELECT chatroom_prooms.proom_id
173 FROM chatroom_prooms WHERE chatroom_prooms.parent_id IN (
174 SELECT chatroom_settings.room_id
175 FROM chatroom_settings
176 WHERE chatroom_settings.object_id = %s
180 array($this->
getId())
184 'DELETE FROM chatroom_prooms WHERE chatroom_prooms.parent_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
186 array($this->
getId())
191 'DELETE FROM chatroom_settings WHERE object_id = %s',
193 array($this->
getId())
196 return parent::delete();
An exception for terminatinating execution or to throw for unit testing.
Class ilChatroomServerConnector.
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 @access public.}
initDefaultRoles()
{init default roles settings Purpose of this function is to create a local role folder and local role...
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
Class ilObject Basic functions for all objects.
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Clone object permissions, put in tree ...
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)