4 require_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'));
34 if(
$row = $ilDB->fetchAssoc($rset))
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)',
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)',
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)',
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)',
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 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 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)',
191 'DELETE FROM chatroom_settings WHERE object_id = %s',
196 return parent::delete();
getUserId()
Returns Ilias User ID.
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Clone object permissions, put in tree ...
Class ilObject Basic functions for all objects.
__construct($a_id=0, $a_call_by_reference=true)
{}
static gatherFaPa($a_ref_id, array $a_role_ids, $a_add_action=false)
static createDefaultRole($a_title, $a_description, $a_tpl_name, $a_ref_id)
getId()
get object id public
Class ilChatroomServerConnector.
Create styles array
The data for the language used.
static add($a_action, $a_ref_id, array $a_diff, $a_source_ref_id=false)
getRefId()
get reference id public
static byObjectId($object_id)
Returns ilChatroom object by given $object_id.
getUsername()
Returns username from Object or SESSION.
getPersonalInformation(ilChatroomUser $user)
Prepares and returns $userInfo using given $user object.