4 require_once
'Services/Object/classes/class.ilObject.php';
5 require_once
'Services/Object/classes/class.ilObjectActivation.php';
38 public function __construct($a_id = 0, $a_call_by_reference =
true)
43 parent::__construct($a_id, $a_call_by_reference);
51 $this->access_visibility = (bool) $a_value;
121 $activation->update($this->ref_id);
148 return $settings->get(
'public_room_ref', 0);
155 $rset = $DIC->database()->query(
'SELECT object_id FROM chatroom_settings WHERE room_type=' . $DIC->database()->quote(
'default',
'text'));
156 if (
$row = $DIC->database()->fetchAssoc($rset)) {
157 return $row[
'object_id'];
181 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
194 'il_chat_moderator_' . $this->
getRefId(),
195 "Moderator of chat obj_no." . $this->
getId(),
204 public function cloneObject($a_target_id, $a_copy_id = 0, $a_omit_tree =
false)
208 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
211 $newObj = parent::cloneObject($a_target_id, $a_copy_id, $a_omit_tree);
213 $objId = $newObj->getId();
215 $original_settings = $original_room->getSettings();
218 $original_settings[
'object_id'] = $objId;
220 $room->saveSettings($original_settings);
222 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
223 $rbac_log_roles = $DIC->rbac()->review()->getParentRoleIds($newObj->getRefId(),
false);
227 require_once
'Modules/Chatroom/classes/class.ilChatroomServerConnector.php';
228 require_once
'Modules/Chatroom/classes/class.ilChatroomServerSettings.php';
229 require_once
'Modules/Chatroom/classes/class.ilChatroomAdmin.php';
234 $connector->sendCreatePrivateRoom($room->getRoomId(), 0, $newObj->getOwner(), $newObj->getTitle());
242 public function delete()
246 $DIC->database()->manipulateF(
247 'DELETE FROM chatroom_users WHERE chatroom_users.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
249 array($this->
getId())
252 $DIC->database()->manipulateF(
253 'DELETE FROM chatroom_history WHERE chatroom_history.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
255 array($this->
getId())
258 $DIC->database()->manipulateF(
259 'DELETE FROM chatroom_bans WHERE chatroom_bans.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
261 array($this->
getId())
264 $DIC->database()->manipulateF(
265 'DELETE FROM chatroom_sessions WHERE chatroom_sessions.room_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
267 array($this->
getId())
270 $DIC->database()->manipulateF(
272 DELETE FROM chatroom_proomaccess 273 WHERE chatroom_proomaccess.proom_id IN ( 274 SELECT chatroom_prooms.proom_id 275 FROM chatroom_prooms WHERE chatroom_prooms.parent_id IN ( 276 SELECT chatroom_settings.room_id 277 FROM chatroom_settings 278 WHERE chatroom_settings.object_id = %s 282 array($this->
getId())
285 $DIC->database()->manipulateF(
287 DELETE FROM chatroom_psessions 288 WHERE chatroom_psessions.proom_id IN ( 289 SELECT chatroom_prooms.proom_id 290 FROM chatroom_prooms WHERE chatroom_prooms.parent_id IN ( 291 SELECT chatroom_settings.room_id 292 FROM chatroom_settings 293 WHERE chatroom_settings.object_id = %s 297 array($this->
getId())
300 $DIC->database()->manipulateF(
301 'DELETE FROM chatroom_prooms WHERE chatroom_prooms.parent_id IN (SELECT chatroom_settings.room_id FROM chatroom_settings WHERE chatroom_settings.object_id = %s)',
303 array($this->
getId())
307 $DIC->database()->manipulateF(
308 'DELETE FROM chatroom_settings WHERE object_id = %s',
310 array($this->
getId())
313 if ($this->
getId()) {
319 return parent::delete();
getUserId()
Returns Ilias User ID.
setAccessType($access_type)
setAccessBegin($access_begin)
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
{}
static getDefaultConfiguration()
Instantiates and returns ilChatroomAdmin object using instance_id and settings from settingsTable...
__construct($a_id=0, $a_call_by_reference=true)
{}
static getItem($a_ref_id)
Get item data.
const TIMINGS_DEACTIVATED
setAccessVisibility($a_value)
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)
setAccessEnd($access_end)
getId()
get object id public
Class ilChatroomServerConnector.
static deleteAllEntries($a_ref_id)
Delete all db entries for ref id.
update($pash, $contents, Config $config)
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.
Class ilObjectActivation.